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

Redesign slidefactory #9

Open
wants to merge 152 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
62abf82
Add revealjs template from pandoc 2.19.2
trossi Mar 30, 2023
b493da5
Enable using custom theme url
trossi Mar 30, 2023
e8dd3cf
Add event to the title slide
trossi Mar 30, 2023
12fc995
Remove empty last slide from pdf print
trossi Mar 31, 2023
7e305f6
Fix background color definition
trossi Mar 31, 2023
0653604
Do not repeat background image
trossi Mar 31, 2023
3f238eb
Add backgrounds for title and section slides
trossi Mar 31, 2023
f105057
Add class to title slide
trossi Mar 31, 2023
b411891
Add pandoc yaml files for theme
trossi Mar 31, 2023
6a256cf
Add background image for Finnish
trossi Apr 3, 2023
dfe87cc
Remove symbolic link
trossi Apr 3, 2023
beb8d4b
Rename section background
trossi Apr 3, 2023
7ace21e
Remove unnecessary submodules
trossi Apr 3, 2023
423923c
Add shell script for conversion
trossi Apr 3, 2023
d514c19
Add container recipe based on alpine
trossi Apr 3, 2023
6a4ead3
Remove singularity container recipe
trossi Apr 3, 2023
ad92a9b
Add background image for author page
trossi Apr 3, 2023
a54a2ee
Include reveal.js and mathjax
trossi Apr 4, 2023
adeee1b
Include online fonts
trossi Apr 4, 2023
07a6a36
Remove duplicated font-weight
trossi Apr 4, 2023
b190b9b
Add LICENSE files
trossi Apr 5, 2023
3e8db9f
Download fonts manually
trossi Apr 6, 2023
91a5dd0
Remove version requirements
trossi Apr 6, 2023
3a3328e
Use single code for all font downloads
trossi Apr 6, 2023
1868230
Add css file for local fonts
trossi Apr 6, 2023
ebddd4b
Fix font in source code blocks
trossi Apr 6, 2023
ded0422
Include a base font
trossi Apr 6, 2023
5c89111
Remove obsolete background filters
trossi Apr 6, 2023
7bd4fa6
Add python3
trossi Apr 6, 2023
906ba85
Use markdown-native_divs format
trossi Apr 6, 2023
89864eb
Use code font for code.sourceCode
trossi Apr 6, 2023
f8c62de
Update basic conversion to the new format
trossi Apr 6, 2023
6862eb6
Use python conversion script
trossi Apr 6, 2023
fe08735
Add comments
trossi Apr 6, 2023
6ab0698
Simplify conversion script
trossi Apr 6, 2023
2d67cd9
Remove conversion shell script
trossi Apr 6, 2023
498da46
Remove setup scripts
trossi Apr 6, 2023
52c5682
Define urls globally for all themes
trossi Apr 11, 2023
473f3c0
Remove default theme symbolic link
trossi Apr 11, 2023
793a972
Enable custom theme path
trossi Apr 11, 2023
32737c3
Add --format option
trossi Apr 11, 2023
3b442de
Add local urls
trossi Apr 11, 2023
f890e6c
Use online urls also with custom slidefactory
trossi Apr 11, 2023
2da0a29
Use proper local urls
trossi Apr 11, 2023
e9414d5
Use common error command
trossi Apr 11, 2023
4afb192
Add options for local slidefactory
trossi Apr 11, 2023
2e17bf4
Add -n for --dry-run
trossi Apr 11, 2023
c68b6fd
Remove SLIDEFACTORY_THEME_ROOT
trossi Apr 11, 2023
58ec627
Add self-contained html format
trossi Apr 11, 2023
e00470a
Remove unnecessary url-encode filter
trossi Apr 11, 2023
c2517b4
Update year
trossi Apr 11, 2023
d7c97a2
Use script location as slidefactory root
trossi Apr 12, 2023
376ecdb
Add -v for --verbose
trossi Apr 12, 2023
446f494
Rename fonts.css
trossi Apr 12, 2023
86c04d7
Keep yaml files for urls in repository
trossi Apr 12, 2023
fab6363
Add slidefactory files in a single layer
trossi Apr 12, 2023
5dc4638
Update README
trossi Apr 12, 2023
e16c3b9
Rename formats
trossi Apr 12, 2023
a41b487
Print list of available themes
trossi Apr 12, 2023
ce64121
Remove unnecessary Noto Sans Mono
trossi Apr 12, 2023
d8cb2d0
Remove $SLIDEFACTORY_ROOT
trossi Apr 12, 2023
dded204
Define container image labels in Makefile
trossi Apr 12, 2023
5a8a3aa
Update version tag
trossi Apr 12, 2023
2bbe862
Create temporary file in the same directory
trossi Apr 12, 2023
bcaef44
Generalize shell commands
trossi Apr 12, 2023
03e875a
Add help how to install slidefactory
trossi Apr 12, 2023
c661fc5
Copy also singularity image during local install
trossi Apr 12, 2023
158a5d0
Sort commands according to their permanency
trossi Apr 12, 2023
d64ca30
Simplify alias
trossi Apr 12, 2023
80e7f51
Add info prints
trossi Apr 12, 2023
d5785d5
Add detailed installation instructions
trossi Apr 13, 2023
605b59c
Rename convert.py to slidefactory.py
trossi Apr 13, 2023
7048c59
Add a note on offline use
trossi Apr 13, 2023
1abf1b3
Add separate urls for standalone html
trossi Apr 13, 2023
fa0a32c
Add a list of known issues
trossi Apr 13, 2023
b046b7c
Print stderr on failure
trossi Apr 13, 2023
280a848
Add option to disable math
trossi Apr 13, 2023
e3d5ccd
Simplify makefile
trossi Mar 12, 2024
c4ca472
Simplify readme
trossi Mar 12, 2024
1a7cbfb
Fix file permissions
trossi Mar 7, 2024
5b330fd
Fix pdf generation
trossi Mar 7, 2024
8d061c3
Fix math in pdf output
trossi Mar 7, 2024
4b407a6
Rename theme
trossi Mar 7, 2024
8124e92
Remove png files
trossi Mar 7, 2024
b351a45
Use svg backgrounds
trossi Mar 7, 2024
6309683
Add white background
trossi Mar 7, 2024
6993c45
Use dark title page font color
trossi Mar 7, 2024
a4bcce4
Remove outdated themes
trossi Mar 7, 2024
0875236
Remove browser argument
trossi Mar 12, 2024
8fe5025
Simplify handling of verbose and dry_run
trossi Mar 8, 2024
3e5cc73
Rename --filter to --filters
trossi Mar 8, 2024
455fb0d
Remove duplicated create_html() call
trossi Mar 11, 2024
6e02d0c
Apply output prefix to filename
trossi Mar 11, 2024
6a7ad3a
Use different suffix for different html flavors
trossi Mar 11, 2024
2c39913
Remove separate url files
trossi Mar 12, 2024
c8e5a8e
Remove singularity-specific steps
trossi Mar 12, 2024
440383a
Rename standalone to embedded
trossi Mar 12, 2024
9af22cd
Update README
trossi Mar 12, 2024
bcc1912
Fix style
trossi Mar 12, 2024
03b5654
Group advanced options
trossi Mar 12, 2024
648d5ef
Fix instructions
trossi Mar 12, 2024
82fbc0e
Include version tag in url
trossi Mar 12, 2024
bdf3959
Include tar (needed for github pages)
trossi Mar 12, 2024
d52466f
Include version in slidefactory.py
trossi Mar 18, 2024
6f6b626
Add verbose_info function
trossi Mar 18, 2024
b154b9b
Simplify dry run
trossi Mar 18, 2024
4699176
Enable setting output directory
trossi Mar 18, 2024
7494771
Fix dry run
trossi Mar 18, 2024
523a91d
Simplify commands
trossi Mar 18, 2024
5edd277
Modify version string only if file edited
trossi Mar 18, 2024
730bf47
Fix checking images in external web sources
trossi Mar 25, 2024
53b5869
Rename quote function for consistency
trossi Mar 25, 2024
ad695bd
Add additional pandoc argument parsing
cscjlan Apr 4, 2024
301c3fa
Update dockefile to use heredoc style
cscjlan Apr 4, 2024
061f158
Print subprocess command stdout, forward unknown args to pandoc
cscjlan Apr 4, 2024
4f307db
Revert "Update dockefile to use heredoc style"
cscjlan Apr 5, 2024
51a59b6
Use google fonts v2 API
trossi Mar 26, 2024
6bfe222
Show output only in verbose mode
trossi Apr 15, 2024
69e5515
Simplify css
trossi Apr 15, 2024
297af40
Repeat background in overflow
trossi Apr 15, 2024
5df07dd
Align values
trossi Apr 15, 2024
743471e
Remove redundant pdf-page-specific styles
trossi Apr 15, 2024
35e2bc9
Update css version
trossi Apr 15, 2024
1e5a2e3
Change background color to blue
trossi Apr 15, 2024
a4cde2d
Add zip
trossi Apr 15, 2024
b696774
Update alpine patch version
trossi Apr 15, 2024
d824524
Download fonts from stable urls
trossi Apr 15, 2024
a95bc00
Update version
trossi Apr 15, 2024
c682bf0
Add git
trossi Apr 15, 2024
c1aae19
Fix list spacing in pdf
trossi Apr 15, 2024
5361256
Update version
trossi Apr 15, 2024
0961dca
Simplify docker command
trossi Apr 22, 2024
4faa4e5
Add initial split to sub-commands
trossi Apr 22, 2024
97ea55e
Simplify resource url handling
trossi Apr 22, 2024
147a2a6
Include py3-yaml
trossi Apr 22, 2024
a4fe563
Create slidefactory executable
trossi Apr 22, 2024
998e449
Reorganize parent argparsers
trossi Apr 22, 2024
c1c0bc2
Fix dry run
trossi Apr 22, 2024
25e2e36
Add pages sub-command
trossi Apr 22, 2024
db7ef57
Rename convert to slides sub-command
trossi Apr 22, 2024
ea91d2f
Update syntax
trossi Apr 22, 2024
ff13d02
Fix relative theme path
trossi Apr 22, 2024
7fa5801
Improve formatting of nested links
trossi Apr 22, 2024
83f2a50
Enumerate slides by filename prefix
trossi May 13, 2024
f8d169e
Fix background in vertical overflow
trossi May 17, 2024
68a7b16
Update version
trossi May 17, 2024
5826584
Fix accordion of nested modules
trossi Aug 22, 2024
eff0e84
Update CSC desing system version
trossi Aug 22, 2024
f04556e
Fix accordion, thanks to Ville Eriksson
trossi Aug 22, 2024
1872a00
Apply attribute to all accordions
trossi Aug 22, 2024
3f9441d
Fix file and directory permissions
trossi Aug 22, 2024
0aa5a0e
Fix instruction
trossi Aug 26, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sif
*.tar
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

87 changes: 87 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
FROM docker.io/alpine:3.17 AS slidefactory-files

ARG VERSION

ADD LICENSE /slidefactory/
ADD fonts/ /slidefactory/fonts/
ADD theme/ /slidefactory/theme/
ADD slidefactory.py /slidefactory/

# Remove possible temporary files
RUN find /slidefactory -name '*~' -delete
RUN find /slidefactory -name '.*' -delete

# Fix permissions
RUN chmod 755 /slidefactory && \
find /slidefactory -type d -exec chmod 755 {} \; && \
find /slidefactory -type f -exec chmod 644 {} \; && \
chmod 755 /slidefactory/slidefactory.py

# Add checksums
RUN cd /slidefactory && \
find . -type f -print0 | xargs -0 sha256sum > /tmp/sha256sums_$VERSION && \
mv /tmp/sha256sums_$VERSION /slidefactory/


FROM docker.io/alpine:3.17

RUN apk update && \
apk add --no-cache \
ca-certificates \
chromium \
git \
pandoc \
font-freefont \
python3 \
py3-pandocfilters \
py3-yaml \
tar \
zip \
&& \
rm -rf /var/cache/apk/*

# Reveal.js
RUN wget https://github.com/hakimel/reveal.js/archive/refs/tags/4.4.0.zip -O tmp.zip && \
unzip tmp.zip 'reveal.js-4.4.0/LICENSE' -d /slidefactory && \
unzip tmp.zip 'reveal.js-4.4.0/dist/*' -d /slidefactory && \
unzip tmp.zip 'reveal.js-4.4.0/plugin/*' -d /slidefactory && \
rm -f tmp.zip

# MathJax
RUN wget https://github.com/mathjax/MathJax/archive/refs/tags/3.2.2.zip -O tmp.zip && \
unzip tmp.zip 'MathJax-3.2.2/LICENSE' -d /slidefactory && \
unzip tmp.zip 'MathJax-3.2.2/es5/tex-chtml-full.js' -d /slidefactory && \
unzip tmp.zip 'MathJax-3.2.2/es5/input/tex/extensions/*' -d /slidefactory && \
unzip tmp.zip 'MathJax-3.2.2/es5/output/chtml/fonts/woff-v2/*' -d /slidefactory && \
unzip tmp.zip 'MathJax-3.2.2/es5/adaptors/*' -d /slidefactory && \
rm -f tmp.zip

# Fonts
RUN FONT_DIR=NotoSans && \
mkdir -p /slidefactory/fonts/$FONT_DIR && \
wget https://github.com/notofonts/latin-greek-cyrillic/releases/download/NotoSans-v2.013/NotoSans-v2.013.zip -O tmp.zip && \
unzip -j tmp.zip 'NotoSans/googlefonts/ttf/*' -d /slidefactory/fonts/$FONT_DIR && \
unzip -j tmp.zip 'OFL.txt' -d /slidefactory/fonts/$FONT_DIR && \
rm tmp.zip

RUN FONT_DIR=Inconsolata && \
mkdir -p /slidefactory/fonts/$FONT_DIR && \
wget https://github.com/googlefonts/Inconsolata/archive/refs/tags/v3.000.zip -O tmp.zip && \
unzip -j tmp.zip 'Inconsolata-3.000/fonts/ttf/Inconsolata-*' -x '*Condensed*' '*Expanded*' -d /slidefactory/fonts/$FONT_DIR && \
unzip -j tmp.zip 'Inconsolata-3.000/OFL.txt' -d /slidefactory/fonts/$FONT_DIR && \
rm tmp.zip

COPY --from=slidefactory-files /slidefactory/ /slidefactory/

# Create executable
RUN echo -e '#!/bin/sh\n\
exec python3 /slidefactory/slidefactory.py "$@"\n\
' > /usr/bin/slidefactory && \
chmod a+x /usr/bin/slidefactory

RUN mkdir /work

WORKDIR /work

ENTRYPOINT ["slidefactory"]
CMD ["-h"]
93 changes: 0 additions & 93 deletions INSTALL.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2022 CSC - IT Center for Science Ltd.
Copyright (c) 2017-2023 CSC - IT Center for Science Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
82 changes: 19 additions & 63 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,68 +1,24 @@
DEF=slidefactory.def
SIF=slidefactory.sif
IMAGE_ROOT?=ghcr.io/csc-training
IMAGE=slidefactory
IMAGE_VERSION?=$(shell grep -m1 -oP '(?<=VERSION = ").+(?=")' slidefactory.py)

ifndef PREFIX
PREFIX=$(HOME)
endif
INSTALL_BIN=$(PREFIX)/bin
INSTALL_GIT=$(PREFIX)/lib/slidefactory
GIT=https://github.com/csc-training/slide-template

.PHONY: build clean install uninstall
.PHONY: check clone git
build: Dockerfile slidefactory.py
docker build \
--label "org.opencontainers.image.source=https://github.com/csc-training/slidefactory" \
--label "org.opencontainers.image.description=slidefactory" \
--build-arg VERSION=${IMAGE_VERSION} \
-t ${IMAGE_ROOT}/${IMAGE}:${IMAGE_VERSION} \
.

build: $(SIF)
push:
docker push ${IMAGE_ROOT}/${IMAGE}:${IMAGE_VERSION}

clean:
rm $(SIF)

check:
@if [ -e $(INSTALL_GIT) ]; then \
echo "Already installed. Please run 'make uninstall' to remove old installation."; \
exit 1; \
fi

clone:
git clone --recursive . $(INSTALL_GIT)
cd $(INSTALL_GIT) && git remote set-url origin $(GIT) && git fetch origin

git:
@make -s check
@make -s clone
@echo ""
@echo "Installed:"
@echo " $(INSTALL_GIT)/"
@echo ""
@echo "Please add the following into your .bashrc or similar"
@echo " export SLIDEFACTORY=$(INSTALL_GIT)"
singularity:
rm -f $(IMAGE).sif $(IMAGE).tar
docker save $(IMAGE_ROOT)/$(IMAGE):$(IMAGE_VERSION) -o $(IMAGE).tar
singularity build $(IMAGE).sif docker-archive://$(IMAGE).tar
rm -f $(IMAGE).tar

install: build
@make -s check
@if [ ! -d $(INSTALL_BIN) ]; then \
mkdir -p $(INSTALL_BIN); \
fi
cp -i $(SIF) $(INSTALL_BIN)/
@make -s clone
@echo ""
@echo "Installed:"
@echo " $(INSTALL_BIN)/$(SIF)"
@echo " $(INSTALL_GIT)/"
@echo ""
@echo "Please add the following into your .bashrc or similar"
@echo " export SLIDEFACTORY=$(INSTALL_GIT)"

uninstall:
@echo "Removing:"
@if [ -e $(INSTALL_BIN)/$(SIF) ]; then \
echo " $(INSTALL_BIN)/$(SIF)"; \
fi
@echo " $(INSTALL_GIT)/"
@read -r -p "Proceed [Y/n]? " OK; \
[ "$$OK" = "y" ] || [ "$$OK" = "Y" ] || [ "$$OK" = "" ] || (exit 1;)
@if [ -e $(INSTALL_BIN)/$(SIF) ]; then \
rm -f $(INSTALL_BIN)/$(SIF); \
fi
rm -rf $(INSTALL_GIT)

%.sif: %.def
sudo singularity build $@ $<
clean:
rm -f $(IMAGE).sif $(IMAGE).tar
Loading