-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TOC generator seems to get confused by anchors with the same name #39
Comments
I don't think I'm doing anything particular with the TOC generator. How are you actually calling the TOC Generator in vimwiki? What is your expected output?. looking at your html # On This Page
- [Decoding the Gurus](#decoding-the-gurus)
- [Links](#links) # THIS WORKS
- [What is it?](#what-is-it)
- [Hosts](#hosts)
- [Matt Browne](#matt-browne)
- [Links](#links-2) # THIS GOES TO WRONG "LINKS"
- [Chris Kavnaugh](#chris-kavnaugh)
- [Links](#links-3) # THIS GOES NOWHERE
- [What do they talk about?](#what-do-they-talk-about)
- [Highlights of Show](#highlights-of-show)
# Decoding the Gurus
# Links
[Podcast home page](https://decoding-the-gurus.captivate.fm)
[Reddit page](https://www.reddit.com/r/DecodingTheGurus/)
[Unofficial Discord Server](https://discord.gg/z3krx3CX)
# What is it?
* It's primarily a podcast
* Started in late 2020
# Hosts
* Hosts are two researcher working in academia as professors
## Matt Browne
* psychologist
* currently specializing in research about gambling addictions and public policy
### Links
* [Twitter](https://twitter.com/arthurcdent)
## Chris Kavnaugh
* cultural anthropologist
* researches ritualistic practices
### Links
* [Twitter](https://twitter.com/C_Kavanagh)
# What do they talk about?
* Analyze popular figures in media who have acquired large followings with their sweeping worldviews
* hosts refer to them as gurus
* Mostly cover controversial individuals who promulgate psuedoscience and misinformation
* Will occasionally cover individuals who have positive impac5
* Carl Sagan
* Also sometimes interview experts on specific topics
* Frequent targets
* Sam Harris
* Bret Weinstein
* Jordan Peterson
* Joe Rogan
* Eric Weinstein
* Help audience members identify fake experts and false arguments and generally improve their ability to think critically about information
### Highlights of Show
* interview with Sam Harris
* Came on the rebut Chris and Matt
...more soon If you create that page and do view source and look carefully at the ids created for your duplicate "links" headings, you'll note they are called <h1>
<a id="on-this-page" class="anchor" href="#on-this-page" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>On This Page</h1>
<ul>
<li><a href="#decoding-the-gurus">Decoding the Gurus</a></li>
<li>
<a href="#links">Links</a> # THIS WORKS</li>
<li><a href="#what-is-it">What is it?</a></li>
<li>
<a href="#hosts">Hosts</a>
<ul>
<li>
<a href="#matt-browne">Matt Browne</a>
<ul>
<li>
<a href="#links-2">Links</a> # THIS GOES TO WRONG "LINKS"</li>
</ul>
</li>
<li>
<a href="#chris-kavnaugh">Chris Kavnaugh</a>
<ul>
<li>
<a href="#links-3">Links</a> # THIS GOES NOWHERE</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#what-do-they-talk-about">What do they talk about?</a>
- <a href="#highlights-of-show">Highlights of Show</a>
</li>
</ul>
<h1>
<a id="decoding-the-gurus" class="anchor" href="#decoding-the-gurus" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Decoding the Gurus</h1>
<h1>
<a id="links" class="anchor" href="#links" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Links</h1>
<p><a href="https://decoding-the-gurus.captivate.fm">Podcast home page</a>
<a href="https://www.reddit.com/r/DecodingTheGurus/">Reddit page</a>
<a href="https://discord.gg/z3krx3CX">Unofficial Discord Server</a></p>
<h1>
<a id="what-is-it" class="anchor" href="#what-is-it" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>What is it?</h1>
<ul>
<li>It's primarily a podcast</li>
<li>Started in late 2020</li>
</ul>
<h1>
<a id="hosts" class="anchor" href="#hosts" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Hosts</h1>
<ul>
<li>Hosts are two researcher working in academia as professors</li>
</ul>
<h2>
<a id="matt-browne" class="anchor" href="#matt-browne" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Matt Browne</h2>
<ul>
<li>psychologist
<ul>
<li>currently specializing in research about gambling addictions and public policy</li>
</ul>
</li>
</ul>
<h3>
<a id="links-1" class="anchor" href="#links-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Links</h3>
<ul>
<li><a href="https://twitter.com/arthurcdent">Twitter</a></li>
</ul>
<h2>
<a id="chris-kavnaugh" class="anchor" href="#chris-kavnaugh" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Chris Kavnaugh</h2>
<ul>
<li>cultural anthropologist
<ul>
<li>researches ritualistic practices</li>
</ul>
</li>
</ul>
<h3>
<a id="links-2" class="anchor" href="#links-2" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Links</h3>
<ul>
<li><a href="https://twitter.com/C_Kavanagh">Twitter</a></li>
</ul>
<h1>
<a id="what-do-they-talk-about" class="anchor" href="#what-do-they-talk-about" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>What do they talk about?</h1>
<ul>
<li>Analyze popular figures in media who have acquired large followings with their sweeping worldviews
<ul>
<li>hosts refer to them as gurus</li>
<li>Mostly cover controversial individuals who promulgate psuedoscience and misinformation</li>
<li>Will occasionally cover individuals who have positive impac5
<ul>
<li>Carl Sagan</li>
</ul>
</li>
<li>Also sometimes interview experts on specific topics</li>
</ul>
</li>
<li>Frequent targets
<ul>
<li>Sam Harris</li>
<li>Bret Weinstein</li>
<li>Jordan Peterson</li>
<li>Joe Rogan</li>
<li>Eric Weinstein</li>
</ul>
</li>
<li>Help audience members identify fake experts and false arguments and generally improve their ability to think critically about information</li>
</ul>
<h3>
<a id="highlights-of-show" class="anchor" href="#highlights-of-show" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Highlights of Show</h3>
<ul>
<li>interview with Sam Harris
<ul>
<li>Came on the rebut Chris and Matt</li>
</ul>
</li>
</ul>
<p>...more soon</p> It seems github markdown is smart enough to realise that you have two identically named link sections, but, it renames them Also, you will find that you don't really notice it linking properly even if you do correct it, because your page is too short (so it can't actually scroll the header to the top of the page anyway) As far as I can tell there is no bug here, so I am closing this, I suggest you close the one on vimwiki/vimwiki#1205 too. Also, it's probably better practice to use uniquely named headings on your page, that would also make this entire issue moot. |
To be clear, rewrite your markdown file as this -> and I think you'll find it's working correctly # On This Page
- [Decoding the Gurus](#decoding-the-gurus)
- [Links](#links) # THIS WORKS
- [What is it?](#what-is-it)
- [Hosts](#hosts)
- [Matt Browne](#matt-browne)
- [Links](#links-1) # THIS GOES TO WRONG "LINKS"
- [Chris Kavnaugh](#chris-kavnaugh)
- [Links](#links-2) # THIS GOES NOWHERE
- [What do they talk about?](#what-do-they-talk-about)
- [Highlights of Show](#highlights-of-show)
# Decoding the Gurus
# Links
[Podcast home page](https://decoding-the-gurus.captivate.fm)
[Reddit page](https://www.reddit.com/r/DecodingTheGurus/)
[Unofficial Discord Server](https://discord.gg/z3krx3CX)
# What is it?
* It's primarily a podcast
* Started in late 2020
# Hosts
* Hosts are two researcher working in academia as professors
## Matt Browne
* psychologist
* currently specializing in research about gambling addictions and public policy
### Links
* [Twitter](https://twitter.com/arthurcdent)
## Chris Kavnaugh
* cultural anthropologist
* researches ritualistic practices
### Links
* [Twitter](https://twitter.com/C_Kavanagh)
# What do they talk about?
* Analyze popular figures in media who have acquired large followings with their sweeping worldviews
* hosts refer to them as gurus
* Mostly cover controversial individuals who promulgate psuedoscience and misinformation
* Will occasionally cover individuals who have positive impac5
* Carl Sagan
* Also sometimes interview experts on specific topics
* Frequent targets
* Sam Harris
* Bret Weinstein
* Jordan Peterson
* Joe Rogan
* Eric Weinstein
* Help audience members identify fake experts and false arguments and generally improve their ability to think critically about information
### Highlights of Show
* interview with Sam Harris
* Came on the rebut Chris and Matt
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon |
Yeah, I'm using Vimwiki TOC. Not sure which end the bug is on, the TOC generator or your module. |
Please copy the markdown in this comment #39 (comment) into your wiki and see if it works then. As far as I can tell, the issue is with how you wrote your markdown not with vimwiki or vimwiki_markdown. |
Your suggestion did not work.
|
Output page is here: https://climatechangechat.com/decoding-the-gurus.html |
Ah, possibly |
Same problem. TOC id does not match body: TOC HTML:
Corresponding HTML content:
|
And the links work perfectly fine in the markdown file in vim. |
? You're trying something different. I'm asking, if you take this markdown # On This Page
- [Decoding the Gurus](#decoding-the-gurus)
- [Links](#links) # THIS WORKS
- [What is it?](#what-is-it)
- [Hosts](#hosts)
- [Matt Browne](#matt-browne)
- [Links](#links-1) # THIS GOES TO WRONG "LINKS"
- [Chris Kavnaugh](#chris-kavnaugh)
- [Links](#links-2) # THIS GOES NOWHERE
- [What do they talk about?](#what-do-they-talk-about)
- [Highlights of Show](#highlights-of-show)
# Decoding the Gurus
# Links
[Podcast home page](https://decoding-the-gurus.captivate.fm)
[Reddit page](https://www.reddit.com/r/DecodingTheGurus/)
[Unofficial Discord Server](https://discord.gg/z3krx3CX)
# What is it?
* It's primarily a podcast
* Started in late 2020
# Hosts
* Hosts are two researcher working in academia as professors
## Matt Browne
* psychologist
* currently specializing in research about gambling addictions and public policy
### Links
* [Twitter](https://twitter.com/arthurcdent)
## Chris Kavnaugh
* cultural anthropologist
* researches ritualistic practices
### Links
* [Twitter](https://twitter.com/C_Kavanagh)
# What do they talk about?
* Analyze popular figures in media who have acquired large followings with their sweeping worldviews
* hosts refer to them as gurus
* Mostly cover controversial individuals who promulgate psuedoscience and misinformation
* Will occasionally cover individuals who have positive impac5
* Carl Sagan
* Also sometimes interview experts on specific topics
* Frequent targets
* Sam Harris
* Bret Weinstein
* Jordan Peterson
* Joe Rogan
* Eric Weinstein
* Help audience members identify fake experts and false arguments and generally improve their ability to think critically about information
### Highlights of Show
* interview with Sam Harris
* Came on the rebut Chris and Matt
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon
...more soon And then run Your example here: #39 (comment) cannot be correct, as, for example you have a |
Why the fuck would I do that? I want to be able to use the automatically generated TOC feature. Of course I can manually write links that work as a workaround. That's not the point. The original markdown does have a twitter link. It's there:
|
Hi Steve, I understand this is frustrating, but, please try to stay civil. I hadn't properly understood that you were using the It does seem like In the short term, I can't think of an easy fix here, other than your suggested "name the headings differently", which isn't ideal. |
The links are automatically generated by the TOC generator. So I'd have to go back and fix it every time I saved. So I'll just basically live with the broken feature. I will find a way to carry on through life, somehow. And generally, if someone points out a problem to me which they have documented well and completely, I don't throw it back in their face with a "you do it." I try it out and see if I can reproduce. So sorry for the frustration, but you didn't seem to want to believe me that something is broken. Not all users are clueless idiots. Most are, but you should give be willing to the benefit of the doubt. |
Yip fair enough. I had actually tried to reproduce your issue (copying and pasting your HTML). The crucial piece of info which was missing (and obvious in retrospect) was that you were using If you can look at the vimwiki code, you might be able to tweak their TOC function to output different IDs for duplicates? |
I think the next best thing to try is to see if it will convert using plain old wiki syntax (not use markdown) which is what vimwiki is advertised as working with. Looking at your code, I noticed a "TableOfContentsFilter" which indicates that the underlying ruby gems may be the culprit. I don't do Ruby, though. |
Yip, that just adds the I'll see if I can find some time in the next few evenings to experiment. |
I'm not sure if it's the offsets. If I recall correctly, if I put one of the links with the same name at a different level in the outline hierarchy, it works fine. My memory is fuzzy on that, though. |
I have published version 0.8.1 which should fix this issue. |
Nice! I'll give it a spin tomorrow. So out of curiosity, was the TOC filter gem just not compatible with how vimwiki numbered the links? |
a653d21 commit message has it all :) |
It works! Time to get to bed on a high note. Later. Thanks for this module. |
See vimwiki/vimwiki#1205
The text was updated successfully, but these errors were encountered: