From f26a7f86b10197d011f0084765564d332e19e14f Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Fri, 16 Oct 2020 11:21:13 -0400 Subject: Put some CSS in separate tmpl files with simple substitutions This will make it a lot easier for people to work on the theming without digging into XSLT files. --- doc/yelp-xsl/C/db2html.page | 1 + doc/yelp-xsl/C/db2xhtml.page | 1 + doc/yelp-xsl/C/mal2html.page | 1 + doc/yelp-xsl/C/mal2xhtml.page | 1 + doc/yelp-xsl/C/tmpl.file.page | 59 +++++++++++++++++++++++++++++++++++++++++++ doc/yelp-xsl/C/tmpl.page | 53 ++++++++++++++++++++++++++++++++++++++ doc/yelp-xsl/C/tmpl.text.page | 56 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 172 insertions(+) create mode 100644 doc/yelp-xsl/C/tmpl.file.page create mode 100644 doc/yelp-xsl/C/tmpl.page create mode 100644 doc/yelp-xsl/C/tmpl.text.page (limited to 'doc/yelp-xsl/C') diff --git a/doc/yelp-xsl/C/db2html.page b/doc/yelp-xsl/C/db2html.page index 947fd00e..6338afaf 100644 --- a/doc/yelp-xsl/C/db2html.page +++ b/doc/yelp-xsl/C/db2html.page @@ -6,6 +6,7 @@ + diff --git a/doc/yelp-xsl/C/db2xhtml.page b/doc/yelp-xsl/C/db2xhtml.page index 7966de28..6be5e007 100644 --- a/doc/yelp-xsl/C/db2xhtml.page +++ b/doc/yelp-xsl/C/db2xhtml.page @@ -6,6 +6,7 @@ + diff --git a/doc/yelp-xsl/C/mal2html.page b/doc/yelp-xsl/C/mal2html.page index 481f2699..ff738cb0 100644 --- a/doc/yelp-xsl/C/mal2html.page +++ b/doc/yelp-xsl/C/mal2html.page @@ -7,6 +7,7 @@ + diff --git a/doc/yelp-xsl/C/mal2xhtml.page b/doc/yelp-xsl/C/mal2xhtml.page index 4ae4d1bc..47b08cab 100644 --- a/doc/yelp-xsl/C/mal2xhtml.page +++ b/doc/yelp-xsl/C/mal2xhtml.page @@ -7,6 +7,7 @@ + diff --git a/doc/yelp-xsl/C/tmpl.file.page b/doc/yelp-xsl/C/tmpl.file.page new file mode 100644 index 00000000..5d4179b7 --- /dev/null +++ b/doc/yelp-xsl/C/tmpl.file.page @@ -0,0 +1,59 @@ + + + + + + Perform text substitutions on a file. + + + tmpl.file + + Parameters + + + <code>$file</code> +

The filename of the file to process for substitutions.

+
+ + <code>$node</code> +

The node to create CSS for.

+
+ + <code>$direction</code> +

The directionality of the text, either ltr or rtl.

+
+ + <code>$left</code> +

The starting alignment, either left or right.

+
+ + <code>$right</code> +

The ending alignment, either left or right.

+
+
+
+

This template reads the file specified by the $file parameter and performs + text substitutions. Due to XSLT limitations, the file must be a well-formed + XML document. However, this template simply takes the string value of the + document, so it is sufficient to wrap the text in a dummy element and ensure + any < and & characters are escaped.

+

See tmpl for information on the substitution syntax.

+ +

This template was added in version 40.

+
+ + Calls Templates + +

+
+ +

+
+ +

+
+ +

+
+
+
diff --git a/doc/yelp-xsl/C/tmpl.page b/doc/yelp-xsl/C/tmpl.page new file mode 100644 index 00000000..1715bc39 --- /dev/null +++ b/doc/yelp-xsl/C/tmpl.page @@ -0,0 +1,53 @@ + + + + + Perform simple substitutions in text files. + + + Text Templates +

This stylesheet contains templates to perform simple substitutions on text + and files containing text. The primary purpose of these templates is to allow + CSS and JavaScript to be maintained in separate files outside the XSLT, but + still allow those files to reference variables for things like color themes + and text directionality.

+

The substitution evaluates anything between {{ and }}. Usually, this will + be a reference to a parameter or variable, but it can be any XPath expression. + For example, {{$color.fg}} will be replaced with the primary text color.

+

This syntax is similar to XSLT attribute value templates, except that it uses + double curly braces to avoid conflicts with the many curly braces used in CSS + and JavaScript files.

+ +

This stylesheet was added in version 40.

+
+ + Imports Stylesheets + + + Includes Stylesheets + + + Defines Parameters + + + Defines Keys + + + Defines Templates + + + Defines Modes + + + Calls Templates + +

+
+ +

+
+ +

+
+
+
diff --git a/doc/yelp-xsl/C/tmpl.text.page b/doc/yelp-xsl/C/tmpl.text.page new file mode 100644 index 00000000..4f4f5901 --- /dev/null +++ b/doc/yelp-xsl/C/tmpl.text.page @@ -0,0 +1,56 @@ + + + + + + Perform text substitutions on some text. + + + tmpl.text + + Parameters + + + <code>$text</code> +

The text to process for substitutions.

+
+ + <code>$node</code> +

The node to create CSS for.

+
+ + <code>$direction</code> +

The directionality of the text, either ltr or rtl.

+
+ + <code>$left</code> +

The starting alignment, either left or right.

+
+ + <code>$right</code> +

The ending alignment, either left or right.

+
+
+
+

This template performs text substitutions on the text in $text. It is called + by tmpl.file, and it calls itself recursively after each substitution.

+

See tmpl for information on the substitution syntax.

+ +

This template was added in version 40.

+
+ + Calls Templates + +

+
+ +

+
+ +

+
+ +

+
+
+
-- cgit v1.2.1