Building all of the Elastic docs

edit

Building all of the Elastic docs

edit

Building all of the docs runs a link checker to validate cross-document links. While it isn’t generally necessary, if you know the book you are working on has links to/from other books, you can build with --all to validate the links.

To build everything, you must have access to all of the repositories referenced in conf.yaml. If you don’t have the required access privileges, an error will occur during the cloning phase.

To check links before you merge your changes:

  1. Make sure you have the branch with your changes checked out.
  2. Specify the branch you are targeting and the directory that contains your local clone with the --sub_dir option. For example, if you are working on changes that will be merged into the master branch of the elasticsearch repo, run:

    ./docs/build_docs --all --target_repo git@github.com:elastic/built-docs.git \
                      --open --keep_hash --sub_dir elasticsearch:master:./elasticsearch

If there are no outstanding changes in the elasticsearch directory then this will build against the result of merging the last successful docs build and the contents of elasticsearch. If there are outstanding changes then it’ll just build against the contents of elasticsearch.

To run a full build to mimic the website build, omit the --sub_dir and --keep_hash options:

./build_docs --all --target_repo git@github.com:elastic/built-docs.git --open

Running a full build for the first time can be slow (60 mins+) as the build needs to:

  • clone each repository
  • build the docs for each branch

Subsequent runs will pull any changes to the repos and only build the branches that have changed.