You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I just tried python-darkslide and it seems that it contains a bug I have patched years ago in the landslide project but that I forgot to upstream.
When increasing the hierarchy of the document, entries with high level generate an empty entry in the TOC. The code involved is:
if slide_vars['level'] and slide_vars['level'] <= TOC_MAX_LEVEL:
self.add_toc_entry(slide_vars['title'], slide_vars['level'],
slide_number)
else:
# Put something in the TOC even if it doesn't have a title or level
self.add_toc_entry(u"-", 1, slide_number)
Ok, I have produced a MWE. The bugs seems to appear when a "----" is inserted between the first section and the first subsection: the 4th level of section appears empty in the TOC when hitting "t"...
=====================
Développement Android
=====================
.. |year| date:: %Y
.. sectnum::
:depth: 2
Title page
.. The bug is due to the following break:
----
--------------
Le SDK Android
--------------
.. contents::
:local:
:depth: 1
----
Android
-------
Android test
----
L'Operating System
~~~~~~~~~~~~~~~~~~
OS Test
----
Historique des versions
~~~~~~~~~~~~~~~~~~~~~~~
Histo Test
Sorry, wrong copy paste (one level more is needed):
=====================
Développement Android
=====================
.. |year| date:: %Y
.. sectnum::
:depth: 2
Title page
.. The bug is due to the following break:
----
--------------
Le SDK Android
--------------
.. contents::
:local:
:depth: 1
----
Android
-------
Android test
----
L'Operating System
~~~~~~~~~~~~~~~~~~
OS Test
----
Historique des versions
~~~~~~~~~~~~~~~~~~~~~~~
Histo Test
Ok. Thus, probably the TOC should ignore other levels... or support more levels...
In my opinion, there should be a parameter to control the TOC depth from the config file... (I see the variable in generator.py)
I am working on a patch.
Still wondering what is the goal of the else branch:
if slide_vars['level'] and slide_vars['level'] <= TOC_MAX_LEVEL:
self.add_toc_entry(slide_vars['title'], slide_vars['level'],
slide_number)
else:
# Put something in the TOC even if it doesn't have a title or level
self.add_toc_entry(u"-", 1, slide_number)
In what case do we need an entry in the toc if there is no specified level ?
I think the placeholder is there so you can navigate to the titleless slide via toc. I guess the else branch could be removed if the slide numbers are filled into the parent slide, eg:
Activity
ionelmc commentedon Nov 12, 2017
Hmmm, perhaps we could have a better replacement? How about
"(no title)"? What do you usually put in a slide without title?ionelmc commentedon Nov 12, 2017
Another way is to leave it empty (

" ") - I think I like that one best. Eg:ptitmain commentedon Nov 12, 2017
Ok, I have produced a MWE. The bugs seems to appear when a "----" is inserted between the first section and the first subsection: the 4th level of section appears empty in the TOC when hitting "t"...
ionelmc commentedon Nov 12, 2017
Looks like this here:

What version of docutils you have?
ptitmain commentedon Nov 12, 2017
Sorry, wrong copy paste (one level more is needed):
ptitmain commentedon Nov 12, 2017
docutils 0.12
ii docutils-common 0.12+dfsg-1
ionelmc commentedon Nov 12, 2017
I see the problem, there's only support for 2 levels (TOC_MAX_LEVEL). It can be fixed.
ptitmain commentedon Nov 12, 2017
Ok. Thus, probably the TOC should ignore other levels... or support more levels...
In my opinion, there should be a parameter to control the TOC depth from the config file... (I see the variable in generator.py)
ionelmc commentedon Nov 12, 2017
I guess we could change it to 6 (as
<h6>is max) and fixbase.html/screen.cssto support the extra nesting. You wanna do it?We'd need to use a jinja macro to adequately support the variable nesting in
base.html(eg: http://jinja.pocoo.org/docs/2.9/templates/#macros).ptitmain commentedon Nov 12, 2017
Ok, I'll try to do it.
ptitmain commentedon Nov 12, 2017
I am working on a patch.
Still wondering what is the goal of the else branch:
In what case do we need an entry in the toc if there is no specified level ?
ionelmc commentedon Nov 12, 2017
I think the placeholder is there so you can navigate to the titleless slide via toc. I guess the else branch could be removed if the slide numbers are filled into the parent slide, eg:
