mirror of
https://github.com/dunyakirkali/letterpress.git
synced 2025-07-03 23:15:23 +00:00
Add Makefile
This commit is contained in:
parent
cc113ef2aa
commit
3eac5aecc4
35
.github/workflows/generate.yaml
vendored
35
.github/workflows/generate.yaml
vendored
@ -0,0 +1,35 @@
|
|||||||
|
name: Generate
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pdf:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: uwebarthel/asciidoctor
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate PDF
|
||||||
|
run: make output/book.pdf
|
||||||
|
- name: Archive PDF
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: pdf
|
||||||
|
path: output/book.pdf
|
||||||
|
epub:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: uwebarthel/asciidoctor
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Generate EPUB
|
||||||
|
run: make output/book.epub
|
||||||
|
- name: Archive EPUB
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: epub
|
||||||
|
path: output/book.epub
|
||||||
|
|
37
Makefile
Normal file
37
Makefile
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
SOURCE_FOLDER := source
|
||||||
|
|
||||||
|
ASCIIDOC_FILES := $(wildcard $(SOURCE_FOLDER)/*.adoc)
|
||||||
|
|
||||||
|
FIGURES = $(shell find . -name '*.svg')
|
||||||
|
|
||||||
|
PDF_NAME := book.pdf
|
||||||
|
PDF_PATH := output/$(PDF_NAME)
|
||||||
|
|
||||||
|
EPUB_NAME := book.epub
|
||||||
|
EPUB_PATH := output/$(EPUB_NAME)
|
||||||
|
|
||||||
|
ASCIIDOC_FLAGS = \
|
||||||
|
--doctype book
|
||||||
|
|
||||||
|
all: $(PDF_PATH) $(EPUB_PATH)
|
||||||
|
|
||||||
|
$(PDF_PATH): $(ASCIIDOC_FILES) $(FIGURES) Makefile metadata.yaml | output
|
||||||
|
asciidoctor-pdf source/book.adoc $(ASCIIDOC_FLAGS) \
|
||||||
|
-o $@ \
|
||||||
|
-r asciidoctor-diagram \
|
||||||
|
-r asciidoctor-mathematical
|
||||||
|
|
||||||
|
$(EPUB_PATH): $(ASCIIDOC_FILES) $(FIGURES) Makefile metadata.yaml | output
|
||||||
|
asciidoctor-epub3 source/book.adoc $(ASCIIDOC_FLAGS) \
|
||||||
|
-o $@ \
|
||||||
|
-r asciidoctor-diagram \
|
||||||
|
-r asciidoctor-mathematical
|
||||||
|
|
||||||
|
count:
|
||||||
|
wc -w source/*
|
||||||
|
|
||||||
|
output:
|
||||||
|
mkdir output
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -vrf output
|
Loading…
Reference in New Issue
Block a user