Automatic embeding of latest version numbers of modules in docs through special syntax - #183
silviubogan wants to merge 22 commits into
Conversation
but the replacement syntax used works only on full pages such as the home page or the system requirements page, and this is a problem because we should be able to use the replacements in files in the _inc directory too (currently, when using them there, we get either no content visible for what we want or, in code blocks, the replacement not done at all
|
@stevepiercy I am currently chewing the idea that the syntax used to import the |
|
@stevepiercy I also experimented with standard MyST Parser substitutions (Janji2). The advantage is that we get working substitutions in _inc parts (although not in code blocks, which is a requirement). And the disadvantage is that the syntax is uglier, we have to translate the string |
…-should-be-updated
remove redundant string used for testing
…-should-be-updated
- extract the GH latest release feature to a new Python module,
- use the new expanded version of the {{version x/y}} syntax in the case of the
NVM install instructions,
- do some cleanup
|
@silviubogan any script should also work with I also don't know whether a separate script outside of Finally, there are failures in the CI checks that need to be addressed. Please let me know. Thank you! |
…-should-be-updated
…-should-be-updated
stevepiercy
left a comment
There was a problem hiding this comment.
Please see my comment at #183 (comment).
Eventually this will be merged into plone/documentation, and I don't want to wipe out its current functionality. This PR would do that. Is there a way to ensure compatibility between the two?
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Currently, the new substitution syntax is implemented in a separate Python module, next to |
|
@stevepiercy There is no package manager available for Sphinx plugins. Can we use a simple copy-paste? Should we use a separate GitHub repo as a template for it? |
|
@silviubogan let's keep it simple. A copy-paste is sufficient. Although Sphinx extensions can be Python packages, for something this basic I think that making it a package would be more work than copy-paste. My greater concern is whether the existing replacements in https://github.com/plone/documentation/blob/dbbaca6b070cc98ef2ffcd391597241a8842c6e9/docs/conf.py |
|
The failures in the CI checks are there because the new Python module is not found. In the latest commit I've put: - name: Print Python module paths
run: python3 -c "import sys;print(sys.path)"It gives the output: On my laptop, Do you have any advice? |
|
@stevepiercy Bug above solved. Now another CI failure: https://github.com/silviubogan/aurora/actions/runs/36948968346/job/110657400436. The issue is that the coockieplone GH workflow clones the upstream repo, not the fork. I searched the web but did not find how to get the fork owner and name, but I believe this part of the - uses: actions/checkout@v7
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: '' |
Yes, they would integrate. Just uncomment these: # import os
# import sys
# sys.path.insert(0, os.path.abspath("."))and add "latest_gh_version_substitution" to the list "extensions". The "myst_enable_extensions" list contains "substitution", but these substitutions are not as flexible as we need: they do not have parameters.
|
stevepiercy
left a comment
There was a problem hiding this comment.
A few formatting suggestions, and it's good to merge.
|
@silviubogan I tried this in That test helped me better understand what's going on, too. This is a complement to existing replacements. Would you like to make a PR in both the Volto and Documentation repos as well? It could also be a nice Python package, maybe in the collective organization, if you want to go that route. Please let me know. Thank you! |
|
@stevepiercy CI fails only in the fork. After plone/aurora CI is done for the PR, the PR shows "All checks have passed". |
Yes.
Yes. |
but the replacement syntax used works only on full pages such as the home page or the system requirements page, and this is a problem because we should be able to use the replacements in files in the _inc directory too (currently, when using them there, we get either no content visible for what we want or, in code blocks, the replacement not done at all
docs/_incdirectory.source-readevent from Sphinx is called before the{include}Sphinx directive is applied to include the_incs.Closes #179.