[ 
https://issues.apache.org/jira/browse/SOLR-10612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-10612:
----------------------------
    Attachment: SOLR-10612.patch

bq. So for example: ... each of the 2 big sections could have "In this section" 
TOCs listing just the subsections ...

Talking about this with cassandra on irc led me to the {{pass}} macro in 
asciidoctor..

http://asciidoctor.org/docs/user-manual/#passthru

...which let me get this idea of a "section toc" working ... then i noticed you 
could put the "pass" macro in a page attribute...

http://asciidoctor.org/docs/user-manual/#substitutions-in-an-attribute-entry

...and once i saw that work, i tried refactoring it into an attribute in 
{{_config.yml}} where i discovered that to put arbitrary HTML in asciidoctor 
via jekyll attributes, you don't even need the {{pass}} macro!

So in this updated patch, i've got a proof of concept that let's us put {{ 
\{section-toc\} }} in templates, along with the quick and dirty javascript to 
build a TOC of just that section (currently hard coded to only do h3 tags in 
the same "sect1" section ... could maybe paramaterize that, but we'd need to 
parameterize the section-toc macro to get the specifics into the div)

see {{streaming-expressions.adoc}}/html for the usage/output ... i updated the 
CSS to make sure it's styled just like hte page level TOCs but with a different 
header text, but we can always tweak that to make them more unique if we want.


> make ':toclevels:' work in our jekyll templates
> -----------------------------------------------
>
>                 Key: SOLR-10612
>                 URL: https://issues.apache.org/jira/browse/SOLR-10612
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: documentation
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>         Attachments: lang-analysis-1-level-toc.png, 
> solr-10612-largepage.patch, SOLR-10612.patch, SOLR-10612.patch
>
>
> asciidoc has a concept called {{:toclevels:}} which is suppose to determine 
> which how deep down a page's section/header depth the generated table of 
> contents will show -- ie: some LONG pages have a huge number of level 2 
> headings, and on those pages we only want to show level 1.
> but in jekyll, asciidoctor isn't responsible for generating the TOC -- 
> instead it's done by some javascript (which is better for a variety of 
> reasons) and at the moment this javascript doesn't know anything about 
> {{:toclevels:}}
> But it should be possible to tweak our rendering templates to include 
> {{:toclevels:}} as an attribute in the generated HTML, and then we can tweak 
> the javascript call made to generate the TOC so that it respects it on a 
> per-page basis



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to