jupyterlab-toc icon indicating copy to clipboard operation
jupyterlab-toc copied to clipboard

Headers not always being picked up correctly

Open mlucool opened this issue 5 years ago • 5 comments

Depending on the text before, sometimes a header is not picked up correctly. For example:

hello

# My H1

vs.

- hello

# My H1

image

*Edited because I misinterpreted what was happening

mlucool avatar Nov 12 '19 15:11 mlucool

@mlucool I am a bit confused by your screenshot. What are we looking at? Is the left side the ToC and the right side a notebook?

In general, a heading should always be the first line in a Markdown cell. For the ToC to correctly register a heading, this is the convention that should be adhered to.

kgryte avatar Jan 03 '20 19:01 kgryte

What are we looking at? Is the left side the ToC and the right side a notebook?

Yes

In general, a heading should always be the first line in a Markdown cell.

I agree with this. Maybe that should be enforced?

(As an FYI, the left has toggle code cells enabled)

mlucool avatar Jan 03 '20 19:01 mlucool

In general, a heading should always be the first line in a Markdown cell.

This is a tragically unfortunate requirement. When making slides, it's often helpful and necessary to have multiple headings on a slide; multiple headings in a cell.

All headings should be included in the Table of Contents regardless of whether they're the first heading in the cell.

Could that be the new default behavior, or would there need to be a configuration setting?

westurner avatar Jul 31 '20 01:07 westurner

@westurner Unfortunately, there is no simple implementation for making this possible. If there was an easy fix, I was not able to find it. Feel free to submit a PR if you are able to find a maintainable solution.

kgryte avatar Jul 31 '20 03:07 kgryte

Athen’s observations are consistent with those of the intern team that built the initial version of this. It also makes section collapsing almost impossible

Sent from my iPhone

On Jul 30, 2020, at 8:13 PM, Athan [email protected] wrote:

 @westurner Unfortunately, there is no simple implementation for making this possible. If there was an easy fix, I was not able to find it. Feel free to submit a PR if you are able to find a maintainable solution.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ellisonbg avatar Jul 31 '20 13:07 ellisonbg