Skip to content

Commit

Permalink
Add build gmi
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill authored and trufae committed Jun 28, 2024
1 parent d3bd76e commit b4b6c0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ jobs:
run: |
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install pandoc texlive-xetex texinfo
go install github.com/n0x1m/md2gmi@latest
- name: Build ebooks
run: make pdf epub info
- name: Pub
run: make pdf epub info gmi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: r2book
path: |
r2book.pdf
r2book.epub
r2book.info.gz
r2book-gmi.tar.gz
# Release creation
check_release:
Expand Down Expand Up @@ -77,3 +79,4 @@ jobs:
r2book.pdf
r2book.epub
r2book.info.gz
r2book-gmi.tar.gz
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ _book/*
*.rej
*.bak
*.log
gmi/
r2book.pdf
r2book.epub
r2book.texi
r2book.info*
r2book-gmi.tar.gz
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ info: texi
makeinfo --force --no-split r2book.texi
gzip -9n r2book.info

MD2GMI=md2gmi/md2gmi
GOPATH?=$(HOME)/go
GOBIN?=$(GOPATH)/bin
MD2GMI?=$(GOBIN)/md2gmi

md2gmi:
git clone https://github.com/n0x1m/md2gmi

$(MD2GMI): md2gmi
cd md2gmi && go build .

gmi: $(MD2GMI)
gmi:
@test -x $(MD2GMI) || (echo "ERROR: Missing md2gmi.\nTo install run: go install github.com/n0x1m/md2gmi@latest"; false)
rm -rf gmi
mkdir -p gmi
for a in $(shell find src -type d) ; do b=`echo $$a |sed -e 's,src/,gmi/,'`; mkdir -p $$b ; done
for a in $(shell find src | grep md$$) ; do b=`echo $$a |sed -e 's,src/,gmi/,' -e 's,md$$,gmi,'` ; $(MD2GMI) -o $$b < $$a; done
cp -f gmi/intro.gmi gmi/index.gmi
for a in $(shell find src -type f -name \*.md) ; do b=`echo $$a |sed -e 's,src/,gmi/,' -e 's,md$$,gmi,'` ; $(MD2GMI) -i $$a -o $$b; done
ln -v gmi/SUMMARY.gmi gmi/index.gmi
tar -czf r2book-gmi.tar.gz -C gmi .

0 comments on commit b4b6c0f

Please sign in to comment.