This project builds upon the Superzpěvník project by simberaj by allowing to apply user custom configuration to the built songbook.
How to use this project?
- Clone this project with
git clone --recursive
or (if you have forgotten), rungit submodule update --init
in the root directory of the project. - Figure out the changes you'd like to make to the default songbook.
- Write a configuration file to represent the changes
- Run
python3 run.py <path-to-config-file>
The configuration file is a YAML file with the following syntax:
page_numbers: <bool>
songs:
- "[<author>:]<title>":
- "[<author>:]<title>":
[ capo: <int> ]
[ transpose: <int> ]
Example:
page_numbers: true
songs:
- "A té Réhradice":
- "Mám jizvu na rtu":
transpose: -2
- "Nohavica:*":
- "Co jste has":
- "Colorado":
capo: 2
The first line matching a song shall be applied - write your config files in "specific-to-generic" order.
Use *
as placeholders for "anything". More specialized regexes are not supported yet.
- Scan all source directories and build a list of (title, author, path) SongFiles.
- Build a source directory
- For each song in the configuration:
- Copy the song to the source directory
- If there are any transformations to be applied, apply them
- For each song in the configuration:
- Build the init file
- Take the init.tex
- Apply unconditional fixes
- Based on the configuration, apply additional fixes
- Write the modified file to the source directory
- Build the song-book using the original scripts, but using our modified init.tex and the songs from the source directory