-
-
Notifications
You must be signed in to change notification settings - Fork 307
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: Generate manual from markdown using mkdocs #3849
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
In total, 693 HTML files are generated in Only 3 files now still contain errors (excellent result!): i.zc.html
[error] i.zc.html: SyntaxError: Opening tag "meta" not terminated. (9:9)
[error] 7 | <meta name="viewport" content="width=device-width,initial-scale=1">
[error] 8 |
[error] > 9 | <meta name="description" content="Zero-crossing "edge detection" raster function for image processing.">
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] 10 |
[error] 11 |
[error] 12 | -> quotes in quotes issue r.patch.html
[error] r.patch.html: SyntaxError: Opening tag "meta" not terminated. (9:9)
[error] 7 | <meta name="viewport" content="width=device-width,initial-scale=1">
[error] 8 |
[error] > 9 | <meta name="description" content="Creates a composite raster map layer by using known category values from one (or more) map layer(s) to fill in areas of "no data" in another map layer.">
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] 10 |
[error] 11 |
[error] 12 | -> also quotes in quotes issue manual_gallery.html
[error] manual_gallery.html: SyntaxError: Unexpected closing tag "div". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (631:4)
[error] 629 | </p>
[error] 630 |
[error] > 631 | <p></div>
[error] | ^^^^^^
[error] 632 | <script id="init-glightbox">const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "slide"});
[error] 633 | document$.subscribe(() => { lightbox.reload() });
[error] 634 | </script></body> -> not sure here where this comes from. Also |
I have taken liberty to change the Example: the table in Background of supported flavors: |
Great! Please feel free to create new PR for HTML to MD conversion. This PR (changing build system to support mkdocs/MD) is ready for review. |
Script to convert recursively all .html files to .md (GitHub flavoured Markdown). (see related OSGeo#3849)
Looks great to me! What will be the steps needed in regards to grass-addons after that change? Will they work out of the box? |
This PR is just an initial step. It adds support for markdown-based documentation in build system. HTML-based documentation is still default. And yes, we have to convert also Addons documentation to markdown, similarly as done for GRASS core modules, see #4620 Steps:
It would be also nice to remove RST-related code which was introduced in the past and never finished. |
Goal
Build user manual from Markdown using mkdocs
How to test
man/mkdocs/requirements.txt
/tmp/code.lua
:make distclean; ./configure ...; make
)(cd man; make build-mkdocs)
dist.x86_64-pc-linux-gnu/docs/mkdocs/site/index.html
in web browserTasks
Critical:
mkmarkdown.py
man
: integrate changes frommain
separate makefile rules (Markdown.make, MarkdownRules.make) ?gui/script/
compilationraster
man
--md-description
Important:
build_md.py
and indicesmeta page
comments to MD files (as YAML metadata block)g.extension
for the addonssite_name
to "GRASS GIS 8.5.0dev Reference Manual"Nice to have:
man
dir:GISBASE="/home/martin/src/grass/dist.x86_64-pc-linux-gnu" ARCH="x86_64-pc-linux-gnu" ARCH_DISTDIR="/home/martin/src/grass/dist.x86_64-pc-linux-gnu" VERSION_NUMBER=8.5.0dev VERSION_DATE=2024 python3 ./build_manual_gallery.py
) and seedist.x86_64-pc-linux-gnu/docs/markdown/site/manual_gallery.html
and https://grass.osgeo.org/grass84/manuals/manual_gallery.htmlTasks before merge
Tasks after merge(?)