readthedocs / recommonmark

A markdown parser for docutils
https://recommonmark.readthedocs.io/
MIT License
340 stars 252 forks source link

auto_toc_tree docs link no usable examples #135

Closed ghost closed 2 years ago

ghost commented 5 years ago

The auto_toc_tree/AutoStructify docs link no usable examples for enabling or using the auto_toc_tree functionality:

https://recommonmark.readthedocs.io/en/latest/auto_structify.html#autostructify-component

  1. conf.py link broken, def setup() function use unclear

    The docs mention an incomplete conf.py where it's not clear who is even supposed to call the setup() function (the default conf.py doesn't have this function, is that something sphinx will call automatically?) and the linked conf.py example link is broken.

  2. markdown example very minimal, index.md for more complete example mentioned but no link

    The markdown example is so minimal it is hard to tell if that is really all that is needed (will it really just convert any link list to a TOC? Isn't that a bit of an overkill approach?) and an index.md I am supposed to look at is mentioned, but it's not actually linked.

Also, is there a reason why recommonmark for sphinx doesn't always enable this as soon as I use it? Who wants to write markdown docs without a TOC? I don't understand why this is all not enabled per default in the first case, which is a part of the reason why this is apparently such an effort to understand & enable

ghost commented 5 years ago

For what it's worth, I tested this small markdown snippet now:

This is a [test](custom_widget.md)

* [Custom Widgets](custom_widgets.md)

And I get this output:

Running Sphinx v1.8.3
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: 2 added, 0 changed, 0 removed
/home/jonas/.local/lib/python3.7/site-packages/recommonmark/parser.py:65: UserWarning: Container node skipped: type=document
  warn("Container node skipped: type={0}".format(mdnode.t))
reading sources... [100%] index                                                                
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/jonas/Develop/wobblui/docs/custom_widget.md: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] index                                                                 
/home/jonas/Develop/wobblui/docs/index.md:12: WARNING: None:any reference target not found: ./custom_widgets
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 2 warnings.

The HTML pages are in build/html.

When I open up the result, the first link in the sentence works fine, and the one in the table of contents doesn't. (but at least they are generated, I managed to do it finally) Do I need to specify TOC links differently? Sorry, I'm not really a sphinx expert... I'm a bit stumped the one link works and two lines below in that TOC thing the same link won't work