Skip to content

Conversation

@dschick
Copy link

@dschick dschick commented Sep 8, 2015

Adds a random hash to the id and link of each heading in the toc
extension.

Adds a random hash to the id and link of each heading in the toc
extension.
@minrk
Copy link
Owner

minrk commented Sep 8, 2015

This shouldn't be done unconditionally. It should probably only add this suffix in the event of a collision, and even then, it should probably use a counter instead of a random hash that will be different on every page load.

@jankatins
Copy link
Contributor

See also here: jupyter/notebook#77

-> This breaks if one uses internal (head of the notebook to somewhere down) or external links (nbviewer) links to headlines.

@minrk
Copy link
Owner

minrk commented Sep 8, 2015

@JanSchulz exactly. Deduplicating with counters iff there is a colision will work better than UUIDs that may or may not be stable.

@jankatins
Copy link
Contributor

Counters aren't stable as well, when I add a new headline in between or before :-(

@dschick
Copy link
Author

dschick commented Sep 9, 2015

I havn't thought about the internal/external linking so far.
I guess that using an unique hash upon creation in the metadata of the cell is the only working option if one can handle copy/paste/split events accordingly.

Regarding the internal/external linking: if you think about LaTeX one needs some anchors/labels to do so and the actual TOC there is still build automatically from the structure/level of the headings.

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