hieroglyph icon indicating copy to clipboard operation
hieroglyph copied to clipboard

slide level-0

Open Coding-Badly opened this issue 6 years ago • 3 comments

https://github.com/nyergler/hieroglyph/blob/1ef062fad5060006566f8d6bd3b5a231ac7e0488/src/hieroglyph/writer.py#L349

I believe that line of code is a mistake. With multi-file projects section_level goes below one / is one less than the correct value after each file is processed. Removing that line eliminates the problem.

I will happily provide a pull request or an example.

Coding-Badly avatar Mar 27 '18 06:03 Coding-Badly

Ah, makes sense; I suppose that should be something like self.section_level = max(0, self.section_level - 1) ?

A PR would be fantastic, thanks!

nyergler avatar Mar 28 '18 20:03 nyergler

I still suspect the line should be entirely removed; that section_level should not be adjusted at that point.

What is the intention? Why should section_level be adjusted in visit_start_of_file?

Coding-Badly avatar Mar 28 '18 20:03 Coding-Badly

I believe the intention was that when you had multi-file slide decks that the headings would be "right" going from one file to the next. I'd have to look more closely at the commit to figure out if the test gives more context.

nyergler avatar Mar 28 '18 20:03 nyergler