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

[Epic] Migrate docs from current Sphinx/rst based format to mkdocs and Markdown #2

Open
11 of 52 tasks
foosel opened this issue Jun 29, 2022 · 1 comment
Open
11 of 52 tasks
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@foosel
Copy link
Member

foosel commented Jun 29, 2022

Sub tasks (still building up, in no way to be considered exhaustive yet):

  • migrate features
    • access control
    • custom controls
    • gcode scripts
    • action commands
    • at commands
    • plugins
    • safe mode
  • bundled plugins
    • action command notification
    • action command prompt
    • announcement
    • anonymous usage tracking
    • application keys
    • backup
    • discovery
    • error tracking
    • file check
    • firmware check
    • gcode viewer
    • logging
    • plugin manager
    • software update
    • virtual printer
  • migrate config stuff
    • yaml primer
    • config.yaml
    • logging.yaml
    • cli
  • migrate events
    • event list into dev section
    • config into features
  • migrate REST API
    • Link basic REST primer
  • migrate JS Client lib docs
  • migrate core dev stuff
    • versioning
    • branching
    • dev environment
    • virtual printer
    • profiling
  • migrate Plugin dev guide
    • general concepts
    • control properties
    • mixins
    • hooks
    • helpers
    • injected properties
    • viewmodels
    • tutorial
    • distribution
    • python 3 migration (?)

Migration of docstrings happens in 'improve/mkdocs' branch of OctoPrint/OctoPrint. Current preview available at octoprint.github.io/docs.

Open questions:

  • What to do about existing deep links into the Sphinx based documentation structure? Add a ton of redirects? Can this somehow be automated? If not, just go through the pain of some 404s?
@foosel foosel added the documentation Improvements or additions to documentation label Jun 29, 2022
@foosel foosel self-assigned this Jun 29, 2022
@foosel foosel moved this to Todo in OctoPrint Backlog Jun 29, 2022
@foosel foosel moved this from Todo to In Progress in OctoPrint Backlog Jun 29, 2022
@foosel
Copy link
Member Author

foosel commented Jul 11, 2023

Issues with mkdocstrings:

  • Tricky to manually enable protected parts of the API (e.g. stuff that's supposed to be implemented in subclasses) to be rendered into the docs. An adjustment of gen_ref_pages.py however helps here (regexes with additional options for mkdocstrings), see here and here.
  • No option that I have so far found to manually add additional member functions to a class doc, as needed for PluginSettings. The getters and setters are implemented dynamically through __getattr__. It might work through a simple list, but that's ugly, doesn't integrate with the toc and is overall just meh.

So I got the idea to check out Myst and sphinx-autodoc2. And at first things look good, but alas, sphinx-autodoc2 currently doesn't support our Google docstrings, e.g.

Arguments
  foo (str): doc for foo

Returns:
  (str): Some return value

It only supports Sphinx based parameter docs, e.g.

:param str foo: doc for foo
:rtype str:
:return: Some return value

That's obviously less readable, and thus would be a step backwards. So for now we'd not be able to use Markdown in the docstrings, which would then get us back to having to write Restructured Text, and this whole exercise here is about getting rid of rSt for good.

I'm starting to feel the tooling might not yet be fully there. I'll tinker around with both a bit more to see if I can find solutions for either one that will work for OctoPrint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: In Progress
Development

No branches or pull requests

1 participant