vojtechkral / bard

Markdown-based songbook compiler.
https://bard.md/
Apache License 2.0
48 stars 3 forks source link

Add anchors in TOC and Footer of each page? #21

Closed cadethacker closed 9 months ago

cadethacker commented 9 months ago

Hello! This project is incredible. I was investigating using LaTex directly for creating a song book for a group with a few dozen songs. (50+) Somebody sent me a link to your project. Almost exactly what I was looking.

I am a veteran programmer but in Java and Golang. Never used Rust or LaTex, but I'm a quick study. Just need a nudge in the right direction.

~Do you think it would be possible to have the table of contents contain links to each song? And then have a link in the footer of each page to be "link to the top" and have it jump back to the ToC?~

UPDTATE: It took me some testing, but now have a much better idea of what you did with the TOML and the hbs. I see the the ToC already links to each song. My hat is off to you. This project is really nice.

I propose ~two~ three additional options in the ouput section of the TOML, and if you are interested I can craft up a PR.

  1. Insert a "Jump to the Top" in the footer of every page.
  2. Insert a \newpage at the end of each song. This way , each song gets its one page(s).
  3. Toggle between A4 / A5 / LetterStandard if on the PDF.

I'm happy to craft up a PR, ~but will need a little help in which files I should dig into.~ I see that I would need to trace them through from the output.rs -> pdf.hbs (not sure about what to do with html one), and of course the documentation to show the new option.

vojtechkral commented 9 months ago

Hi. Thanks for the praise, glad this is useful :)

I propose three additional options in the ouput section of the TOML, and if you are interested I can craft up a PR.

Of these three, I think the newpage-per-song option could be done pretty easily. The "Jump to the Top" link seems to be a bit use-case-specific (the PDF is mainly meant for print). The paper option would be nice, but unfortunately it doesn't work - if you change the paper, other stuff like margins and some sizes need to be adapted, so it's not a matter of a simple option unfortunately...

Hopefully that makes sense

cadethacker commented 9 months ago

Sounds great. I'm great closing this out for now and then when I get a chance to dig into these, I'll submit the fork back.

  1. Sounds good. For reference... I run a group of about 100 musicians. (Bluegrass) On any given week, there are about 50 of us split into 4 groups. I would say that printing is less important than it use to be. Most of them come with their iPads/Tablets in hand and they want a PDF they can quickly navigate. But totally get what you are saying, but more and more people want a PDF to view not a PDF to print (a few do, but not many). If you change your mind, let me know and I'll submit a feature of this option.
  2. I'll focus on "new page per song"
  3. Agreed on the page size changes. there are dragons in those caves :D
vojtechkral commented 9 months ago

In case it's not apparent, you can alwas have your own template featuring the "Jump to the Top" link. Though I understand it's a bit of a hassle to maintain own template...