Skip to content

toc2 -- Full url in links | #skip tag to skip headers from being inserted#1030

Merged
jcb91 merged 3 commits intoipython-contrib:masterfrom
jfbercher:toc2
Jul 28, 2017
Merged

toc2 -- Full url in links | #skip tag to skip headers from being inserted#1030
jcb91 merged 3 commits intoipython-contrib:masterfrom
jfbercher:toc2

Conversation

@jfbercher
Copy link
Copy Markdown
Member

## This is a title #skip

and this will be rendered as

This is a title

without numbering and will not be inserted in toc.

@jcb91
Copy link
Copy Markdown
Member

jcb91 commented Jul 22, 2017

ah, I hadn't understood your #skip suggestion, then! I think I prefer the other implementation though, so as not to add weird tags for people opening the notebook without toc2 enabled...

@jfbercher
Copy link
Copy Markdown
Member Author

think I prefer the other implementation though, so as not to add weird tags for people opening the notebook without toc2 enabled...

Yes, you are right with that. Let's go with the other solution.

--

@jfbercher
Copy link
Copy Markdown
Member Author

I pushed a variant where any html tag with class "tocSkip" will prevent the corresponding header to be numbered and inserted in toc.

  • This tag will not be displayed if the toc2 extension is not present,
  • this can be employed at any heading level, as many times as necessary ,
  • this will not affect conversion to eg LateX (html tags are removed).

An example is as follows

## A title <a class='tocSkip'>

which will be displayed as

A title

@jcb91
Copy link
Copy Markdown
Member

jcb91 commented Jul 22, 2017

I pushed a variant where any html tag with class "tocSkip" will prevent the corresponding header to be numbered and inserted in toc

Looks like a good plan to me. This can also work in parallel with the automatic solution I've implemented in #1029, I think?

@jcb91
Copy link
Copy Markdown
Member

jcb91 commented Jul 22, 2017

Although, line 537 should be amended to not include the skipped headers in calculating the numbering levels

@jcb91
Copy link
Copy Markdown
Member

jcb91 commented Jul 28, 2017

ok, I'm going to merge this as is, then address line 537 in #1027, since both approaches should work in parallel

@parthi2929
Copy link
Copy Markdown

Hi

Adding <a class='tocSkip'> kind of looks hacky and not many could be aware. Instead, some short hand like #* could be used?

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

Successfully merging this pull request may close these issues.

3 participants