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

switching over to makefile #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Super-Linter

# Run this workflow every time a new commit pushed to your repository
on: push

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
super-lint:
# Name the Job
name: Lint code base
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

# Runs the Super-Linter action
- name: Run Super-Linter
uses: github/super-linter@v3
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
site/*.html
site/*.pdf
site/clojure
site/extra
site/meta
site/js/compiled
.cpcache
*.log
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ gem 'concurrent-ruby'
gem 'asciidoctor'
gem 'asciidoctor-revealjs'
gem 'asciidoctor-pdf'
gem 'asciidoctor-mathematical'
81 changes: 48 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,65 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.3)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
Ascii85 (1.1.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
asciidoctor (1.5.8)
asciidoctor-pdf (1.5.0.alpha.16)
asciidoctor (>= 1.5.0)
prawn (>= 1.3.0, < 2.3.0)
prawn-icon (= 1.3.0)
prawn-svg (>= 0.21.0, < 0.28.0)
prawn-table (= 0.2.2)
prawn-templates (>= 0.0.3, <= 0.1.1)
safe_yaml (~> 1.0.4)
thread_safe (~> 0.3.6)
treetop (= 1.5.3)
asciidoctor-revealjs (1.1.3)
asciidoctor (~> 1.5.6)
asciidoctor (2.0.17)
asciidoctor-mathematical (0.3.5)
asciidoctor (~> 2.0)
asciimath (~> 2.0)
mathematical (~> 1.6.0)
asciidoctor-pdf (2.3.0)
asciidoctor (~> 2.0)
concurrent-ruby (~> 1.1)
matrix (~> 0.4)
prawn (~> 2.4.0)
prawn-icon (~> 3.0.0)
prawn-svg (~> 0.32.0)
prawn-table (~> 0.2.0)
prawn-templates (~> 0.1.0)
treetop (~> 1.6.0)
asciidoctor-revealjs (4.1.0)
asciidoctor (>= 2.0.0, < 3.0.0)
concurrent-ruby (~> 1.0)
thread_safe (~> 0.3.5)
concurrent-ruby (1.0.5)
css_parser (1.6.0)
asciimath (2.0.4)
concurrent-ruby (1.1.10)
css_parser (1.11.0)
addressable
hashery (2.1.2)
pdf-core (0.7.0)
pdf-reader (2.1.0)
Ascii85 (~> 1.0.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
mathematical (1.6.14)
ruby-enum (~> 0.4)
matrix (0.4.2)
pdf-core (0.9.0)
pdf-reader (2.10.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
polyglot (0.3.5)
prawn (2.2.2)
pdf-core (~> 0.7.0)
ttfunk (~> 1.5)
prawn-icon (1.3.0)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
prawn-icon (3.0.0)
prawn (>= 1.1.0, < 3.0.0)
prawn-svg (0.27.1)
css_parser (~> 1.3)
prawn-svg (0.32.0)
css_parser (~> 1.6)
prawn (>= 0.11.1, < 3)
rexml (~> 3.2)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
prawn-templates (0.1.1)
prawn-templates (0.1.2)
pdf-reader (~> 2.0)
prawn (~> 2.2)
public_suffix (3.0.3)
public_suffix (5.0.0)
rexml (3.2.5)
ruby-enum (0.9.0)
i18n
ruby-rc4 (0.1.5)
safe_yaml (1.0.4)
thread_safe (0.3.6)
treetop (1.5.3)
treetop (1.6.11)
polyglot (~> 0.3)
ttfunk (1.5.1)
ttfunk (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
asciidoctor
asciidoctor-mathematical
asciidoctor-pdf
asciidoctor-revealjs
concurrent-ruby

BUNDLED WITH
1.16.1
2.2.3
56 changes: 41 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
SOURCES := $(wildcard docs/*.adoc)
HTML := $(patsubst docs/%.adoc, site/%.html, $(SOURCES))
PDF := $(patsubst docs/%.adoc, site/%.pdf, $(SOURCES))
CLOJURE_COURSE_SOURCES := $(wildcard docs/clojure/*.adoc)
CLOJURE_COURSE := $(patsubst docs/clojure/%.adoc, site/clojure/%.html, $(CLOJURE_COURSE_SOURCES))
COURSE_SOURCES := $(wildcard docs/*/*.adoc)
ALL_SOURCES := $(SOURCES) $(COURSE_SOURCES)
HTML := $(patsubst docs/%.adoc, site/%.html, $(ALL_SOURCES))
PDF := $(patsubst docs/%.adoc, site/%.pdf, $(ALL_SOURCES))
ARTICLES := $(patsubst docs/%.adoc, site/%.html, $(COURSE_SOURCES))
SLIDES := $(patsubst docs/%.adoc, site/%.slides.html, $(COURSE_SOURCES))
ALL := $(HTML) $(PDF) $(ARTICLES) $(SLIDES)

.PHONY: all clean setup
# Tasks

all: setup $(HTML) $(PDF) $(CLOJURE_COURSE)
.PHONY: all clean setup deploy lint

all: setup $(ALL) # site/js/compiled/main.js

clean:
rm site/*.html site/*.pdf site/clojure/*.html
rm -fr site/*.html site/*.pdf site/*/*.html site/js/compiled site/img/stem*

setup: .bundle site/reveal.js

deploy: all
./deploy.sh

lint:
docker run -e RUN_LOCAL=true -v `pwd`:/tmp/lint github/super-linter

setup: .bundle
## Asciidoctor dependencies

.bundle:
.bundle: Gemfile
bundle --path=.bundle/gems --binstubs=.bundle/.bin

site/clojure/%.html: docs/clojure/%.adoc
bundle exec asciidoctor-revealjs --destination-dir=site/clojure $<
site/reveal.js:
wget https://github.com/hakimel/reveal.js/archive/master.zip && unzip master.zip && mv reveal.js-master site/reveal.js && rm master.zip

# Rules

## Slides
site/%.slides.html: docs/%.adoc docs/docinfo.attrs .bundle
bundle exec asciidoctor-revealjs --out-file $@ $<

## HTML
site/%.html: docs/%.adoc docs/docinfo.attrs .bundle
bundle exec asciidoctor --out-file $@ $<

site/%.html: docs/%.adoc
bundle exec asciidoctor --destination-dir=site $<
## PDF
site/%.pdf: docs/%.adoc docs/docinfo.attrs .bundle
bundle exec asciidoctor-pdf -r asciidoctor-mathematical --out-file $@ $<

site/%.pdf: docs/%.adoc
bundle exec asciidoctor-pdf --destination-dir=site $<
#site/js/compiled/main.js: deps.edn cljs.edn src/enterprise_clojure_training/main.cljs
# clojure -M --main cljs.main --compile-opts cljs.edn --compile

pdfslides:
docker run --rm -t -v `pwd`:/slides -v ~:/home/user astefanutti/decktape --size 1366x784 site/extra/term-rewriting-with-meander-examples.slides.html slides.pdf
34 changes: 1 addition & 33 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,11 @@ The Web (Epiphany) browser reloads from disk when the HTML file changes.

The easiest way to build is to run

./bb.sh
make

This script relies on bundler (See The Ruby way for more info).
It will install dependencies and build the documents into html/pdf.


=== With installed CLI tools.

You can install asciidoctor, asciidoctor-pdf, and ascidoctor-revealjs locally and run

./build.sh

But installing these tools is a bit of a pain... so two ways to get the dependencies are provided:


==== The Ruby way

Requires https://www.ruby-lang.org/en/documentation/installation[Ruby].

You don't need to install Asciidoctor.
Expand All @@ -72,16 +60,6 @@ Requires Bundler:

gem install bundler

Pull the dependencies:

bundle --path=.bundle/gems --binstubs=.bundle/.bin

Now you can call the build script:

bundle exec ./build.sh

The `./bb.sh` just does these two steps for you.


=== Rebuild on file modified

Expand All @@ -98,18 +76,8 @@ Or
apt install entr


==== The Docker way

Alternatively, if you prefer pulling a Docker image over installing dependencies:

docker run -v $(pwd):/documents/ asciidoctor/docker-asciidoctor /documents/build.sh


== Deploying

TravisCI automatically deploys the latest version to https://timothypratley.github.io/enterprise-clojure-training[GitHub Pages].
image:https://travis-ci.org/timothypratley/enterprise-clojure-training.svg?branch=master[Build Status, link=https://travis-ci.org/timothypratley/enterprise-clojure-training]

Manual deployment:

./deploy.sh
10 changes: 0 additions & 10 deletions bb.sh

This file was deleted.

8 changes: 0 additions & 8 deletions build.sh

This file was deleted.

5 changes: 5 additions & 0 deletions cljs.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{:main "enterprise-clojure-training.main"
:output-dir "site/js/compiled"
:output-to "site/js/compiled/main.js"
:asset-path "js/compiled"
:optimizations :none}
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
cd $(dirname $0)
cd "$(dirname "$0")"
./build.sh
cd site
git init
Expand Down
3 changes: 3 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{:deps {org.clojure/clojurescript {:mvn/version "1.10.758"}
viebel/klipse {:mvn/version "7.10.4"}
meander/epsilon {:mvn/version "0.0.512"}}}
8 changes: 4 additions & 4 deletions docs/clojure/0-introduction.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
= Enterprise Clojure Training
:copyright: Timothy Pratley
:license: Eclipse Public License http://www.eclipse.org/legal/epl-v10.html
include::slide.attrs[]
include::../docinfo.attrs[]


[state=title]
== Enterprise Clojure Training

image:../img/corgi.jpg[]
image:corgi.jpg[]


[state=title]
Expand Down Expand Up @@ -37,12 +37,12 @@ image:../img/corgi.jpg[]
[state=title]
== Introductions

image:../img/art1.jpg[]
image:art1.jpg[]

[state=title]
== Clojure

image:../img/clojure-logo.png[]
image:clojure-logo.png[]

"What language is it that meets all the criteria? What language would I choose if I had to choose today? Probably Clojure!"
-- Robert Martin
Expand Down
4 changes: 2 additions & 2 deletions docs/clojure/1-ecosystem.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
= Enterprise Clojure Training
:copyright: Timothy Pratley
:license: Eclipse Public License http://www.eclipse.org/legal/epl-v10.html
include::slide.attrs[]
include::../docinfo.attrs[]


[state=title]
== 1. The Clojure Ecosystem

image:../img/ecosystem.jpg[]
image:ecosystem.jpg[]

"Integrity is an ecosystem."
-- Michael Leunig
Expand Down
Loading