RPGs3_card_insanity/templates/style.xsl.j2

59 lines
1.3 KiB
Django/Jinja

<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="/*">
{% set newline = "<xsl:text disable-output-escaping='yes'>\n</xsl:text>" %}
<html>
{% filter replace(">", ">foobarhuehuehue")
| replace("<", "<xsl:text disable-output-escaping='yes'>&lt;</xsl:text>")
| replace(">foobarhuehuehue", "<xsl:text disable-output-escaping='yes'>&gt;</xsl:text>")
| replace("\n", newline)
| replace("</xsl:text><xsl:text disable-output-escaping='yes'>", "") %}
<head>
{{ card_header }}
<title>Status Card</title>
</head>
{% endfilter %}
<body content_type="html5">
<style type="text/css">
{{ css_data.strip() }}
</style>
{{ newline*2 }}
<script type="text/html" id="yaml_data">
<xsl:value-of select="yaml_data"/>
</script>
{{ newline*2 }}
<script type="text/javascript">
var jinja_template =
{{ jinja_data.strip() | tojson | replace("\\n", "\\n\" +\n\"") }};
</script>
{{ newline*2 }}
<script type="text/javascript">
{{ js_data.strip()
| replace(">", ">foobarhuehuehue")
| replace("<", "<xsl:text disable-output-escaping='yes'>&lt;</xsl:text>")
| replace(">foobarhuehuehue", "<xsl:text disable-output-escaping='yes'>&gt;</xsl:text>") }}
</script>
{{ newline*2 }}
</body>
{{ newline }}
</html>
</xsl:template>
</xsl:stylesheet>