Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of Contents #3

Open
lcizzle opened this issue May 7, 2014 · 4 comments
Open

Table of Contents #3

lcizzle opened this issue May 7, 2014 · 4 comments

Comments

@lcizzle
Copy link
Contributor

lcizzle commented May 7, 2014

This is more of a feature request. I'm learning Ruby right now and will try and tackle this soon myself.

I don't even know if this is possible but the table of contents setup right now seems very limited. I think it would be cool if we could have a different toc per set of pages.

So maybe we could move the table of contents settings into their own file and load different tocs per set of pages by name.

Example: My current documentation page has 2 sections that each require their own toc. A toc: tag in markdown would be ideal but I don't know if this is possible. Or {% nav_toc(toc-name) %} would also be ideal.

Any ideas on how to better implement this?

@noelwelsh
Copy link
Member

I don't completely understand what you're after, but it might be possible
with the 'collections' feature introduced in Jekyll 2.0:
http://jekyllrb.com/docs/collections/

On Wed, May 7, 2014 at 4:38 PM, Jeremy Easoz [email protected]:

This is more of a feature request. I'm learning Ruby right now and will
try and tackle this soon myself.

I don't even know if this is possible but the table of contents setup
right now seems very limited. I think it would be cool if we could have a
different toc per set of pages.

So maybe we could move the table of contents settings into their own file
and load different tocs per set of pages by name.

Example: My current documentation page has 2 sections that each require
their own toc. A toc: tag in markdown would be ideal but I don't know if
this is possible. Or {% nav_toc(toc-name) %} would also be ideal.

Any ideas on how to better implement this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3
.

@lcizzle
Copy link
Contributor Author

lcizzle commented May 9, 2014

I think this page would be a good example of what I am talking about. http://haxeflixel.com/documentation/

Each section, Getting Started, Community, Handbook, and Resources have their own table of contents.

With the implementation currently in Jekyll-Docs it looks like we can only have 1 single / global table of contents?

I was just thinking it would be cool if we could have more than one. Otherwise I have been coding my navs inside the layouts by hand using bootstrap which isn't too hard.

@davegurnell
Copy link
Member

The code as it stands currently supports many TOCs, but only global ones.
You can generate extra TOCs in your pages using a custom Liquid tag
called nav_toc:

{% nav_toc %}

The resulting HTML can be styled using CSS.

As I mentioned above, the current implementation only supports global TOCs.
However, it would be relatively straightforward to enhance the tag with an
optional parameter to specify the URL of the root of the tree (or a page ID
or something like that).

We don't currently need this feature at Untyped so I probably won't get
around to implementing it in the near future. I'm happy to accept a PR
along these lines though.

Cheers,

Dave

On 9 May 2014 21:56, Jeremy Easoz [email protected] wrote:

I think this page would be a good example of what I am talking about.
http://haxeflixel.com/documentation/

Each section, Getting Started, Community, Handbook, and Resources have
their own table of contents.

With the implementation currently in Jekyll-Docs it looks like we can only
have 1 single / global table of contents?

I was just thinking it would be cool if we could have more than one.
Otherwise I have been coding my navs inside the layouts by hand using
bootstrap which isn't too hard.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-42712925
.

Dave Gurnell, Untyped
http://untyped.com
07967 004805

@lcizzle
Copy link
Contributor Author

lcizzle commented May 11, 2014

Ok, thanks! Let me dig into Ruby a little more and i'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants