0

I've been using Sphinx for my personal website for the past years and realized that I more have a blog with posts and few pages and did the conversion to Nikola in the past days. I also took the opportunity to switch to Markdown as I use it with R and Stack Overflow and everywhere else as well.

I have set in my Sphinx theme to have a local table of contents in the sidebar. There are a handful of very long (over 10k words) posts that would benefit from a local table of contents. I saw that the Nikola manual is written in reST and uses the contents directive. I would like to use that also in those posts.

I could convert these few posts back to reST and use the contents directive, but I'd like to avoid that. Can this be accomplished somehow?

Martin Ueding
  • 8,245
  • 6
  • 46
  • 92

2 Answers2

2

Nikola uses Python-Markdown by default. It supports a TOC extension that one can enable in the conf.py. Then one can use a [TOC] marker anywhere in the document to get a local table of contents.

Martin Ueding
  • 8,245
  • 6
  • 46
  • 92
  • As an additional note: To enable the TOC extension in Nikola, you need to add `markdown.extensions.toc` to your config. For example: ```python MARKDOWN_EXTENSIONS = ['markdown.extensions.toc'] ``` After that, using `[TOC]` works for me. – daco Nov 17 '22 at 20:51
1

Updated

Using [TOC] which is a feature of an extension enabled by default. My firts answer was an misinterpretation of your question.

Firts answer

Using Nikola, may be you are interested in "archive" option. This is a default page that include all your posts (optional, this is grouped by date). Example in my blog: https://www.cosmoscalibur.com/archive.html .

cosmoscalibur
  • 1,131
  • 1
  • 8
  • 17