Skip to content

docs: allow manual edits to generated docs#1478

Merged
aignas merged 1 commit intobazel-contrib:mainfrom
aignas:doc/append-bottom-only
Oct 11, 2023
Merged

docs: allow manual edits to generated docs#1478
aignas merged 1 commit intobazel-contrib:mainfrom
aignas:doc/append-bottom-only

Conversation

@aignas
Copy link
Copy Markdown
Collaborator

@aignas aignas commented Oct 9, 2023

Before this PR the documentation used to be next to the source. With
the adjustment of how we generate the markdown files, we can keep user
friendly documentation in markdown and leave the API docs in the .bzl
source code. This improve the maintainability of the docs as editors
have better support for editing markdown in markdown files as opposed to
docstrings within .bzl files.

NOTE: This is implemented via a genrule in order to not expose a macro as an
consumable API.

Summary:

  • chore: mark the documentation files as non-generated
  • chore: chmod -x markdown files
  • feat: adjust doc generation to retain headers and modify the header
  • refactor: move the docs from .bzl and improve them

Work towards #1332

@aignas aignas requested a review from rickeylev as a code owner October 9, 2023 06:46
@aignas aignas force-pushed the doc/append-bottom-only branch from 9469f48 to 9018777 Compare October 9, 2023 11:59
@aignas aignas changed the title docs: add headers to public documentation feat(doc): allow manual edits to generated docs Oct 9, 2023
@aignas aignas force-pushed the doc/append-bottom-only branch from e3d30db to 8fd7109 Compare October 9, 2023 14:27
Before this PR the documentation used to be next to the source. With
the adjustment of how we generate the markdown files, we can keep user
friendly documentation in markdown and leave the API docs in the `.bzl`
source code. This improve the maintainability of the docs as editors
have better support for editing markdown in markdown files as opposed to
docstrings within `.bzl` files.

NOTE: This is implemented via a genrule in order to not expose a macro as an
consumable API.

Summary:
- chore: mark the documentation files as non-generated
- chore: chmod -x markdown files
- feat: adjust doc generation to retain headers and modify the header
- refactor: move the docs from .bzl and improve them

Work towards bazel-contrib#1332
@aignas aignas force-pushed the doc/append-bottom-only branch 2 times, most recently from db7baa3 to edc9e98 Compare October 11, 2023 00:07
@rickeylev rickeylev changed the title feat(doc): allow manual edits to generated docs docs: allow manual edits to generated docs Oct 11, 2023
@rickeylev
Copy link
Copy Markdown
Collaborator

You sure you don't want to just bite the bullet and setup readthedocs? It lets us create rich docs, gives us versioned docs, integrates with PRs, is locally runnable/previewable, and sphinx's plugin system gives us a lot of future options :). I've been pretty impressed and happy with it. I've already reserved the project name on rtd (https://readthedocs.org/projects/rules-python/)

],
outs = [k + ".md_"],
cmd = ";".join([
"sed -En '/{comment_bait}/q;p' <$(location {first}) > $@",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"comment_bait"? I'm unfamiliar with this term -- what does it mean by "bait" ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to have a word to express an idea of some phrase that is used to match when doing text processing. Something that is only there to be replaced later.

@aignas
Copy link
Copy Markdown
Collaborator Author

aignas commented Oct 11, 2023

I agree with the long term solution being RTD. I'll create a separate issue. If anyone would like an easy way to contribute to open source, that would be a good first task.

That said, I'll merge this one for now.

@aignas aignas added this pull request to the merge queue Oct 11, 2023
@aignas aignas mentioned this pull request Oct 11, 2023
5 tasks
Merged via the queue into bazel-contrib:main with commit 669e81e Oct 11, 2023
@aignas aignas deleted the doc/append-bottom-only branch May 13, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants