Did someething
This commit is contained in:
parent
fbe01f60b5
commit
c41553fac8
22
Makefile
22
Makefile
|
@ -1,10 +1,11 @@
|
||||||
|
|
||||||
|
all: build/out.html
|
||||||
|
|
||||||
out.html: card.yaml build/card.xls style.html.j2 style.css
|
build/out.html: card.yaml build/card.xml build/style.xsl style.css
|
||||||
xsltproc \
|
xsltproc \
|
||||||
--output out.html \
|
-o build/out.html \
|
||||||
style.html.j2 \
|
build/style.xsl \
|
||||||
build/card.xls
|
build/card.xml
|
||||||
|
|
||||||
|
|
||||||
define TMP_PYTHON_PROG
|
define TMP_PYTHON_PROG
|
||||||
|
@ -20,14 +21,21 @@ out = Environment(
|
||||||
|
|
||||||
#print(out)
|
#print(out)
|
||||||
|
|
||||||
with open("build/card.xls", "w") as f:
|
with open("build/card.xml", "w") as f:
|
||||||
f.write(data)
|
f.write(out)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
export TMP_PYTHON_PROG
|
export TMP_PYTHON_PROG
|
||||||
build/card.xls:
|
build/card.xml:
|
||||||
python -c "$$TMP_PYTHON_PROG"
|
python -c "$$TMP_PYTHON_PROG"
|
||||||
|
|
||||||
|
build/style.xsl: style.html.j2
|
||||||
|
cp style.html.j2 build/style.xsl
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: dev
|
||||||
|
dev:
|
||||||
|
git ls-files | entr make all
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,10 +1,30 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
<script src="https://raw.githubusercontent.com/nodeca/js-yaml/master/dist/js-yaml.min.js"></script>
|
|
||||||
<script src="http://mozilla.github.io/nunjucks/files/nunjucks.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"/>
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
XSLT file for the status card style. This file is shared between all cards of this style.
|
||||||
|
|
||||||
|
This file transforms XML into renderable XHTML. The output must be a valid XHTML document.
|
||||||
|
|
||||||
|
If you want something more advanced than what XSLT can offer, feel free to go nuts with javascript here.
|
||||||
|
The XML can easily be converted to JSON using XSLT (https://www.bjelic.net/2012/08/01/coding/convert-xml-to-json-using-xslt/),
|
||||||
|
and if you just put that output into a <script> tag you have everything you need in javascript.
|
||||||
|
|
||||||
|
I strongly urge styles to produce an empty card even if the input is empty or mismatching.
|
||||||
|
The preview window looks sad otherwise.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||||
|
<xsl:output method="xml" omit-xml-declaration="yes" />
|
||||||
|
<xsl:template match="/*">
|
||||||
|
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||||
|
<head>
|
||||||
<title>Status Card</title>
|
<title>Status Card</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
/**
|
||||||
|
* The Danner style of cards. Using grid layouts.
|
||||||
|
**/
|
||||||
|
|
||||||
.danner_card
|
.danner_card
|
||||||
{
|
{
|
||||||
display: grid;
|
display: grid;
|
||||||
|
@ -167,10 +187,12 @@
|
||||||
border: 0.1em solid #444444;
|
border: 0.1em solid #444444;
|
||||||
background-color: #eeeeee;
|
background-color: #eeeeee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"/>
|
||||||
<xsl:template match="/*">
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
<div class="danner_card">
|
<div class="danner_card">
|
||||||
|
|
||||||
|
@ -372,5 +394,9 @@
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -1,16 +1,23 @@
|
||||||
<!DOCTYPE html>
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||||
|
<xsl:output method="html" omit-xml-declaration="yes" />
|
||||||
|
<xsl:template match="/*">
|
||||||
|
<xsl:text disable-output-escaping='yes'><!DOCTYPE html>
|
||||||
|
</xsl:text>
|
||||||
|
|
||||||
<script src="https://raw.githubusercontent.com/nodeca/js-yaml/master/dist/js-yaml.min.js"></script>
|
<script src="https://raw.githubusercontent.com/nodeca/js-yaml/master/dist/js-yaml.min.js"></script>
|
||||||
<script src="http://mozilla.github.io/nunjucks/files/nunjucks.min.js"></script>
|
<script src="http://mozilla.github.io/nunjucks/files/nunjucks.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"/>
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"/>
|
||||||
|
|
||||||
<title>Status Card</title>
|
<title>Status Card</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
{{ css_data }}
|
<xsl:include href="style.css"/>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<xsl:template match="/*">
|
|
||||||
|
|
||||||
<div class="fjomp_card">
|
<div class="fjomp_card">
|
||||||
|
asdasd<br/>
|
||||||
|
asdasd<br/>
|
||||||
|
asdasd<br/>
|
||||||
|
asdasd<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
Loading…
Reference in New Issue