Anchor links for headings when authoring page using Markdown

10 views
Skip to first unread message

Atma B Mani

unread,
Jan 28, 2020, 9:40:34 AM1/28/20
to nikola-discuss
Is it possible to get anchor links for headings when authoring a blog or page in Markdown? When I use RST or Jupyter Notebooks, I have this feature, but not with Markdown.

Is there a setting that I need to enable in conf.py file? I am pasting relevant sections of my conf.py file below if that will be of help:

COMPILERS = {
   "rest": ('.rst', '.txt'),
   "markdown": ('.md', '.mdown', '.markdown'),
   "textile": ('.textile',),
   "txt2tags": ('.t2t',),
   "bbcode": ('.bb',),
   "wiki": ('.wiki',),
   "ipynb": ('.ipynb',),
   "html": ('.html', '.htm'),}

...

MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.meta',
'markdown.extensions.codehilite', 'markdown.extensions.extra']
...



Roberto Alsina

unread,
Jan 28, 2020, 9:46:29 AM1/28/20
to Nikola—Discuss
Looks like we implemented this?


You need to add a add_header_permalinks filter. Relevant docs here: https://getnikola.com/handbook.html#post-processing-filters  (look for add_header_permalinks)

--
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/0169cccf-fa4e-4763-98dd-f4635b2646df%40googlegroups.com.
Message has been deleted

Atma B Mani

unread,
Jan 29, 2020, 6:06:50 PM1/29/20
to nikola-discuss
Thanks, that worked - for pages in Markdown. Although, now pages from Notebooks have a weird double pilcrow (¶) sign as in the picture below

Is there a way to remove it or make this work just for markdown and not for notebook files/?

On Tuesday, January 28, 2020 at 6:46:29 AM UTC-8, Roberto Alsina wrote:
Looks like we implemented this?


You need to add a add_header_permalinks filter. Relevant docs here: https://getnikola.com/handbook.html#post-processing-filters  (look for add_header_permalinks)

On Tue, Jan 28, 2020 at 11:40 AM Atma B Mani <atmabh...@gmail.com> wrote:
Is it possible to get anchor links for headings when authoring a blog or page in Markdown? When I use RST or Jupyter Notebooks, I have this feature, but not with Markdown.

Is there a setting that I need to enable in conf.py file? I am pasting relevant sections of my conf.py file below if that will be of help:

COMPILERS = {
   "rest": ('.rst', '.txt'),
   "markdown": ('.md', '.mdown', '.markdown'),
   "textile": ('.textile',),
   "txt2tags": ('.t2t',),
   "bbcode": ('.bb',),
   "wiki": ('.wiki',),
   "ipynb": ('.ipynb',),
   "html": ('.html', '.htm'),}

...

MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.meta',
'markdown.extensions.codehilite', 'markdown.extensions.extra']
...



--
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-...@googlegroups.com.

Roberto Alsina

unread,
Jan 29, 2020, 7:23:28 PM1/29/20
to Nikola—Discuss
You wanted permalinks in headers. That's a header, it got a permalink

I can't think of a way to avoid it right now.

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/39d378a4-5d5a-42dc-a155-1c649422b4bd%40googlegroups.com.

Kevin Sheppard

unread,
Jan 29, 2020, 7:25:54 PM1/29/20
to nikola-...@googlegroups.com
You can use some css to make them invisible. 

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/39d378a4-5d5a-42dc-a155-1c649422b4bd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages