Skip to content

Instantly share code, notes, and snippets.

@felixfontein
Created April 12, 2022 12:29
Show Gist options
  • Save felixfontein/c851fa4ef503c6394c82ad9f900077a7 to your computer and use it in GitHub Desktop.
Save felixfontein/c851fa4ef503c6394c82ad9f900077a7 to your computer and use it in GitHub Desktop.
antsibull-docs demo
# Create and activate Python virtual environment
python3 -m venv antsibull-test
cd antsibull-test
. bin/activate
# Install ansible-core and antsibull-docs
pip install ansible-core antsibull-docs
# Create collection directory
mkdir collections
export ANSIBLE_COLLECTIONS_PATHS="$(pwd)/collections/"
# Install community.crypto from Galaxy
ansible-galaxy collection install community.crypto
# Install community.docker from git
git clone https://github.com/ansible-collections/community.docker.git collections/ansible_collections/community/docker
# Create simple docsite
mkdir docsite
antsibull-docs sphinx-init --help
antsibull-docs sphinx-init --use-current --dest-dir docsite/ community.crypto community.docker
# Set up docsite build
cd docsite
pip install -r requirements.txt
# Look at what the build script does
cat ./build.sh
# Run the build script
./build.sh
# Look at HTML output
chromium build/html/index.html
# Validate collection documentation
antsibull-docs lint-collection-docs collections/ansible_collections/community/crypto/
antsibull-docs lint-collection-docs collections/ansible_collections/community/docker/
# GitHub Actions workflow for validating collection docs:
https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/extra-docs-linting.yml
@felixfontein
Copy link
Author

If you are interested in GHA actions related to this, take a look at https://github.com/ansible-community/github-docs-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment