zmoog / public-notes

Apache License 2.0
0 stars 1 forks source link

Figure out how to build ESF docs from source #32

Closed zmoog closed 1 year ago

zmoog commented 1 year ago

You are making changes to the ESF docs and want an actual preview of the rendered HTML version before requesting a PR review.

zmoog commented 1 year ago
# clone the Elastic docs and ESF repos
gh repo clone elastic/docs
gh repo clone elastic/elastic-serverless-forwarder

cd docs

Assuming the ESF repo is located at ../../elastic/:

$ ./build_docs --doc ../../elastic/elastic-serverless-forwarder/docs/en/index.asciidoc --open                                                         master
INFO:build_docs:Building HTML from /doc/elastic-serverless-forwarder/docs/en/index.asciidoc
INFO:build_docs:Guessed toplevel=[/doc/elastic-serverless-forwarder] remote=[git@github.com:elastic/elastic-serverless-forwarder] branch=[master] repo=[elastic-serverless-forwarder]
INFO:build_docs:Done
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: using the "epoll" event method
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: nginx/1.14.2
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: OS: Linux 5.15.49-linuxkit
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: getrlimit(RLIMIT_NOFILE): 90000:90000
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: start worker processes
INFO:build_docs:2023/04/28 11:45:22 [notice] 71#71: start worker process 78
INFO:build_docs:Browserslist: caniuse-lite is outdated. Please run next command `npm update`
INFO:build_docs:Browserslist: caniuse-lite is outdated. Please run next command `npm update`
INFO:build_docs:Browserslist: caniuse-lite is outdated. Please run next command `npm update`

After a few seconds, you'll get a browser window with the full page:

CleanShot 2023-04-28 at 13 47 57@2x

dedemorton commented 1 year ago

Another option for building locally is to use the doc build aliases. This ensures that you get all of the dependencies set up correctly.

dedemorton commented 1 year ago

Note that appending --open to the command will open the built docs in a browser window.