geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
423 stars 489 forks source link

User Manual refresh using Markdown and MkDocs #7286

Closed jodygarnett closed 9 months ago

jodygarnett commented 1 year ago

Meeting

Demo / discussion:

  1. Review of docs/manual/README.md build and deploy instructions
  2. Deploy with mike was cool, but more research needed. Open question how to have 4.4-SNAPSHOT docs? latest redirects to 4.2.5 and is not separate
  3. Open question on handling of translations (whole document or POT files)

Decisions:

merge planning:

Final Review Update

Review:

How-to included in PR:

IMPORTANT:

The translate script handles sphinx-build content and references, this information will be lost once we are done. Until the migration is complete it is important to correct content (broken links) and formatting (for indenting, accidental block quotes) in the origional rst files.

See pull-request: https://github.com/geonetwork/doc/pull/245

Code-complete update

  1. Preview available here https://jodygarnett.github.io/core-geonetwork/

    • We are interested in review of the content

    • Want to ensure the xml and javascript code examples are not harmed in the transition for example

  2. The docs are now pretty much 100% convertible using Jody's translate script wrapper on pandoc:

    python3 -m translate rst manual/**/*.rst
  3. With this script working so well it is now "easier" to fix the sphinx-build content to correct formatting for indenting, accidental block quotes and the like.

  4. For later:

    • Any restructuring/improvement of content
    • Decision about translating using POT (weblate or transfix) or whole document conversion (deeply, google, apple)

Initial code-sprint proposal

The following work is proposed: https://github.com/geonetwork/core-geonetwork/wiki/Proposal-mkdocs.md

Keep in mind:

Compare:

Example page:

jodygarnett commented 1 year ago

Code sprint notes:

Discussion:

jodygarnett commented 1 year ago

Note we will need to wish to update the sample data for screen snaps (some web services have changed and we need an update in order to have working Add to map demo):

MichelGabriel commented 1 year ago

It would be nice to add an extra menu to the GeoNetwork menu bar that points to parts of the documentation.

jodygarnett commented 1 year ago

There is a link in the footer presently and a build option to include docs in release.

I hope we can include a small “online help”’for visitors. If we do the online help doc theme right it can pick up the logo of the running geonetwork and have a similar menu bar appearance.

jodygarnett commented 1 year ago

Okay the script is doing great for converting files unattended, however references are a pain to update manually.

Looks like we have 366 items to update:

grep --include=\*.rst -rnw . -e ":ref:`.*`" | wc -l                                                                                                                                         366

Reviewing examples:

./overview/change-log/version-3.10.1.rst:10:* CSW / Configuration of the capabilities is now done using a service metadata record :ref:`csw-configuration`
./annexes/standards/dublin-core.rst:25:* :ref:`dublin-core-view-default`
./annexes/standards/iso19115-3.2018.rst:121:See :ref:`iso19115-3.2018-elem-mdb-identificationInfo-7b3f7b7fbb8a986c92658058fe54f876`

So while may end up being links to page, or header, references. The last example seems unnecessarily difficult!

The online manual has https://geonetwork-opensource.org/manuals/4.0.x/en/annexes/standards/iso19115-3.2018.html?#iso19115-3-2018-tab-identificationinfo

The annexes/standards/iso19115-3.2018.rst source has:

.. _iso19115-3.2018-elem-mdb-identificationInfo-7b3f7b7fbb8a986c92658058fe54f876:

Identification info
===================

:Name:

    mdb:identificationInfo

:Description:

.. raw:: html

   Basic information about the resource(s) to which the metadata
         applies

So something seems off, perhaps these things linked to the external

jodygarnett commented 1 year ago

How many anchors do we have:

 grep --include=\*.rst -rnw . -e "^.. _.*:$" | wc -l                                                                                                                                    
    2105

Well that is intimidating:

./api/index.rst:1:.. _api-guide:
./overview/change-log/version-3.10.7.rst:1:.. _version-3107:
./annexes/standards/dublin-core.rst:164:.. _dublin-core-elem-dc-contributor-0974cafd6cf5302fe8501874dbe3b3ac:

The vast majority are in the annexes, most of the other are simple page lookup.

jodygarnett commented 1 year ago

Processing by hand:

grep --include=\*.rst -rnw . -e "^.. _.*:$" > anchors.txt

Grep search and replace (I used an editor):

Result anchor=absolute markdown reference

toc=/index.md#toc
administrator-guide=/administrator-guide/index.md#administrator-guide
...

With one leftover:

annexes/standards/iso19139.rst:24731:.. _iso19139-cl-gmd-MD_ScopeCode-/ancestor--node()[name()='gmd-MD_Metadata']/gmd-identificationInfo/srv-SV_ServiceIdentification:

See attached: anchors.txt

fxprunayre commented 1 year ago

@jodygarnett some documentation pages are created from the schema plugins

So Annexes > Standards > * and https://geonetwork-opensource.org/manuals/4.0.x/en/customizing-application/editor-ui/creating-custom-editor.html can probably be excluded from your scripts and we can probably replace rst writer by the new format in https://github.com/geonetwork/core-geonetwork/tree/main/docs/schema-doc/src/main/resources

jodygarnett commented 1 year ago

Well this is disheartening - @MichelGabriel updated the version of mkdocs-i18n-static to version 1.0.x and we have encountered a bug: https://github.com/ultrabug/mkdocs-static-i18n/issues/258

I do hope these plugins do not change often, but I was using a <1.0 release of mkdocs-18n-static so change should be expected.

I think the nice thing to do for now is to leave the files as text, and include them in one big long change log. Renaming the files would be unpleasant.

jodygarnett commented 1 year ago

The PR is now code complete, preview available for visual review here https://jodygarnett.github.io/core-geonetwork/

jodygarnett commented 1 year ago

We can probably replace rst writer by the new format in https://github.com/geonetwork/core-geonetwork/tree/main/docs/schema-doc/src/main/resources

Thanks for that information - ticket here: https://github.com/geonetwork/core-geonetwork/issues/7342

MichelGabriel commented 1 year ago

It looks like some of the relative links are broken, they always point to the file in the same directory, which is not always the case and the named anchor seems to end up in the filename somehow.

jodygarnett commented 1 year ago

Updated the bug description, all links are fixed and the build is clean with no warnings.

I am getting private feedback on content - I would prefer of content updates are in a second pull request.

jodygarnett commented 1 year ago

I enabled the language chooser, but here is some strange interaction with using mike to publish versions. I opened a ticket here https://github.com/ultrabug/mkdocs-static-i18n/issues/265 in hopes of guidance.

Update: resolved by reading the manual (site_url was required)

jodygarnett commented 12 months ago

I think this ticket can now be closed?