grimbough / msmbstyle

Tufte inspired bookdown template
https://www-huber.embl.de/users/msmith/msmbstyle/
59 stars 17 forks source link

Parts and TOC links #22

Closed ericpgreen closed 5 years ago

ericpgreen commented 5 years ago

I'm having trouble with links to parts in the TOC.

To reproduce, go here and choose Module 1 from the TOC. You should get a 404 page. It's trying to go to:

https://read.themethodsection.com/module-1-getting-started-with-global-health-research.html1-getting-started-with-global-health-research

The link in the TOC doubles up the file name.

If you back up and go to Chapter 1, scroll to the bottom, and click Next, you will get to the proper Module 1 page: https://read.themethodsection.com/module-1-getting-started-with-global-health-research.html

I tried using # (PART\*) my title and # (PART) my title as Yihui recommends, but "(PART)" is copied over into the TOC.

Here's my repo showing this approach. Unless I'm doing something wrong, I think there is an issue in creating the TOC link.

grimbough commented 5 years ago

I'll take a look. This is almost certainly a bug in my code. It takes the standard TOC that gets produced by the tufte template and then shifts it all around. I expect my pattern matching code is getting tripped up by something that isn't quite the same as the way my chapters are named.

grimbough commented 5 years ago

I think this should work now. It was getting thrown by titles that contained more than just characters. Now it should be able to cope with numbers as well.