Skip to content

Commit

Permalink
Add makefile to generate html / pdf from slides markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Schmidt committed Jul 14, 2019
1 parent 83ce4a3 commit d901790
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock.json
node_modules/*
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2019 Manuel Schmidt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Published at https://github.com/mschmnet/awk-slides/

MARP=./node_modules/.bin/marp

FILES:=$(patsubst %.md, %, $(wildcard *.md))
FILES:=$(filter-out README, $(FILES))

all: pdf html

pdf: $(patsubst %,pdf/%.pdf,$(FILES))

html: $(patsubst %,html/%.htm,$(FILES))

pdf/%.pdf: %.md
$(MAKE) $(MARP)
@echo "Generating pdf slides..."
$(MARP) $< --output $@

html/%.htm: %.md
$(MAKE) $(MARP)
@echo "Generating html slides..."
$(MARP) $< --output $@

$(MARP):
npm install --save-dev @marp-team/marp-cli

clean:
rm pdf/*.pdf
rm html/*.htm

help: list

list:
@echo "make [all]: Generates html and pdf slides"
@echo "make html: Generates html slides"
@echo "make pdf: Generates pdf slides"
@echo "make clean: Remove all generated files"


.PHONY: pdf html help list clean

30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# awk-slides
Slides for a short awk introduction
# How to generate pdf and html files

## Requirements

* `npm`
* `make` (if you don't have `make` just have a look at the Makefile to find out how you can generate the slides)

## PDF / HTML generation

### Generate both html and pdf

make [all]

### Generate pdf

make pdf

### Generate html

make html

### List targets

make help




15 changes: 14 additions & 1 deletion awk-slides.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Short AWK introduction
---
theme: uncover

---

# A short AWK introduction


https://github.com/mschmnet/awk-slides
© 2019 Manuel Schmidt

---

Another test

100 changes: 100 additions & 0 deletions html/awk-slides.htm

Large diffs are not rendered by default.

Binary file added pdf/awk-slides.pdf
Binary file not shown.

0 comments on commit d901790

Please sign in to comment.