Skip to content
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

Allowing Pandoc links between chapters #195

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pronoiac
Copy link
Collaborator

We use Pandoc to generate an epub from our Markdown chapters. Part of that workflow (Pandoc concatenating all the Markdown files) breaks links between chapters. This PR would let those work.

Useful links:

This PR would let those work, but doesn't add all the needed anchors and links.
To do:

  • pages - add anchors. need to revisit the epub to markdown conversion
  • sections - add anchors, and edit links
  • chapters - done, as of this PR

There are around 282 sections, 130 links to those sections, and 1k pages, which is a lot to wade through to review; that's a WIP for a later PR.

via https://stackoverflow.com/questions/48169995/pandoc-how-to-link-to-a-section-in-another-markdown-file

Part of how Pandoc handles the Markdown files is by concatenating all of them.
So the anchors need to be unique in the book.

to do:
* links to page, like "#p189".
  Links are already present.
  For anchors, we have to revise and redo the epub to markdown conversion.

* links to chapters, like, maybe "#chapter1"?
  There aren't anchors or links yet.

* links to sections.
  Rewrite links.
    currently: "#section1", in multiple chapters.
   "#sect6_4"? "#ch6_4"? "#chapter_6_4"?
  Add anchors; those for Github and Pandoc aren't compatible.
    pandoc: #a-set-of-searching-tools
    github: norvig#64-a-set-of-searching-tools
About to extend it, renaming it to better fit its purpose
Between chapters, without anchors, change the link to e.g. "#chapter15_top".
I'll add those anchors in another commit.
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.

1 participant