Initial import

This commit is contained in:
Glenn Y. Rolland 2018-04-20 17:27:59 +02:00
commit 9d7724af0b
15 changed files with 374 additions and 0 deletions

5
.dockerignore Normal file
View file

@ -0,0 +1,5 @@
build
exercices
node_modules
projets
references

11
.gitignore vendored Normal file
View file

@ -0,0 +1,11 @@
Gemfile.lock
.bundle
vendor/bundle
/node_modules
build
public
source/css/theme/.sass-cache
**/*~
references/*
*.pdf
*.zip

6
.gitmodules vendored Normal file
View file

@ -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

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM debian:jessie
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
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

72
Makefile Normal file
View file

@ -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"

17
README.md Normal file
View file

@ -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 !

15
assets/Makefile Normal file
View file

@ -0,0 +1,15 @@
SCSS=$(wildcard *.scss)
CSS=$(patsubst %.scss,%.css,$(SCSS))
all: build
build: $(CSS)
clean:
rm -f $(CSS)
%.css: %.scss
sass $< > $@

BIN
assets/logo-gyr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

7
assets/style.css.map Normal file
View file

@ -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"
}

115
assets/style.scss Normal file
View file

@ -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;
*/
}
}

28
bin/build-structure Executable file
View file

@ -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 "<!-- #{"%0.2d" % chapter_idx}/#{"%0.2d" % title_idx} #{type} -->"
fh.puts ""
fh.puts "----"
fh.puts ""
end
end

26
bin/extract-toc Executable file
View file

@ -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

2
bin/static-server Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
python -m SimpleHTTPServer 8000

5
slides/.directory Normal file
View file

@ -0,0 +1,5 @@
[Dolphin]
PreviewsShown=true
Timestamp=2018,1,5,23,8,35
Version=4
ViewMode=1

52
themes/gyr.scss Normal file
View file

@ -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;
}