Table of Contents in Markdown

20 views
Skip to first unread message

Declan Costello

unread,
Oct 27, 2020, 2:17:06 PM10/27/20
to nikola-discuss
I've set up a brand new local Nikola install and have a sample markdown page that works fine.

I'd like to add a TOC (table of contents) and I think I've enabled everything I need but nothing appears except the text [TOC]
more details here:

Is there something I'm missing when it comes to activating plugins for markdown?

Chris Warrick

unread,
Oct 27, 2020, 3:06:05 PM10/27/20
to Nikola—Discuss
I answered the question on SO, and will repeat the answer here:
`[TOC]` must be in a paragraph of its own.

PS. We’d prefer to keep questions in one place, and this mailing list
would be the best place to ask them — please put your question in the
e-mail next, no need to ask on SO (links to pastebins/repos/demo sites
are fine).

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Declan Costello

unread,
Oct 27, 2020, 6:40:44 PM10/27/20
to nikola-discuss
I tried SO before finding this list, looks like the expertise is here :)
Thanks for the helpful fix, much appreciated. 


Krishnakanth Allika

unread,
Jan 14, 2021, 9:28:30 AMJan 14
to nikola-discuss
I am curious if this will work for ipython files as well. I currently create TOCs manually but something like this would be great.

Mike Ray

unread,
Jan 14, 2021, 9:45:39 AMJan 14
to nikola-...@googlegroups.com
Hello,

I wrote a kramdown plugin.

Kramdown supports TOC.

But when I tried to use the plugin recently in Nikola 8.1.2 it was not
working right.

Kramdown run on its own still works with my files, but running the
plugin doesn't


I can give more details if you like.

If somebody can fix the plugin it would be interesting. I cannot work
out how to debug it in Nikola.

Mike
--
Michael A. Ray
Analyst/Programmer
Witley, Surrey, South-east UK

"Perfection is achieved, not when there is nothing more to add, but when
there is nothing left to take away." -- A. de Saint-Exupery


https://cromarty.github.io/
http://eyesfreelinux.ninja/
http://www.raspberryvi.org/


Krishnakanth Allika

unread,
Jan 14, 2021, 11:21:00 AMJan 14
to nikola-discuss
Hi Mike,

I would like to but I am not sure if I can. I only know some Python and am not well acquainted with web development. Which language did you write the plugin in? And what should I know to be able to work on it?

Krish 

Chris Warrick

unread,
Jan 14, 2021, 12:56:51 PMJan 14
to Nikola—Discuss
On Thu, 14 Jan 2021 at 15:28, Krishnakanth Allika <mai...@dsouza.wbys.in> wrote:
>
> I am curious if this will work for ipython files as well. I currently create TOCs manually but something like this would be great.

IIRC, there is a plugin for nbconvert/jupyter for ToCs. Nikola’s
Markdown compiler pipeline (including markdown extensions settings) is
not used by the ipynb compiler (Jupyter handles that on its own).
> --
> You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/0dc6815f-f9d5-488c-bfee-a8238502e6cbn%40googlegroups.com.

Krishnakanth Allika

unread,
Jan 14, 2021, 1:04:18 PMJan 14
to nikola-...@googlegroups.com
Thank you. I'll check it out.

You received this message because you are subscribed to a topic in the Google Groups "nikola-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nikola-discuss/kK-hpxKqb88/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nikola-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/CAMw%2Bj7KPB-SFp5_5y5EvjEp4Zp5kCG4pQBBNhc%2B2yTep54L%3DxA%40mail.gmail.com.

Mike Ray

unread,
Jan 15, 2021, 8:34:50 AMJan 15
to nikola-...@googlegroups.com
Chris,

It was written in Python. And was really just a rip-off of some other
plugin and I converted it to kramdown.

The original source is quoted in the docs.

nikola plugin install kramdown

Will, I believe, install it.

And then you can take a look at the source.

The problem might be related to the move from 2.7 to 3.

There is a blog entry on my site at:

http://eyesfreelinux.ninja

About kramdown TOCs.

The site is very stale and I am currently re-publishing it. But the blog
post explains how to do TOC in kramdown.

I struggled a bit originally with what I could find online, hence the
blog entry.

Mike
Reply all
Reply to author
Forward
0 new messages