<div dir="ltr">FYI, you could have simply inserted:<div><br></div><div>    .. contents::</div><div><br></div><div>Details here:</div><div><a href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents">https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents</a> </div><div> <br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">David Goodger<br><<a href="https://david.goodger.org" target="_blank">https://david.goodger.org</a>></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 10, 2020 at 9:51 AM Sumana Harihareswara <<a href="mailto:sh@changeset.nyc">sh@changeset.nyc</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Here is a tip for anyone who is converting a complicated page on the <br>
wiki from reStructuredText to MoinMoin wiki format, as I just did <br>
<a href="https://wiki.python.org/psf/PackagingWG?action=diff&rev1=107&rev2=108" rel="noreferrer" target="_blank">https://wiki.python.org/psf/PackagingWG?action=diff&rev1=107&rev2=108</a> . <br>
I'd been looking for an rST-to-MoinMoin converter but hadn't found one, <br>
so I ended up using pandoc to get to an intermediate HTML state, then an <br>
HTML-to-MoinMoin format.<br>
<br>
(I did this so I could use the  `<<TableOfContents()>>`  syntax to <br>
automatically get a table of contents and easy anchor tag links to page <br>
sections.)<br>
<br>
Cleaned up to remove backtracking, I:<br>
<br>
1) copied the rST source text of the page into a local file, <br>
packagingwg.rst<br>
<br>
2) removed the `#format rst` line from the start (but copied the rest of <br>
the hashmarked stuff from the start, like an #acl line, into a separate <br>
scratch pad to retain for later)<br>
<br>
3) turned the rST into HTML using pandoc: `pandoc -o packagingwg.html <br>
packagingwg.rst` (this gave me a few errors, like "[WARNING] Reference <br>
not found for 'fundable packaging improvements' at chunk line 1 column <br>
50", which meant it slightly misformatted a few internal wiki links<br>
<br>
4) installed libhtml-wikiconverter-moinmoin-perl which is available as a <br>
Debian package<br>
<br>
5) converted from HTML to MoinMoin using  `html2wiki --dialect=MoinMoin <br>
packagingwg.html > packagingwg.wiki`<br>
<br>
6) pasted the non-format-related hashmarked lines from my scratch pad <br>
into the start of packagingwg.wiki<br>
<br>
7) corrected the "Reference not found" errors by removing the `|` in any <br>
hyperlinks that had turned into `[[|internal-pagename]`<br>
<br>
8) replaced the contents of the page source with packagingwg.wiki<br>
<br>
Worked fine!<br>
<br>
Only on the revision AFTER that (so, knowing what format to use for the <br>
renderer, I suppose) will MoinMoin properly preview a table of contents <br>
for the page. So, heads-up.<br>
<br>
If there is an easier rst-to-MoinMoin path, or if there's a table of <br>
contents syntax available that works for reStructuredText-formatted <br>
pages on <a href="http://wiki.python.org" rel="noreferrer" target="_blank">wiki.python.org</a>, please let me know! I looked but I may have <br>
missed something.<br>
<br>
-- <br>
Sumana Harihareswara<br>
Changeset Consulting<br>
<a href="https://changeset.nyc" rel="noreferrer" target="_blank">https://changeset.nyc</a><br>
_______________________________________________<br>
pydotorg-www mailing list<br>
<a href="mailto:pydotorg-www@python.org" target="_blank">pydotorg-www@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pydotorg-www" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/pydotorg-www</a><br>
</blockquote></div>