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

docs: use 'exec' directive to generate content in examples.rst #739

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

umarcor
Copy link
Member

@umarcor umarcor commented Sep 6, 2021

This PR is based on #730, so I'll keep it as a draft until that one is merged.

Currently, we build the documentation by executing tools/build_docs.py. That imports docs_utils.py, where function examples is used for generating docs/examples.rst. All of that is done before executing Sphinx.

In this PR, an alternative solution is proposed. A generic exec directive is added to Sphinx, which allows executing arbitrary Python code somewhere "inside" an .rst source. Hence, docs/examples.rst is created, and the exec directive is used for executing examples() in there. In order to do so, the examples() function was changed for using print instead of writing to a file.

By the way, function get_theme is moved to tools/build_docs.py and tools/build_utils.py is removed.

@umarcor umarcor force-pushed the doc-exec branch 3 times, most recently from f390174 to 2d29230 Compare September 7, 2021 19:43
@umarcor umarcor force-pushed the doc-exec branch 2 times, most recently from 831ee6a to 66bbe69 Compare September 27, 2021 22:57
@eine eine added this to the v4.6.0 milestone Sep 28, 2021
@umarcor umarcor marked this pull request as ready for review October 8, 2021 15:10
@eine eine merged commit deda28b into VUnit:master Oct 8, 2021
@umarcor umarcor deleted the doc-exec branch October 8, 2021 15:14
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.

None yet

2 participants