jupyterlab / jupyterlab-toc

Table of Contents extension for JupyterLab
BSD 3-Clause "New" or "Revised" License
727 stars 107 forks source link

Headers not always being picked up correctly #105

Open mlucool opened 4 years ago

mlucool commented 4 years ago

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

kgryte commented 4 years ago

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

mlucool commented 4 years ago

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)

westurner commented 3 years ago

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?

kgryte commented 3 years ago

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

ellisonbg commented 3 years ago

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 notifications@github.com 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.