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
parser: add markdown support #3230
Conversation
A small example here would be nice: grass/general/g.parser/g.parser.html Line 297 in 4744671
Like this:
|
Co-authored-by: Markus Neteler <neteler@osgeo.org>
Python script to validate generated Markdown files: import subprocess
import grass.script as gs
# https://github.com/markdownlint/markdownlint
# sudo apt install ruby-mdl
for cmd in gs.get_commands()[0]:
out_fn = "/tmp/" + cmd + ".md"
fd = open(out_fn, "w")
print([cmd, "--md-description"])
p = subprocess.Popen([cmd, "--md-description"], stdout=fd)
p.wait()
fd.close()
p = subprocess.Popen(["mdl", out_fn])
p.wait() |
Please, add the validation script to utils and run that in CI for couple tool in the additional checks workflow. This will ensure that both this PR is okay and any subsequent tweaks don't break it. |
There is currently a compile error:
|
In this stage I would say that there is no need for to run validation script in CI. CI validation will be probably performed when we will modify system for generating manuals to use markdown. This PR is just about adding |
The PR is ready for review. It adds a new option to the parser:
In Check single module:
Check all modules:
Currently all modules pass this test. This script can be integrated later into CI when the system for generating manual pages will be changed to use markdown (for this task a separated PR will be created). Some validation rules are disabled (see
Parser was also improved for two GRASS modules:
|
Co-authored-by: Markus Neteler <neteler@osgeo.org>
…ce from keyword string Co-authored-by: Markus Neteler <neteler@osgeo.org>
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.
Great work, tested with EN,DE, JA locales. Thanks!
* add markdown parser description * improve also rest parser description * add script for markdown validation * fix option descriptions for r.mapcalc and v.to.db --- Co-authored-by: Markus Neteler <neteler@osgeo.org>
This PR:
--md-description
to produce module usage in MarkdownExample:
Comparision of HTML (right) and Markdown (left):
Tasks
markdownlint