Compare commits
2 Commits
af93017204
...
8b25dbdca2
Author | SHA1 | Date | |
---|---|---|---|
8b25dbdca2 | |||
d1ba57009d |
12
makefile
12
makefile
@ -1,9 +1,3 @@
|
|||||||
ifdef CHORDPRO_PIPELINE
|
|
||||||
CHORDPRO_CMD = chordpro
|
|
||||||
else
|
|
||||||
CHORDPRO_CMD = docker run -ti --rm --env HOME=$(HOME) --env USER=$(USER) --workdir $(shell pwd) --volume $(HOME):$(HOME) chordpro/chordpro:latest chordpro --config=chordpro.json
|
|
||||||
endif
|
|
||||||
|
|
||||||
SRC_DIR := $(wildcard content/*)
|
SRC_DIR := $(wildcard content/*)
|
||||||
SRC_EXTENSION := .cho
|
SRC_EXTENSION := .cho
|
||||||
|
|
||||||
@ -12,13 +6,15 @@ SONG_PDF := $(patsubst %$(SRC_EXTENSION),%.pdf,$(SONG_CHO))
|
|||||||
SONG_HTML := $(patsubst %$(SRC_EXTENSION),%.html,$(SONG_CHO))
|
SONG_HTML := $(patsubst %$(SRC_EXTENSION),%.html,$(SONG_CHO))
|
||||||
SONGBOOK := songbook.pdf
|
SONGBOOK := songbook.pdf
|
||||||
|
|
||||||
|
SHELL := $(shell echo $$SHELL)
|
||||||
|
|
||||||
.DEFAULT_GOAL := all
|
.DEFAULT_GOAL := all
|
||||||
|
|
||||||
%.pdf: %$(SRC_EXTENSION)
|
%.pdf: %$(SRC_EXTENSION)
|
||||||
$(CHORDPRO_CMD) -o $@ $<
|
$(SHELL) -c 'chordpro --config=chordpro.json -o $@ $<'
|
||||||
|
|
||||||
%.html: %$(SRC_EXTENSION)
|
%.html: %$(SRC_EXTENSION)
|
||||||
$(CHORDPRO_CMD) -o $@ $<
|
$(SHELL) -c 'chordpro --config=chordpro.json -o $@ $<'
|
||||||
|
|
||||||
all: $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)
|
all: $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)
|
||||||
|
|
||||||
|
18
readme.md
18
readme.md
@ -4,14 +4,26 @@
|
|||||||
- `ghostscript`
|
- `ghostscript`
|
||||||
- `zola` (optional)
|
- `zola` (optional)
|
||||||
|
|
||||||
The makefile uses Docker with the official iamge `chordpro/chordpro:latest`.
|
You can [install ChordPro][1] directly on your machine, or use Docker
|
||||||
It can be seamlesly integrated with a shell alias in case you want to use
|
with the official iamge `chordpro/chordpro:latest`. It can be seamlesly
|
||||||
chordpro directly in your shell outside of make:
|
integrated with a shell alias:
|
||||||
|
|
||||||
```
|
```
|
||||||
alias chordpro="docker run -ti --rm --env HOME=\$HOME --env USER=\$USER --workdir \$(pwd) --volume \$HOME:\$HOME chordpro/chordpro:latest chordpro"
|
alias chordpro="docker run -ti --rm --env HOME=\$HOME --env USER=\$USER --workdir \$(pwd) --volume \$HOME:\$HOME chordpro/chordpro:latest chordpro"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will not function with the included makefile, so you will have to
|
||||||
|
export this as a shell function (for example in `.bashrc`):
|
||||||
|
|
||||||
|
```
|
||||||
|
chordpro() {
|
||||||
|
docker run -ti --rm --env HOME=$HOME --env USER=$USER --workdir "$(pwd)" --volume "$HOME:$HOME" chordpro/chordpro:latest chordpro "$@"
|
||||||
|
}
|
||||||
|
export -f chordpro
|
||||||
|
```
|
||||||
|
|
||||||
|
[1]: https://www.chordpro.org/chordpro/chordpro-installation/
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
`make` defaults to `all` which builds individual PDF and HTML files for
|
`make` defaults to `all` which builds individual PDF and HTML files for
|
||||||
|
Loading…
Reference in New Issue
Block a user