Skip to content
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

Added documentation for the documentation generator #83

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

CMurtagh-LGTM
Copy link
Contributor

Some documentation for the new ./b documentation generation script.

Copy link
Member

@JosephusPaye JosephusPaye left a comment

Choose a reason for hiding this comment

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

Some suggestions...

src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
The `--outdir` argument gives the directory that the JSON output will be written, defaults to `./doc/extract-documentation/` directory.

The `-m` or `--multiprocess` argument tells the command to use multiprocessing to greatly reduce the processing time, but uses a very large amount of RAM, about 1GB per thread.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a guide for turning the output into a usable graph image or set of images? Do you recommend a JSON to dot converter which will work out of the box?
Also, a link to the clang API docs you used for reference would be nice.
In fact, a page about the tool, how it works, and how to use it wouldn't be a bad idea - something similar to the NUgan page.

Copy link
Member

@JosephusPaye JosephusPaye Jan 26, 2021

Choose a reason for hiding this comment

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

The plan is to eventually extract the documentation, generate the images, and submit a PR to NUbook. Ideally automatically in CI when NUbots code changes.

The JSON here is custom, and I think Cameron has written something that does the conversion and generates an image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@KipHamiltons Have you found any clang api docs? I haven't.
If you need to convert to DOT https://gist.github.com/ElderNoSpace/f0042e99b713601e0589a7692f6bff75
I don't think this tool warrants its own page.

Copy link
Member

Choose a reason for hiding this comment

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

Here is a couple of links which would perhaps be useful? I'll let you be the judge of whether they give good insight into using the python bindings.
https://libclang.readthedocs.io/en/latest/
https://clang.llvm.org/doxygen/group__CINDEX.html
https://eli.thegreenplace.net/2011/07/03/parsing-c-in-python-with-clang

src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
@Bidski
Copy link
Collaborator

Bidski commented Jan 30, 2021

Wait .... The documentation generator doesn't generate its own documentation???? Missed opportunity


The `extract-documentation` command of `b` generates a JSON file documenting each Module. It lists each reactor, with their on statements and emit statements. The on and emit statements have their location in the file and their dsl worlds also.

The `--indir` argument gives the root of the directories that will be documented, defaults to the `./module/` directory.
Copy link
Member

Choose a reason for hiding this comment

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

Probably best to make these arguments a table

src/book/02-system/01-foundations/02-build-system.mdx Outdated Show resolved Hide resolved
@CMurtagh-LGTM CMurtagh-LGTM marked this pull request as draft July 3, 2021 06:20
Co-authored-by: Josephus Paye II <[email protected]>
@LachlanCourt LachlanCourt added the documentation Improvements or additions to documentation label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants