commit 9d7724af0b7b1863a35ab707adb55a342a02c367 Author: Glenn Y. Rolland Date: Fri Apr 20 17:27:59 2018 +0200 Initial import diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8cb63ab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +build +exercices +node_modules +projets +references diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d3bb7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +Gemfile.lock +.bundle +vendor/bundle +/node_modules +build +public +source/css/theme/.sass-cache +**/*~ +references/* +*.pdf +*.zip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..69e424c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "libs/jcalculator"] + path = libs/jcalculator + url = https://github.com/balajmarius/jcalculator +[submodule "ext/marp-assets"] + path = ext/marp-assets + url = git@bitbucket.org:glenux/marp-assets.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd82c71 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:jessie +MAINTAINER Glenn ROLLAND + +RUN mkdir -p /hop +ADD slides /hop/slides +ADD bin /hop/bin +ADD themes /home/themes +ADD Makefile /home/Makefile +RUN apt-get update && \ + apt-get install -y make +WORKDIR /hop +RUN make install +CMD make diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..aa6c834 --- /dev/null +++ b/Makefile @@ -0,0 +1,72 @@ +#!/usr/bin/make -f + +THEME=gyr +THEME_OPT=-t $(THEME) + +REVEALJS_THEMES=node_modules/reveal.js/css/theme +REVEALJS_DIR=node_modules/reveal.js + +BUILD_DIR=build + +SLIDES_DIR=slides +SLIDES_MD=$(wildcard $(SLIDES_DIR)/**/*.md) +SLIDES_PDF=$(patsubst $(SLIDES_DIR)/%,$(BUILD_DIR)/%,$(patsubst %.md,%.pdf,$(SLIDES_MD))) +SLIDES_HTML=$(patsubst $(SLIDES_DIR)/%,$(BUILD_DIR)/%,$(patsubst %.md,%.html,$(SLIDES_MD))) + +NAME=$(shell basename "$$(pwd)") + +REVEALMD=node_modules/.bin/reveal-md +all: live + +configure: configure-assets configure-reveal configure-style + +configure-assets: + $(MAKE) -C assets build + +configure-reveal: + npm install reveal-md # -v 0.0.19 + npm install node-sass + +configure-style: + cp -a themes/$(THEME).scss $(REVEALJS_THEMES)/source + cd $(REVEALJS_DIR) && ../.bin/node-sass \ + css/theme/source/$(THEME).scss \ + css/theme/$(THEME).css \ + +zip: + rm -f "../$(NAME)-latest.zip" + (git ls-files ; find assets) |grep -v '^ext' | zip -r "../$(NAME)-latest.zip" -@ + +live: + $(REVEALMD) --disable-auto-open --host 0.0.0.0 $(THEME_OPT) $(SLIDES_DIR) + +.PHONY: build-pdf build-html +build-pdf: $(SLIDES_PDF) + +build-html: $(SLIDES_HTML) + + +$(BUILD_DIR)/%.pdf: $(SLIDES_DIR)/%.md + mkdir -p "$$(dirname "$@")" + docker run --rm --net=host -v "`pwd`:/slides" astefanutti/decktape http://localhost:1948/$(<:slides/%=%) --pause 500 /slides/$@ + touch -a -r "$<" "$@" + +$(BUILD_DIR)/%.html: $(SLIDES_DIR)/%.md + mkdir -p "$$(dirname "$@")" + test -d "$$(dirname "$<")/images" \ + && rsync -a "$$(dirname "$<")/images/" "$$(dirname "$@")/images/" \ + || true + pandoc -f markdown+emoji -t html -o "$@" "$<" + touch -a -r "$<" "$@" + +clean: clean-pdf clean-html + +clean-pdf: + rm -f $(BUILD_DIR)/**/*.pdf + +clean-html: + rm -f $(BUILD_DIR)/**/*.html + +tasklist: + watch "find slides/ -type f -name '*.md' |egrep -v '(template-|\.DONE\.md)' |sort" + diff --git a/README.md b/README.md new file mode 100644 index 0000000..72a835f --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +README +====== + +Usage +----- + + +First install stasis via bundle + + bundle install --path vendor/bundle + +Then run stasis once or in devel mode + + bundle exec middleman + +And get the result into the public/ directory ! + diff --git a/assets/Makefile b/assets/Makefile new file mode 100644 index 0000000..4d4fd79 --- /dev/null +++ b/assets/Makefile @@ -0,0 +1,15 @@ + +SCSS=$(wildcard *.scss) +CSS=$(patsubst %.scss,%.css,$(SCSS)) + +all: build + +build: $(CSS) + +clean: + rm -f $(CSS) + +%.css: %.scss + sass $< > $@ + + diff --git a/assets/logo-gyr.png b/assets/logo-gyr.png new file mode 100644 index 0000000..35e002d Binary files /dev/null and b/assets/logo-gyr.png differ diff --git a/assets/style.css.map b/assets/style.css.map new file mode 100644 index 0000000..b39a81c --- /dev/null +++ b/assets/style.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAeI,qBAAO;EACH,KAAK,EAAE,OAAO;EACd,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,SAAS,EAAE,MAAM;EACjB,eAAe,EAAE,qBAAqB;EAItC,oCAAiB;IACb,UAAU,EAAE,IAAI;AAMxB,4BAAc;EACV,KAAK,EAAE,GAAG;AAGd,0BAAY;EACR,KAAK,EAAE,GAAG;EAEV,OAAO,EAAE,KAAK;;AAKlB,oCAAO;EACH,KAAK,EAzCI,OAAO;EA0ChB;;;;;;;;;;;;IAYE;AAGN;sBACQ;EACJ,KAAK,EA5DI,OAAO;AA+DpB,iBAAG;EACC,KAAK,EAAE,kBAA0B;EACjC,SAAS,EAAE,eAAe;EAC1B,MAAM,EAAE,GAAG;EACX,WAAW,EAAE,CAAC;EAEd,OAAO,EAAE,GAAG;EACZ,aAAa,EAAE,IAAI;EAEtB,yBAAU;IACT,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,aAAa,EAAE,IAAI;IAGnB,gBAAgB,EAAE,iBAAiB;IACnC,iBAAiB,EAAE,SAAS;IAC5B,eAAe,EAAE,UAAU;IAC3B,mBAAmB,EAAE,WAAW;AAIrC,sBAAS;EAEL,KAAK,EAzFI,OAAO;EA0FhB,SAAS,EAAE,eAAe;EAC1B,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;AAGd,oBAAM;EACF;;;;;;;;;;IAUE", +"sources": ["style.scss"], +"names": [], +"file": "style.css" +} \ No newline at end of file diff --git a/assets/style.scss b/assets/style.scss new file mode 100644 index 0000000..3bfd6d2 --- /dev/null +++ b/assets/style.scss @@ -0,0 +1,115 @@ + +// define colors +$primaryColor: #ff6600; +$secondaryColor: #2d0e4a; + + +.slide_wrapper { + .slide:first-child { + // background-color: $secondaryColor; + } + + .slide:nth-child(2) { + // background-color: $primaryColor; + } + + .slide { + color: #111111; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start !important; + + // align-items: flex-start !important; + + & > .slide_inner { + margin-top: 70px; + // outline: 5px solid red; + // height: 400px; + } + } + + .slide_footer { + color: red; + } + + .slide_page { + color: red ; //!important; + // outline: 1px solid red; + display: block; + } +} + +.markdown-body { + h2, h3 { + color: $secondaryColor; + /* + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: center !important; + align-items: flex-start !important; + + height: 100px; + color: white; + background-color: $secondaryColor; + padding: 29px; + margin-bottom: 70px; + */ + } + + h2 ~ h3, + h2 ~ h4 { + color: $primaryColor; + } + + h1 { + color: $secondaryColor !important; + font-size: 300% !important; + margin: 0px; + line-height: 1; + // outline: 1px solid red; + padding: 0px; + margin-bottom: 30px; + + &::before { + content: ""; + display: block; + height: 300px; + width: 300px; + margin-bottom: 30px; + // padding-left: 100%; + // overflow: hidden; + background-image: url(logo-gyr.png); + background-repeat: no-repeat; + background-size: 300px auto; + background-position: center left; + } + } + + h1 ~ h3 { + // outline: 1px solid red; + color: $primaryColor; + font-size: 200% !important; + line-height: 1; + margin: 0; + padding: 0; + } + + h2 tt { + /* + color: white; + background-color: orange; + font-style: italic; + font-size: 60%; + padding: 0.125em 0.25em; + vertical-align: middle; + float: right; + top: 0.25em; + font-family: inherit; + */ + } + +} + + diff --git a/bin/build-structure b/bin/build-structure new file mode 100755 index 0000000..245e008 --- /dev/null +++ b/bin/build-structure @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby + +require 'csv' +require 'fileutils' + +CSV.foreach("structure.csv") do |row| + path = 'slides/' + row[0] + chapter_idx = row[1] + chapter = row[2] + title_idx = row[3] + title = row[4] + type = row[5] + + next if File.exist? path + FileUtils.mkdir_p File.dirname(path) + File.open(path, 'w') do |fh| + fh.puts "" + fh.puts "# #{chapter}" + fh.puts "" + fh.puts "### #{title}" + fh.puts "" + fh.puts "" + fh.puts "" + fh.puts "----" + fh.puts "" + end +end + diff --git a/bin/extract-toc b/bin/extract-toc new file mode 100755 index 0000000..f8551e6 --- /dev/null +++ b/bin/extract-toc @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +require 'sanitize' + +h1 = "" +h2 = "" + +Dir['slides/**/*.md'].sort.each do |name| + content = File.read(name) + oldh1 = h1 + oldh2 = h2 + if content =~ /^# (.*)\n/ + h1 = $1 + end + if content =~ /^### (.*)\n/ + h2 = $1 + end + + if oldh1 != h1 + puts "" + puts "#{Sanitize.clean(h1)}" + end + if oldh2 != h2 + puts "- #{Sanitize.clean(h2)}" + end +end diff --git a/bin/static-server b/bin/static-server new file mode 100755 index 0000000..c92934e --- /dev/null +++ b/bin/static-server @@ -0,0 +1,2 @@ +#!/bin/sh +python -m SimpleHTTPServer 8000 diff --git a/slides/.directory b/slides/.directory new file mode 100644 index 0000000..659fe59 --- /dev/null +++ b/slides/.directory @@ -0,0 +1,5 @@ +[Dolphin] +PreviewsShown=true +Timestamp=2018,1,5,23,8,35 +Version=4 +ViewMode=1 diff --git a/themes/gyr.scss b/themes/gyr.scss new file mode 100644 index 0000000..762ee26 --- /dev/null +++ b/themes/gyr.scss @@ -0,0 +1,52 @@ +/** + * A simple theme for reveal.js presentations, similar + * to the default theme. The accent color is darkblue. + * + * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. + * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ + + +// Default mixins and settings ----------------- +@import "../template/mixins"; +@import "../template/settings"; +// --------------------------------------------- + + + +// Include theme-specific fonts +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); + + +// Override theme settings (see ../template/settings.scss) +$mainFont: 'Open Sans', sans-serif; +$mainColor: #000; +$headingFont: 'Arial', 'Helvetica', Impact, sans-serif; +$headingColor: #000; // 673A8C; // #000 +$headingTextShadow: none; +$headingTextTransform: none; +$backgroundColor: #fff; +$linkColor: #00008B; +$linkColorHover: lighten( $linkColor, 20% ); +$selectionBackgroundColor: rgba(0, 0, 0, 0.99); + + +// Theme template ------------------------------ +// @import "../template/theme"; +@import "../white"; +// --------------------------------------------- + +.reveal { + font-size: 20px; +} + +// overwrite +.reveal .slides { + text-align: left; +} + +.reveal pre { + width: 100%; + margin: 20px 0; +} +