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

[Bug] docs: remaining issues with markdown manual using mkdocs #4748

Open
6 of 19 tasks
neteler opened this issue Nov 23, 2024 · 2 comments
Open
6 of 19 tasks

[Bug] docs: remaining issues with markdown manual using mkdocs #4748

neteler opened this issue Nov 23, 2024 · 2 comments
Labels
bug Something isn't working docs help wanted Extra attention is needed manual Documentation related issues markdown Python Related code is in Python
Milestone

Comments

@neteler
Copy link
Member

neteler commented Nov 23, 2024

Describe the bug

After the important work in #3849 to enable a markdown based manual using mkdocs this report collects yet open issues.

Prep

Convert HTML files to Markdown: -> see #4620

Issue collection

Manual pages not properly generated (a man/build_*.py issue):

  • intro page: missing GUI introduction page --> fixed in docs: add Intro: Graphical User Interface #4746
  • wxGUI pages: dist.x86_64-pc-linux-gnu/docs/mkdocs/site/wxGUI.md and related are missing from mkdocs:
    • WARNING - Doc file 'g.gui.rdigit.md' contains a link 'wxGUI.md', but the target is not found among documentation files.
    • WARNING - Doc file 'g.gui.rdigit.md' contains a link 'wxGUI.components.md', but the target is not found among documentation files., etc.
      • issue must be in man/build_class.py in which wxGUI is not yet supported

Missing files to be installed (a Makefile issue):

  • icons: the GUI icons/ directory is yet missing: dist.x86_64-pc-linux-gnu/docs/mkdocs/site/icons/ (see wxGUI.md etc. which needs it)
  • barscales PNG files : WARNING - Doc file 'd.barscale.md' contains a link 'barscales/classic.png', but the target is not found among documentation files.
  • colortables PNG files : WARNING - Doc file 'd.vect.md' contains a link 'colortables/population_dens.png', but the target is not found among documentation files. etc.
  • northarrows PNG files : WARNING - Doc file 'd.northarrow.md' contains a link 'northarrows/9.png', but the target is not found among documentation files.
  • further files to be installed into MD space:
    • display/d.graph/grass_logo.txt
    • gui/wxpython/gmodeler/g_gui_gmodeler_zipcodes_avg_elevation.gxm
  • some files are not showing up in mkdocs:
    • r.mapcalc, r.colors, ...
    • projectionintro, base files is doc/projectionintro.html

Formatting issues:

  • leftover .html: mkdocs warning e.g. "'d.mon.md' contains 'wxGUI.html#map-display-window'" which should be ' 'wxGUI.md#map-display-window' --> fixed in docs: script to convert HTML manual pages to markdown #4620
  • keywords: missing dash instead of white space (maybe to be fixed in lib/gis/parser_rest_md.c" line 507?):
  • keywords: anchors are expected to be lowercase (e.g., #ACCA -> #acca) --> fixed in manual: markdown support fixes and HTML fixes #4807
  • topic filenames contain white spaces in MD filenames:
  • keywords anchors: warnings in build-mkdocs step (cd man; make build-mkdocs):
    • Doc file 'topic_time management.md' contains a link 'keywords.md#time management', but the doc 'keywords.md' does not contain an anchor '#time management'. -> it should be 'keywords.md#time-management'` --> fixed in manual: markdown support fixes and HTML fixes #4807
  • JSON codeblocks should be marked as such rather than bash (e.g. in r.report manual page), not sure how to automate this
  • C codeblocks should be marked as such rather than bash (e.g. in r.li.daemon manual page), not sure how to automate this

Too complex figure code in HTML

Our HTML style recommendation for figures is not converted properly.

Some figures looks ugly after MD conversion:

Comment: While pandoc LUA filters might do the job the highly individual HTML code seems to suggest that only manual HTML -> markdown conversion will address these issues. Manual (?) edits will be needed in ~170 files.

@neteler neteler added bug Something isn't working manual Documentation related issues docs markdown labels Nov 23, 2024
@landam landam added this to the 8.5.0 milestone Nov 23, 2024
@neteler
Copy link
Member Author

neteler commented Nov 27, 2024

keywords: missing dash instead of white space (maybe to be fixed in lib/gis/parser_rest_md.c" line 507?):

This seems to help:

--- a/lib/gis/parser_rest_md.c
+++ b/lib/gis/parser_rest_md.c
@@ -537,7 +537,7 @@ void print_escaped_for_md_keywords(FILE *f, const char *str)
         else {
             /* keyword index */
             char *str_link;
-            str_link = G_str_replace(str_s, " ", "%20");
+            str_link = G_str_replace(str_s, " ", "-");
             G_str_to_lower(str_link);
             fprintf(f, "[%s](keywords.md#%s)", str_s, str_link);
             G_free(str_link);

Does it make sense, @landam?

==> see attempt in #4807

@neteler neteler added help wanted Extra attention is needed Python Related code is in Python labels Dec 1, 2024
neteler added a commit that referenced this issue Dec 6, 2024
This PR addresses issues identified in #4748:

Manual pages:
- fixes of broken HTML tags, href entries and broken URLs not converted properly
- fix title of `lib/btree2/btree2lib.dox`

Markdown support in build system:
- `.html` -> `.md` file extension fixes
- replace white space in keyword anchors with dash (expected by mkdocs)
- avoid white space in "topics" file names
- avoid ":" in title (looks bad in side menu)
- reorder mkdocs navigation menu and add missing entries (`man/mkdocs/mkdocs.yml`)
@neteler
Copy link
Member Author

neteler commented Dec 6, 2024

Help wanted: while most formatting issues are now solved, I need support for the missing files to be installed (see description above): I just don't get why they aren't installed into the "mkdocs" subdirectories?

neteler added a commit to neteler/grass that referenced this issue Dec 14, 2024
This PR contains various updates and textual fixes (incl. adding missing intro sentences) in preparation of the planned markdown conversion (see also OSGeo#4748).

For an easier review, the changes have been submitted in separate commits:

- [ ] **db**:
- [ ] **display**:
- [ ] **doc**:
- [ ] **general**:
- [ ] **gui**:
- [ ] **imagery**:
- [ ] **lib**:
- [ ] **misc**:
- [ ] **raster**:
- [ ] **raster3d**:
- [ ] **scripts**:
- [ ] **temporal**:
- [ ] **vector**:
- [ ] **visualization**:
neteler added a commit that referenced this issue Dec 17, 2024
This PR contains various HTML updates and textual fixes in preparation for the planned markdown conversion (see also #4748).

For this PR, I have (briefly) reviewed all ~600 GRASS GIS manual pages by converting them to MD for a quality check, and then updated the original HTML files accordingly. Thus it is also a backport candidate for G84.

Changes in detail:

- adding missing intro sentences
- added module name in the first sentence where missing
- http -> https
- selected URL updates for broken URLs
- selected additions in "SEE ALSO" sections
- fix suboptimal HTML formatting (flags, special names, ...)
- add missing keywords on metapages
- remove leftover `Last changed: $Date$` entries from CVS/SVN days
- simplify selected `-<dl><dt>...` to `<ul><li>...` for improved MD conversion
- replaced `<tt>...</tt>` with `<code>...</code>` 

For an easier review, the changes have been submitted in separate commits:

- [x] **db**: 473b95b
- [x] **display**: fca42da
- [x] **doc**: e473bc8
- [x] **general**: 00930f5
- [x] **gui**: e9259cf
- [x] **imagery**: e700a7c, c888dba
- [x] **lib**: 6da27ca
- [x] **misc**: bfa7c0d
- [x] **raster**: 0c5ca83
- [x] **raster3d**: 0c44c95
- [x] **scripts**: e5bd683, 7b70b03
- [x] **temporal**: a173a8f
- [x] **vector**: b5167fa
- [x] **visualization**: 81e9756

Extra changes:
- [x] replaced `<tt>...</tt>` with `<code>...</code>` in 14841b2
- [x] dot product: replaced `.` with `&middot;` f8ea200
- [x] review by @echoix: 1645685 and 6fd0a66
- [x] `utils/g.html2man/htmltags.txt`: dropped outdated file (see instead `utils/g.html2man/ggroff.py`) in 92597b2

Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
neteler added a commit that referenced this issue Dec 17, 2024
…ort of #4837)

This PR contains various HTML updates and textual fixes in preparation for the planned markdown conversion (see also #4748).

For this PR, I have (briefly) reviewed all ~600 GRASS GIS manual pages by converting them to MD for a quality check, and then updated the original HTML files accordingly. Thus it is also a backport candidate for G84.

Changes in detail:

- adding missing intro sentences
- added module name in the first sentence where missing
- http -> https
- selected URL updates for broken URLs
- selected additions in "SEE ALSO" sections
- fix suboptimal HTML formatting (flags, special names, ...)
- add missing keywords on metapages
- remove leftover `Last changed: $Date$` entries from CVS/SVN days
- simplify selected `-<dl><dt>...` to `<ul><li>...` for improved MD conversion
- replaced `<tt>...</tt>` with `<code>...</code>`

For an easier review, the changes have been submitted in separate commits:

- [x] **db**: 473b95b
- [x] **display**: fca42da
- [x] **doc**: e473bc8
- [x] **general**: 00930f5
- [x] **gui**: e9259cf
- [x] **imagery**: e700a7c, c888dba
- [x] **lib**: 6da27ca
- [x] **misc**: bfa7c0d
- [x] **raster**: 0c5ca83
- [x] **raster3d**: 0c44c95
- [x] **scripts**: e5bd683, 7b70b03
- [x] **temporal**: a173a8f
- [x] **vector**: b5167fa
- [x] **visualization**: 81e9756

Extra changes:
- [x] replaced `<tt>...</tt>` with `<code>...</code>` in 14841b2
- [x] dot product: replaced `.` with `&middot;` f8ea200
- [x] review by @echoix: 1645685 and 6fd0a66
- [x] `utils/g.html2man/htmltags.txt`: dropped outdated file (see instead `utils/g.html2man/ggroff.py`) in 92597b2

Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs help wanted Extra attention is needed manual Documentation related issues markdown Python Related code is in Python
Projects
Development

No branches or pull requests

2 participants