#4771 TOC macro doesn't add headers of included pages [ss246]

unreleased
open
nobody
General
nobody
2015-02-22
2012-08-23
Chris Tsai
No

[forge:site-support:#246]

On the page above there is a table of contents just underneath the Versions Heading, and then each of the headings after that are included from seperate pages per version. I would expect that the table of contents to display the headings from the included pages as well as the headings from the current page. This does not happen.

It may just be me not quite understanding it, however it would be nice to have

I've put together a page demonstrating this here: https://sourceforge.net/p/strawhat/wiki/top/

Discussion

<< < 1 2 (Page 2 of 2)
  • Dave Brondsema

    Dave Brondsema - 2014-11-12

    It makes sense to me that TOC be a treeprocessor, that seems appropriate.

    I think ideally the "include" functionality would happen very early, so that all the content would be present for all the rest of the stages. "include" is a macro, which is identified relatively as one of the inlinePatterns, but as you say the output isn't inserted until postprocessor stage when the htmlStash items get inserted. That makes sense for all the other macros, as well as including a file (since it isn't markdown). But for including another markdown page, I think we should grab the child markdown content and insert it into the current text right there (not using htmlStash). Then the rest of the markdown pipeline will apply to it, and not even know it came from a child source. How does that sound? Perhaps the "include markdown" handling would have to be moved forward as a pre-processor, not sure.

    That all said, I am willing to put this back on the backlog if we don't have a good solution. I don't think we should spend tons of time or use a fragile solution.

     
    • Igor Bondarenko - 2014-11-13

      Sounds good. Do you want me to try it now? If this will cause any subtle issues we can postpone it then.

       
      • Dave Brondsema

        Dave Brondsema - 2014-11-13

        Sounds like a good plan to me.

         
    • Igor Bondarenko - 2014-11-20

      This approach works better. I've removed a lot of html-joggling code, so entire approach is more robust and understandable.

      However, there're also some subtle issues, that I can't fix quickly:

      • page with some html in it (especially <pre> tags) gets extra newlines when included example of it here
      • specifying custom attributes like [[include ref=page id=foo]] does not work, since there's no <div>-wrapper around included page. I've tried to add that, but it breaks page rendering (see commented code in my latest commit).

      This code is in ib/4771a (there are test failures)

       

      Last edit: Igor Bondarenko 2014-11-20
  • Igor Bondarenko - 2014-11-20
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2014-11-20
    • status: review --> open
     
  • Dave Brondsema

    Dave Brondsema - 2014-11-20

    Yeah looks like further work is needed to adjust the markdown pipeline properly so that included pages don't get extraneous processing. I'm going to set this ticket back to 'open' and somebody can revisit in the future if they want.

     
  • Dave Brondsema

    Dave Brondsema - 2014-12-01
    • labels: p3, support, 42cc, sf-current, sf-2 --> p3, support
    • assigned_to: Igor Bondarenko --> nobody
    • Reviewer: Dave Brondsema --> nobody
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.