Merge branch 'master' of github.com:glenux/teaching-boilerplate

This commit is contained in:
Glenn Y. Rolland 2021-11-23 23:47:12 +01:00
commit 5b2db39475
9 changed files with 100 additions and 6 deletions

3
.gitmodules vendored
View file

@ -4,3 +4,6 @@
[submodule "ext/marp-assets"] [submodule "ext/marp-assets"]
path = ext/marp-assets path = ext/marp-assets
url = git@bitbucket.org:glenux/marp-assets.git url = git@bitbucket.org:glenux/marp-assets.git
[submodule ".makefiles"]
path = .makefiles
url = https://github.com/glenux/makefiles-forever

1
.makefiles Submodule

@ -0,0 +1 @@
Subproject commit d5627404e17e12ff6349007efc25fa01db4c9c54

View file

@ -9,19 +9,31 @@ SLIDES_DIR=slides
DOCS_DIR=docs DOCS_DIR=docs
IMAGES_DIR=images IMAGES_DIR=images
BUILD_DIR=_build BUILD_DIR=_build
CACHE_DIR=_cache
## Internal directories
CACHE_SLIDES_DIR=$(CACHE_DIR)/slides
## Output directories ## Output directories
BUILD_SLIDES_DIR=$(BUILD_DIR)/slides BUILD_SLIDES_DIR=$(BUILD_DIR)/slides
BUILD_DOCS_DIR=$(BUILD_DIR)/docs BUILD_DOCS_DIR=$(BUILD_DIR)/docs
BUILD_IMAGES_DIR=images BUILD_IMAGES_DIR=images
## Ports ## Ports
DOCS_PORT=5100 DOCS_PORT=5100
SLIDES_PORT=5200 SLIDES_PORT=5200
## Find .md slides ## Find .md slides
SLIDES_MD=$(shell find $(SLIDES_DIR) \( -name '*.md' ! -name '_*' \)) SLIDES_MDPP=$(shell find $(SLIDES_DIR) \( -name '*.mdpp' ! -name '_*' \))
SLIDES_PDF=$(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MD)) SLIDES_MDPP_MD=$(patsubst $(SLIDES_DIR)/%.mdpp,$(CACHE_SLIDES_DIR)/%.mdpp.md,$(SLIDES_MDPP))
SLIDES_MDPP_MD_PDF=$(patsubst $(CACHE_SLIDES_DIR)/%.mdpp.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MDPP_MD))
SLIDES_MD=$(shell find $(SLIDES_DIR) \( -name '*.md' ! -name '_*' \)) $(SLIDES_MDPP_MD)
SLIDES_MD_PDF=$(patsubst $(SLIDES_DIR)/%.md,$(BUILD_SLIDES_DIR)/%.pdf,$(SLIDES_MD))
SLIDES_MD_ALL=$(SLIDES_MDPP_MD) $(SLIDES_MD)
SLIDES_PDF_ALL=$(SLIDES_MDPP_MD_PDF) $(SLIDES_MD_PDF)
## Find .uml graphs ## Find .uml graphs
DOCS_IMAGES_UML=$(shell find $(IMAGES_DIR) \( -name '*.uml' ! -name '_*' \)) DOCS_IMAGES_UML=$(shell find $(IMAGES_DIR) \( -name '*.uml' ! -name '_*' \))
@ -85,6 +97,11 @@ images: $(DOCS_IMAGES_SVG) $(DOCS_IMAGES_PNG) ## build images
%.circo.svg: %.circo %.circo.svg: %.circo
circo -Tsvg $< > $@ circo -Tsvg $< > $@
$(CACHE_SLIDES_DIR)/%.mdpp.md: $(SLIDES_DIR)/%.mdpp
mkdir -p "$$(dirname "$@")"
m4 -d -I$(SLIDES_DIR) -I$(CACHE_SLIDES_DIR) $< > $@ \
|| ( rm -f $@ && exit 1 )
.marp/theme.css: .marp/theme.css:
cd .marp && $(MAKE) theme.css cd .marp && $(MAKE) theme.css
@ -126,9 +143,7 @@ serve-docs: watch-docs
tocupdate: tocupdate:
pipenv run ./scripts/update-toc $(DOCS_DIR) ; \ pipenv run ./scripts/update-toc $(DOCS_DIR) ; \
$(BUILD_SLIDES_DIR)/%.pdf: $(CACHE_SLIDES_DIR)/%.mdpp.md | $(BUILD_SLIDES_DIR)
$(BUILD_SLIDES_DIR)/%.pdf: $(SLIDES_DIR)/%.md
mkdir -p $(BUILD_SLIDES_DIR)
npx marp --allow-local-files \ npx marp --allow-local-files \
--engine $$(pwd)/.marp/engine.js \ --engine $$(pwd)/.marp/engine.js \
--html \ --html \
@ -136,6 +151,16 @@ $(BUILD_SLIDES_DIR)/%.pdf: $(SLIDES_DIR)/%.md
$< \ $< \
-o $@ -o $@
$(BUILD_SLIDES_DIR)/%.pdf: $(SLIDES_DIR)/%.md | $(BUILD_SLIDES_DIR)
npx marp --allow-local-files \
--engine $$(pwd)/.marp/engine.js \
--html \
--theme $$(pwd)/.marp/theme.css \
$< \
-o $@
$(BUILD_SLIDES_DIR):
mkdir -p $(BUILD_SLIDES_DIR)
## ##
## Build final documents ## Build final documents
@ -146,7 +171,9 @@ $(BUILD_SLIDES_DIR)/%.pdf: $(SLIDES_DIR)/%.md
build: build-docs build-slides ## build all documents build: build-docs build-slides ## build all documents
build-slides: $(SLIDES_PDF) $(SLIDES_MD) ## build PDF slides only build-slides: $(SLIDES_PDF_ALL) $(SLIDES_MD_ALL) ## build PDF slides only
merge-slides: $(SLIDES_MDPP_MD) $(SLIDES_MD_ALL)
build-docs: ## build static docs site only build-docs: ## build static docs site only
$(MAKE) tocupdate $(MAKE) tocupdate

View file

@ -4,6 +4,11 @@
Make sure you have python and node installed Make sure you have python and node installed
git remote rename origin boilerplate
git remote add origin git@...
git checkout -b upstream/boilerplate/master --track
Install python packages Install python packages
pip install -U pipenv pip install -U pipenv
@ -16,6 +21,13 @@ Install node packages
## Usage ## Usage
### First steps
Clean this repository
Change the remote
### Watch mode ### Watch mode
This mode allows you the result on-the-fly as you makea changes in the content. This mode allows you the result on-the-fly as you makea changes in the content.

View file

@ -0,0 +1,8 @@
digraph G {
A -> B;
B -> C;
B -> D;
C -> E;
C -> F;
C -> G;
}

8
images/sample-graph.dot Normal file
View file

@ -0,0 +1,8 @@
digraph G {
A -> B;
B -> C;
B -> D;
C -> E;
C -> F;
C -> G;
}

View file

35
slides/index.mdpp Normal file
View file

@ -0,0 +1,35 @@
<!--
theme: default
vim: set ft=m4.markdown:
paginate: true
footer: Teaching Boilerplate © 2021
-->
<!--
_class: chapter
-->
![bg w:512 left:50%](images/logo.png)
# Teaching boilerplate
----
changequote(`{{',`}}')dnl
include({{slides/010-demo/_010-about.md}})dnl
----
include({{slides/010-demo/_020-about.md}})dnl
----
<!--
_class: chapter
-->
![bg right](images/background.png)
## Questions ?