[ 
https://issues.apache.org/jira/browse/SPARK-8352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15012546#comment-15012546
 ] 

Kai Jiang commented on SPARK-8352:
----------------------------------

This is what I currently have done. 
([diff|https://github.com/apache/spark/compare/master...vectorijk:spark-8352]) 
[Demo|http://docs.vectorijk.info]
bq. IMO, the exact styling isn't important because I don't think that's the 
hard part of getting this to work. 
Agree with you. 
bq. AFAIK, when I last looked at this the hard part was getting the generated 
HTML into a form that contained the right anchors, etc. for the affix TOC 
stuff. 
Cause in markdown files, it contains {{"{:toc}"}} to generate well-formed 
anchor links of TOC, we just need to wrap {{<nav></nav>}} around TOC and move 
it to sidebar on the left side. Affix TOC, we could add attribute to {{<nav>}}. 
All operations are via javascript.
I know it is more efficient that generate TOC via jekyll directly. But I 
couldn't find the way to implement so far. 

The part I haven't finish is display sub-level title correctly. AFAIK, it is 
more easy to handle sub-level use Bootstrap 3. So, I am still figuring out 
doing this in Bootstrap 2.

What's your idea?

> Affixed table of contents, similar to Bootstrap 3 docs
> ------------------------------------------------------
>
>                 Key: SPARK-8352
>                 URL: https://issues.apache.org/jira/browse/SPARK-8352
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Documentation
>            Reporter: Josh Rosen
>            Priority: Minor
>         Attachments: screenshot-1.png, sidebar2.1.0.png
>
>
> Some of our documentation pages are getting kind of long and hard to 
> navigate.  Bootstrap 3's documentation 
> (http://getbootstrap.com/getting-started/) has a nice solution for this: 
> their table of contents stays with you on the side of the page as you scroll 
> and its subheaders expand / collapse based on your scroll position, making it 
> easy to know where you are in the document.
> We should consider doing this for our docs, too, although it may require some 
> more involved post-processing steps in Jekyll in order to insert the right 
> DOM elements so that the scrollspy / affix stuff works properly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to