-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use global link definitions. #155
Comments
@drybjed Heard someone whispering about avoiding redundancy … 😉 Investigate how the |
Wrote scripts to generate: * Ansible modules * DebOps roles (likes to GitHub repo) * DebOps Contrib roles (likes to GitHub repo) * ypid roles (likes to GitHub repo, seamless self plug. Added my private Ansible roles for reference.) Implements: debops#155 Usage for roles (or other DebOps repos): Create `./docs/includes/all.rst`: ```rst .. include:: includes/global.rst ``` Ensure line present in `.gitignore`: ```rst docs/includes/global.rst ``` Copy https://github.com/debops/docs/tree/master/docs/includes/global.rst to `docs/includes/global.rst` Use in docs like so (example `docs/getting-started.rst`): ```rst Getting started =============== .. contents:: :local: .. include:: includes/all.rst DebOps_ rocks! .. ↑ makes it a hyperlink. ``` Thats all. Enjoy 😉
Works by symlinking the global.rst which is included in this repo to all submodules which have a `docs/includes` directory in them. This allows to update the definition in on central place. Wrote scripts to generate: * Ansible modules * DebOps roles (likes to GitHub repo) * DebOps Contrib roles (likes to GitHub repo) * ypid roles (likes to GitHub repo, seamless self plug. Added my private Ansible roles for reference.) Usage for roles (or other DebOps repos): Create `./docs/includes/all.rst`: ```rst .. include:: includes/global.rst ``` Ensure line present in `.gitignore`: ```rst docs/includes/global.rst ``` Optional: copy https://github.com/debops/docs/tree/master/docs/includes/global.rst to `docs/includes/global.rst` (Only needed when the repos should be build as standalone for testing.) Use in docs like so (example `docs/getting-started.rst`): ```rst Getting started =============== .. contents:: :local: .. include:: includes/all.rst DebOps_ rocks! .. ↑ makes it a hyperlink. ``` Thats should be all. Enjoy 😉 Implements: debops#155
Just a little detail when using subdirectories in To allow local hyperlink definitions, I did go with a two staged include. To still support this. I would suggest a little hack which consists of creating |
Automated edit done by: https://github.com/ypid/ypid-ansible-common/blob/1a1128714b2bedb0ae427b8e4879084542558117/bin/sphinx-inline Some changes had to be manually reverted to make the build pass (e. g. variable not defined in this single docs context). Related to: debops/docs#155
Hm, readthedocs.org does currently not run the Makefile at all. This means that the Possible solution:
Docs currently work, only without the hyperlinks: http://docs.debops.org/en/latest/debops-playbooks/docs/changelog.html#id123 |
Now, that’s what I am talking about: http://docs.debops.org/en/latest/debops-playbooks/docs/changelog.html
Docs build: https://readthedocs.org/projects/debops/builds/4211003/ Fixed by: #178 |
* Use global.rst hyperlinks. Ref: debops/docs#155 * Use Sphinx inline syntax: Example: debops/docs#153 * Fixed typos Most of the changes are an automated edit done by [sphinx-inline](https://github.com/ypid/ypid-ansible-common/blob/master/bin/sphinx-inline). PR depends on: debops/docs#191
TL;DR https://github.com/debops/docs/blob/master/docs/includes/global.rst gets injected into all role docs when the
includes
directory is present. Theglobal.rst
should not be in role repos itself (and ignored using the.gitignore
file). To update theglobal.rst
, please add links to the files starting with two digits in https://github.com/debops/docs/tree/master/docs/includes and domake includes/global.rst
in https://github.com/debops/docs/tree/master/docs.This allows to easily refer to Ansible modules, other DebOps roles and so on with a uniform name.
See:
The script sphinx-debops-role-build can automaticly copy the latest global definitions to roles.
Resources are proposed to be moved to a repo inside the DebOps project.(is ignored in the repo and injected at build time)The text was updated successfully, but these errors were encountered: