-
Notifications
You must be signed in to change notification settings - Fork 31
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
Allow collections to add RST files #255
Allow collections to add RST files #255
Conversation
I don't feel qualified to actually review this but it looks great. I could definitely see myself using this for c.hv! |
e7ff655
to
f01ddee
Compare
(I've just rebased so this PR includes all other docs building PRs that were merged today. Makes it easier to test for me :) ) |
f01ddee
to
bc22f12
Compare
bc22f12
to
aec3ecb
Compare
aec3ecb
to
089f07d
Compare
As discussed at the docs meeting, I've renamed I've also updated the example ansible-collections/community.docker@main...felixfontein:scenario-guide, which (still) results in https://ansible.fontein.de/collections/community/docker/. ready_for_review |
089f07d
to
616400e
Compare
I think we should use a name other than docsite for the names of these functions and variables. We're already using docsite to refer to building docs.ansible.com as a whole. How about one of the following:
|
antsibull/docsite_docs.py
Outdated
raise DocsiteIndexError('extra-docs.yml does not exist') | ||
|
||
try: | ||
index = load_yaml_file(index_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I note that this is synchronous code rather than async code. The majority of time is going to be spent reading and writing the actual page data rather than the extra-docs.yml file so it's not the end of the world but it is a point where we could be doing things in parallel. I assume you coded it as synchronous for easy reuse with antsibull-lint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason is that the IO part of this function is done by load_yaml_file
, which is not async either. It is also used to load routing data for collections, so eventually it should be converted to async, but once that's done adjusting the calling code is also not so hard, so I would defer adjusting this function until then. Is that ok for you?
I renamed docsite to this in a3aa61d. |
4f22297
to
c7e7a3b
Compare
Everything looks good! Talked with felixfontein earlier and he will squash this manually so we can look at the saving-content-in-memory implementation later if we need to, then go ahead and merge it. Thanks @felixfontein ! |
c7e7a3b
to
c2bcd06
Compare
c2bcd06
to
93a7073
Compare
@abadger @briantist thanks a lot for reviewing this! |
Migrates scenario guide from ansible/ansible repo SUMMARY Related to ansible-community/antsibull-build#255. Do we need to rename the page index.rst? Or add an index.rst file? Also needs a PR against ansible/ansible removing this content from there. ISSUE TYPE Docs Pull Request COMPONENT NAME docs.ansible.com Depends-On: ansible/ansible-zuul-jobs#962 Reviewed-by: Mark Chappell <None> Reviewed-by: Alicia Cozine <None> Reviewed-by: Jill R <None>
The RST files have to be in
docs/docsite/rst/
(and subdirs), need to use labels of the formansible_collections.{namespace}.{name}.docsite.
(RST files not satisfying that are ignored), and there needs to be aindex.yml
which allows to add sections to the main collection page and allows to say which files show up in the toctree for that section (also allows to directly reference things).Example branches:
These result in:
There's a lint tool for collection owners (
antsibull-lint collection-docs /path/to/collection
), it checks RST labels and also runsrstcheck
.The PR also contains a commit which ensures that "empty" collections (which have no documentable plugins) are shown in the index, and will obtain docs. Example: https://ansible.fontein.de/collections/felixfontein/acme/ (that collection only has roles;
I'll add docsite RST files for these eventually, currently I only have MD filesit now has role docs as well)