Error in rendering reStructuredText

106 views
Skip to first unread message

rengel

unread,
Oct 31, 2019, 4:06:09 AM10/31/19
to leo-editor
When I try to view Leo's doc in the viewrendered pane I get an 'Unknown directive type "index"' error (see image).

Reinhard


view.jpg


rengel

unread,
Nov 1, 2019, 11:28:40 AM11/1/19
to leo-editor
No suggestion?

Chris George

unread,
Nov 1, 2019, 12:11:19 PM11/1/19
to leo-editor
Leo's documentation is in Sphinx markup. AFAIK, the rendered pane doesn't render that particular markup.

HTH,

Chris

On Friday, November 1, 2019 at 8:28:40 AM UTC-7, rengel wrote:
No suggestion?

Chris George

unread,
Nov 1, 2019, 12:18:43 PM11/1/19
to leo-editor
1. Here is a link to a rst example page. https://www.southampton.ac.uk/~fangohr/computing/rst/rst.txt
2. Paste into a body node and use @language rest at the top.

Viewrendered does its thing.

Viktor Ransmayr

unread,
Nov 1, 2019, 2:51:53 PM11/1/19
to leo-e...@googlegroups.com
Hello Chris & Edward,

Am Fr., 1. Nov. 2019 um 17:18 Uhr schrieb Chris George <techn...@gmail.com>:

1. Here is a link to a rst example page. https://www.southampton.ac.uk/~fangohr/computing/rst/rst.txt
2. Paste into a body node and use @language rest at the top.

@ Chris: I agree with your analysis. - Sphinx is not a currently supported format of the vr-plugin.

@ Edward: IMO the vr-plugin 'deserves' a special status, since it's recommended/ required for Leo to properly work at an end-user's infrastructure ...

Now that further input formats are added (as part of 6.1) should this plugin/ problem report not be prioritized/ treated differently?

With kind regards,

Viktor

rengel

unread,
Nov 2, 2019, 1:36:33 AM11/2/19
to leo-editor

On Friday, November 1, 2019 at 5:18:43 PM UTC+1, Chris George wrote:
1. Here is a link to a rst example page. https://www.southampton.ac.uk/~fangohr/computing/rst/rst.txt
2. Paste into a body node and use @language rest at the top.

Viewrendered does its thing.
 
@Chris
Thanks for the link, but I did know the reStructuredText docs.
The screenshot I posted is straight out of LeoDocs.leo; so I supposed that there shouldn't be any errors.
Putting '@language rest' at the top doesn't work.
Putting '@rst' in front of the header doesn't work either.

I.e.: Just try to render
LeoDocs.leo\Leo's Documentation\Tutorials\@rst html\tutorial-basics.html\Leo's main window
Here, I get the 'Unknown directive type "index" error' twice.
And the markup for bold text ('**') isn't honoured either.

Reinhard

Edward K. Ream

unread,
Nov 2, 2019, 5:26:52 AM11/2/19
to leo-editor
On Fri, Nov 1, 2019 at 11:11 AM Chris George <techn...@gmail.com> wrote:

Leo's documentation is in Sphinx markup.

Sphinx is a tool, not a markup language.  Sphinx use restructured text as its markup language, as explained on the very first sphinx page.  I'm pretty sure I've said this before. Please, let's not spread confusion on this topic.

Edward

Edward K. Ream

unread,
Nov 2, 2019, 5:28:50 AM11/2/19
to leo-editor
On Fri, Nov 1, 2019 at 11:18 AM Chris George <techn...@gmail.com> wrote:
1. Here is a link to a rst example page. https://www.southampton.ac.uk/~fangohr/computing/rst/rst.txt
2. Paste into a body node and use @language rest at the top.

Viewrendered does its thing.

Yes.  This should work.

Edward

Edward K. Ream

unread,
Nov 2, 2019, 5:37:32 AM11/2/19
to leo-editor


On Saturday, November 2, 2019 at 4:26:52 AM UTC-5, Edward K. Ream wrote:

Sphinx is a tool, not a markup language.  Sphinx use restructured text as its markup language, as explained on the very first sphinx page.  I'm pretty sure I've said this before. Please, let's not spread confusion on this topic.

Hah.  It looks like I have been the one spreading the confusion, specifically in the top-level node "Leo's Documentation" in LeoDocs.leo:

QQQ
These are the sources for Leo's users guide.

They contain sphinx markup. See::

http://sphinx.pocoo.org/
http://docutils.sourceforge.net/docs/user/rst/quickstart.html
QQQ

Rev f293543 corrects this:

QQQ
These are the sources for Leo's users guide.

They contain restructured text markup for the sphinx tool. See::

    http://docutils.sourceforge.net/rst.html
    http://sphinx.pocoo.org/
    http://docutils.sourceforge.net/docs/user/rst/quickstart.html
QQQ

My apologies for confusing docs.

Edward

Edward K. Ream

unread,
Nov 2, 2019, 5:41:12 AM11/2/19
to leo-editor
On Sat, Nov 2, 2019 at 12:36 AM rengel <reinhard...@gmail.com> wrote:

The screenshot I posted is straight out of LeoDocs.leo; so I supposed that there shouldn't be any errors.

That's not necessarily true.  The @rst tree may contain markup in previous nodes that is required for the particular node you are viewing.

In practice, I don't use the VR pane when editing Leo's docs.  I just run the rst3 command, then let sphinx tell me if there are errors.

Edward

rengel

unread,
Nov 2, 2019, 10:14:10 AM11/2/19
to leo-editor


On Saturday, November 2, 2019 at 10:41:12 AM UTC+1, Edward K. Ream wrote:


On Sat, Nov 2, 2019 at 12:36 AM rengel <reinhar...@gmail.com> wrote:

The screenshot I posted is straight out of LeoDocs.leo; so I supposed that there shouldn't be any errors.

That's not necessarily true.  The @rst tree may contain markup in previous nodes that is required for the particular node you are viewing.

In practice, I don't use the VR pane when editing Leo's docs.  I just run the rst3 command, then let sphinx tell me if there are errors.



Ok, thanks for the clarification!

Chris George

unread,
Nov 2, 2019, 5:11:37 PM11/2/19
to leo-editor
Good point.

But sphinx does add markup that is not supported by docutils.

For example, I clipped the first toctree from Leo's documentation and put it into its very own node with the @language rest at the top.

@language rest


.. toctree::

:maxdepth: 2

preliminaries


Which netted me:

System Message: ERROR/3 (<string>, line 1)

Unknown directive type "toctree".

Chris

Edward K. Ream

unread,
Nov 4, 2019, 11:53:25 AM11/4/19
to leo-editor
You're welcome.

Edward

Edward K. Ream

unread,
Nov 4, 2019, 12:01:13 PM11/4/19
to leo-editor
On Sat, Nov 2, 2019 at 4:11 PM Chris George <techn...@gmail.com> wrote:

But sphinx does add markup that is not supported by docutils.

For example, I clipped the first toctree from Leo's documentation and put it into its very own node with the @language rest at the top.

@language rest


.. toctree::

:maxdepth: 2

preliminaries


Which netted me:

System Message: ERROR/3 (<string>, line 1)

Unknown directive type "toctree".

Yes, that's expected.  The VR plugin calls docutils to format the body text, and docutils doesn't understand the extra sphinx directives.

There is nothing that can be done about this exact issue.  However, I have just reopened #1388 and assigned it to 6.2.

Edward

Thomas Passin

unread,
Mar 2, 2020, 8:28:51 PM3/2/20
to leo-e...@googlegroups.com
I believe that you need @rst in the node's headline (or in the headline of a node higher up with less indentation  in the subtree).  As I recall, having the @language directive in the body is not enough.

For VR3 - sorry, still a few things to clear up before release - I have provided a menu to select the default type when there is no @language in the headline.  You can select RsT, MD, or text.  The example node renders as expected even without the directive in the headline.  I have found this ability to select a default to be useful.

Of course, you still can't render a Sphinx TOC directive ...
Reply all
Reply to author
Forward
0 new messages