Skip to content

Conversation

@oliverkwebb
Copy link

I hope to get the build infrastructure in a flexible enough state eventually so that the book can be compiled into different formats (mainly, PDF and single-page HMTL)

Changes Made:

  • Remove significant whitespace in generate.sh
  • Give generate.sh executable permissions
  • Re-run generate.sh, pushing a few previous changes to the generated html
  • sed command | sed command -> sed "command; command", unnecessary $ in shell math

P.S.
Right now, the filenames for the chapters are being stored in a simple text file, and the titles for the chapters are being extracted using sed, if that file was a YAML file, which stored the filenames and titles in a list, and the templating could use it to reference the previous/next chapters (with pandoc's $for$). It would remove the need for most of the shell code here (at the cost of the file being harder to parse)

@ulysses4ever
Copy link
Collaborator

thanks for the contribution! this will be largely superceeded by #103.

As for the sed business... Sadly, Pandoc alone will be rather unpleasant in handling prev/next links, because the easiest is to hardcode these relationships like this:

    ---
    items:
      - title: Item 1
        content: This is item 1.
        next_item:
          title: Item 2
          url: /item2.html
      - title: Item 2
        content: This is item 2.
        next_item:
          title: Item 3
          url: /item3.html
      - title: Item 3
        content: This is item 3.
        # No next_item for the last item
    ---

Of course, it's not too bad because we don't expect the links to change any time soon, and sed is extremely fragile and non-portable, so maybe it's not too bad of an idea. Of course, if we had something more pleasant to replace bash, like a Hakyll setup, that would be even better...

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @oliverkwebb! Could you please rebase on top of the current main branch? We don't store generated HTML anymore and the shell script has been cleaned up a bit (including removing $ in arithmetics) but some of your changes may still be relevant!

@ulysses4ever ulysses4ever added enhancement New content or edit request blocked labels Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked enhancement New content or edit request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants