Skip to content

Commit

Permalink
Include samples.html in release package
Browse files Browse the repository at this point in the history
  • Loading branch information
tatetian committed Jan 18, 2018
1 parent 46138b9 commit dbc8213
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ static/katex/:
@echo "> Katex downloaded"


build: build/pseudocode.js build/pseudocode.css
build: build/pseudocode.js build/pseudocode.css build/samples.html
@echo "> Building succeeded"

build/pseudocode.min.js: build/pseudocode.js
$(UGLIFYJS) < $< > $@

build/pseudocode.js: pseudocode.js $(wildcard src/*.js)
@$(MAKE) --no-print-directory lint
$(BROWSERIFY) $< --exclude katex --standalone pseudocode -o $@
Expand All @@ -43,27 +40,33 @@ lint: pseudocode.js $(wildcard src/*.js)
watch-js: pseudocode.js $(wildcard src/*.js)
$(WATCHIFY) $< --standalone pseudocode -o build/pseudocode.js

build/pseudocode.min.css: build/pseudocode.css
$(CLEANCSS) -o $@ $<

build/pseudocode.css: static/pseudocode.css
cp static/pseudocode.css build/pseudocode.css

build/samples.html: static/samples.html.template
cp $< $@


release: build/pseudocode-js.tar.gz build/pseudocode-js.zip
release: build build/pseudocode-js.tar.gz build/pseudocode-js.zip
@echo "> Release package generated"

RELEASE_DIR=pseudocode-$(VERSION)/
RELEASE_DIR=pseudocode.js-$(VERSION)/
build/pseudocode-js.tar.gz: build/$(RELEASE_DIR)
cd build && tar czf pseudocode-js.tar.gz $(RELEASE_DIR)

build/pseudocode-js.zip: build/$(RELEASE_DIR)
cd build && zip -rq pseudocode-js.zip $(RELEASE_DIR)

build/$(RELEASE_DIR): build/pseudocode.min.js build/pseudocode.min.css README.md
build/$(RELEASE_DIR): build/pseudocode.js build/pseudocode.min.js build/pseudocode.css build/pseudocode.min.css build/samples.html README.md
mkdir -p build/$(RELEASE_DIR)
cp -r $^ build/$(RELEASE_DIR)

build/pseudocode.min.js: build/pseudocode.js
$(UGLIFYJS) < $< > $@

build/pseudocode.min.css: build/pseudocode.css
$(CLEANCSS) -o $@ $<


clean:
@rm -rf build/*
12 changes: 8 additions & 4 deletions static/test-suite.html → static/samples.html.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
<html>
<head>
<meta charset="utf-8">
<title>Test suite of pseudocode.js</title>
<title>Pseudocode.js Samples</title>
<!-- KaTeX is the only dependency -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-beta/katex.min.css" integrity="sha384-L/SNYu0HM7XECWBeshTGLluQO9uVI1tvkCtunuoUbCHHoTH76cDyXty69Bb9I0qZ" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-beta/katex.min.js" integrity="sha384-ad+n9lzhJjYgO67lARKETJH6WuQVDDlRfj81AJJSswMyMkXTD49wBj5EP004WOY6" crossorigin="anonymous"></script>
<!-- Or use a loca copy of KaTeX
<link rel="stylesheet" href="./katex/katex.min.css" type="text/css">
<script src="./katex/katex.min.js" type="text/javascript"></script>
-->
<!-- Pseudocode -->
<link rel="stylesheet" href="../build/pseudocode.css" type="text/css">
<script src="../build/pseudocode.js" type="text/javascript"></script>
<link rel="stylesheet" href="pseudocode.css" type="text/css">
<script src="pseudocode.js" type="text/javascript"></script>
</head>
<body>
<pre id="test-basics" style="display:none">
Expand Down Expand Up @@ -44,7 +48,7 @@
\STATE \textbf{Carriage return:} first line \\ second line
\STATE \textbf{Text-symbols:} \textbackslash
\STATE \textbf{Quote-symbols:} `single quotes', ``double quotes''
\STATE \textbf{Math:} $i \gets i + 1$, $E=mc^2$, \( x^n + y^n = z^n \), $\$$, \(\$\)
\STATE \textbf{Math:} $(\mathcal{C}_m)$, $i \gets i + 1$, $E=mc^2$, \( x^n + y^n = z^n \), $\$$, \(\$\)
\END{ALGORITHMIC}
\END{ALGORITHM}
</pre>
Expand Down

0 comments on commit dbc8213

Please sign in to comment.