Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize rendering #33

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8b20da9
Put markdeck revealjs adjustments in a markdeck theme
jceb Sep 27, 2019
ccc8aee
Hide box-shadow around emojis
jceb Sep 27, 2019
87bb47a
Remove duplicate plantuml.jar integration
jceb Sep 27, 2019
87db390
Remove duplicate img.emoji theming
jceb Sep 27, 2019
058d804
Support creation of custom revealjs themes through files in assets/cs…
jceb Sep 27, 2019
1e4fffd
Add header and footer elements that can be styled by themes
jceb Sep 27, 2019
b7f04d3
Show display controls in speaker notes always
jceb Sep 27, 2019
b0aa50d
Include favicon from user's theme folder
jceb Sep 27, 2019
5d96146
Convert bash script to Makefile
jceb Sep 28, 2019
5f8c0c8
Replace make variables with shell variables
jceb Sep 29, 2019
ab23ab1
Combine multiple rsync calls into one
jceb Sep 29, 2019
17c6cf4
Reduce wait time of liveserver to 50 milliseconds
jceb Sep 29, 2019
863abb0
Move temporary files into .meta/
jceb Sep 29, 2019
af3bf1d
Move rendered folder to assets/rendered
jceb Sep 29, 2019
c8115f3
Don't sync explain.html
jceb Sep 29, 2019
e30d122
Fix reference point for wait-for-changes and add inotify target
jceb Sep 29, 2019
cd5bc43
Simplify loop
jceb Sep 29, 2019
00933ae
Rename wait-for-changes target and make it PHONY
jceb Sep 30, 2019
eaa633f
Rename default target from all to build
jceb Sep 30, 2019
6944eea
Add missing sass dependency
jceb Sep 30, 2019
9540c1d
Merge branch 'master' into optimize_rendering
arnehilmann Oct 1, 2019
099da2f
Fix typo
jceb Oct 3, 2019
c2cb6c1
Create reference point for wait changes before the build run
jceb Oct 3, 2019
2bdc92e
Add option fragmentsInURL
jceb Nov 7, 2019
aa52136
Support columns configuration from pandoc documentation
jceb Nov 7, 2019
fa63940
Delete duplicate empty line
jceb Nov 7, 2019
b04f456
Set MARKDECK_USER for pdf and standalone to ensure write access
Nov 26, 2019
b976b80
Improve error detection if pdf rendering fails
Nov 26, 2019
6665eba
Unify error messages to start with an uppercase letter and end with a…
Nov 26, 2019
ac80512
Delete debug information
Nov 26, 2019
8191989
Add more information about the reason for skipping PDF rendering
Nov 26, 2019
88526c5
Deactivate markdeckFooter by default
Nov 26, 2019
7335b38
Increase heading font sizes in default theme to make it them readable
Nov 26, 2019
b61b44c
Hide list style if requested
Nov 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Dockerfile.pandoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG pandoc_version
ARG version
ARG motto

# TODO try watchman to get inotify working. Currently watchman in alpine edge ..
RUN apk add \
make bash curl \
graphviz inotify-tools rsync \
Expand Down
14 changes: 10 additions & 4 deletions src/markdeck/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SHELL := /bin/bash

all: .info-all render sync config pandoc
build: .info-build render sync sass config pandoc
@echo "-------- /rerendering ---------"
@echo

.info-all:
.info-build:
@echo "-------- rerendering ---------"


Expand Down Expand Up @@ -34,7 +34,7 @@ sync: .info-sync .rsync .fc-list

.rsync: /target .rsync-sync /target/assets/css/slides.scss /target/assets/css/render-pdf.css

.rsync-sync: /markdeck/assets $(wildcard /source/assets) /markdeck/explain.html
.rsync-sync: /markdeck/assets $(wildcard /source/assets)
# FIXME the dynamically generated scss and css files are deleted by rsync.
# If there was a way to separate the files coming from rsync and the
# dynamically generated files this would be ideal
Expand Down Expand Up @@ -143,7 +143,13 @@ pandoc: .info-pandoc /target/index.html
/target/assets/markdeck/css/%.css /target/assets/css/%.css: $$(subst .css,.scss,$$@)
sassc $< $@

wait-for-changes: $(wildcard /source/slide*.md) /source/assets $(wildcard /source/include-before-body) $(wildcard /source/include-after-body)
# TODO currently inotify doesn't work on mounted volumes :-/
# inotifywait -e modify,create,delete,move,attrib -r $^
/markdeck/wait-for-changes


clean:
rm -rf /target/.??* /target/*

.PHONY: all .info-all render .info-render sync .info-sync .rsync .rsync-sync .fc-list sass .info-sass .sync-custom-themes clean config .info-config pandoc .info-pandoc
.PHONY: build .info-build render .info-render sync .info-sync .rsync .rsync-sync .fc-list sass .info-sass .sync-custom-themes clean config .info-config pandoc .info-pandoc wait-for-changes
12 changes: 2 additions & 10 deletions src/markdeck/loop
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,7 @@ export ASCIIART_LIBDIR=/markdeck/lib
while true; do
cd /target

make -f /markdeck/Makefile render

make -f /markdeck/Makefile sync

make -f /markdeck/Makefile sass

make -f /markdeck/Makefile config

make -f /markdeck/Makefile pandoc || show_errors
make -f /markdeck/Makefile build || show_errors

$ONCE && break

Expand All @@ -71,7 +63,7 @@ while true; do
sleep .5
print_usage

/markdeck/wait-for-changes
make -f /markdeck/Makefile wait-for-changes

echo -e "\n\n\n\n\n\n\n\n\n\n"
done
Expand Down
5 changes: 3 additions & 2 deletions src/markdeck/wait-for-changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e -E -u

SOURCES="/source/slide*.md $(find /source/assets -type d) /source/include-before-body /source/include-after-body"
TARGET=/target/index.html
TARGET="$(mktemp)"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not /target/index.html?
With index.html as target, you also detect changes that happened before wait-for-changes was called.


last_sources=$(echo $SOURCES)
no_change=true
Expand All @@ -19,6 +19,7 @@ while $no_change; do
no_change=false
fi
done
$no_change && sleep 2
$no_change && sleep 1
done
rm -f "${TARGET}"
exit 0