diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2007-03-02 16:27:05 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2007-03-02 16:27:05 +0000 |
commit | d0a2fe589c3a3277c2ce91ec94e2f82f17e7e3cd (patch) | |
tree | 984f44029d0162304873ffb4a95ceac924e9c814 | |
parent | d91d0dc0749db748e8968f3e12d59bb1be724ad1 (diff) | |
download | gnome-doc-utils-d0a2fe589c3a3277c2ce91ec94e2f82f17e7e3cd.tar.gz |
- Adding stubs for design principles and explantory content
* spec/10minutes.xml:
* spec/explore.xml:
* spec/principle-guide.xml:
* spec/principle-justenough.xml:
* spec/principle-redundancy.xml:
* spec/principles.xml:
- Adding stubs for design principles and explantory content
* spec/*.xml:
- Adding version information and stub content to all pages
* spec/mallard.xml:
* spec/spec.xml:
* spec/spec_info.xml:
* spec/spec_pages.xml:
- Adding some guide pages
* spec/figures/mallard.png:
- Adding Drake
* spec/TODO:
- Adding 'Best Practices' to section list
* xslt/mal2html.xsl:
* xslt/mal2html-page.xsl:
- Better page handling, page and guide links added
* xslt/theme.xml:
* xslt/theme.xsl:
- New module for themeable colors and icons
* xslt/mal2cache.xsl:
- Ensure info elements are always created
* xslt/mal-link.xsl:
- Ensure link content is correct for sections
* xslt/mal2html-table.xsl:
- Partial table support
* xslt/mal2html-css.xsl:
- Moved page CSS to mal2html-page.xsl
* xslt/mal2html-block.xsl:
- Using new themeable colors
* xslt/mal2html-list.xsl:
- Partial support for tree lists
* html/Makefile:
- Make targets depend on the XSLT
svn path=/trunk/; revision=893
59 files changed, 1785 insertions, 160 deletions
diff --git a/sandbox/mallard/ChangeLog b/sandbox/mallard/ChangeLog index 048975c..8842e94 100644 --- a/sandbox/mallard/ChangeLog +++ b/sandbox/mallard/ChangeLog @@ -1,3 +1,57 @@ +2007-03-02 Shaun McCance <shaunm@gnome.org> + + * spec/10minutes.xml: + * spec/explore.xml: + * spec/principle-guide.xml: + * spec/principle-justenough.xml: + * spec/principle-redundancy.xml: + * spec/principles.xml: + - Adding stubs for design principles and explantory content + + * spec/*.xml: + - Adding version information and stub content to all pages + + * spec/mallard.xml: + * spec/spec.xml: + * spec/spec_info.xml: + * spec/spec_pages.xml: + - Adding some guide pages + + * spec/figures/mallard.png: + - Adding Drake + + * spec/TODO: + - Adding 'Best Practices' to section list + + * xslt/mal2html.xsl: + * xslt/mal2html-page.xsl: + - Better page handling, page and guide links added + + * xslt/theme.xml: + * xslt/theme.xsl: + - New module for themeable colors and icons + + * xslt/mal2cache.xsl: + - Ensure info elements are always created + + * xslt/mal-link.xsl: + - Ensure link content is correct for sections + + * xslt/mal2html-table.xsl: + - Partial table support + + * xslt/mal2html-css.xsl: + - Moved page CSS to mal2html-page.xsl + + * xslt/mal2html-block.xsl: + - Using new themeable colors + + * xslt/mal2html-list.xsl: + - Partial support for tree lists + + * html/Makefile: + - Make targets depend on the XSLT + 2007-02-19 Shaun McCance <shaunm@gnome.org> * xslt/mal2html.xsl: diff --git a/sandbox/mallard/html/Makefile b/sandbox/mallard/html/Makefile index a56fc2a..34e714d 100644 --- a/sandbox/mallard/html/Makefile +++ b/sandbox/mallard/html/Makefile @@ -1,9 +1,10 @@ +xslts=$(wildcard ../xslt/*.xsl) specs=$(filter-out ../spec/legal.xml, $(wildcard ../spec/*.xml)) pages=$(patsubst %.xml,%.xhtml, $(notdir $(specs))) all: $(pages) figures mallard.cache -mallard.cache : $(wildcard ../xslt/*.xsl) +mallard.cache : $(specs) $(xslts) echo '<cache xmlns="http://www.gnome.org/~shaunm/mallard">' > $@.in for file in $(specs); do \ echo "<page href='$$file'/>" >> $@.in; \ @@ -12,8 +13,7 @@ mallard.cache : $(wildcard ../xslt/*.xsl) xsltproc ../xslt/mal2cache.xsl $@.in | xmllint --format - > $@ rm $@.in -$(pages) : mallard.cache -$(pages) : $(wildcard ../xslt/*.xsl) +$(pages) : mallard.cache ../xslt/theme.xml $(xslts) $(pages) : %.xhtml : ../spec/%.xml xsltproc -o $@ \ --stringparam mal.cache_file `pwd`/mallard.cache \ diff --git a/sandbox/mallard/spec/10minutes.xml b/sandbox/mallard/spec/10minutes.xml new file mode 100644 index 0000000..b085625 --- /dev/null +++ b/sandbox/mallard/spec/10minutes.xml @@ -0,0 +1,15 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="10minutes"> +<info> + <version number="0.1" date="2007-02-21" status="stub"/> + <desc>Create a multiple-page document in only ten minutes</desc> +</info> + +<title>Ten Minute Tour</title> + +<comment> + <cite name="Shaun McCance" date="2007-01-30"/> + <p>Add content</p> +</comment> + +</topic> diff --git a/sandbox/mallard/spec/TODO b/sandbox/mallard/spec/TODO index 92479f6..49458f7 100644 --- a/sandbox/mallard/spec/TODO +++ b/sandbox/mallard/spec/TODO @@ -8,6 +8,7 @@ sections: - content: Content - attributes: Attributes - examples: Examples +- best: Best Practices - design: Design Notes - processing: Processing Expectations - html: Comparison to HTML diff --git a/sandbox/mallard/spec/explore.xml b/sandbox/mallard/spec/explore.xml new file mode 100644 index 0000000..f602e2c --- /dev/null +++ b/sandbox/mallard/spec/explore.xml @@ -0,0 +1,15 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="explore"> +<info> + <version number="0.1" date="2007-02-21" status="stub"/> + <desc>Explore more of what Mallard has to offer</desc> +</info> + +<title>Explore Mallard</title> + +<comment> + <cite name="Shaun McCance" date="2007-02-22"/> + <p>Add content</p> +</comment> + +</topic> diff --git a/sandbox/mallard/spec/figures/mallard.png b/sandbox/mallard/spec/figures/mallard.png Binary files differnew file mode 100644 index 0000000..0ed0645 --- /dev/null +++ b/sandbox/mallard/spec/figures/mallard.png diff --git a/sandbox/mallard/spec/mal_block.xml b/sandbox/mallard/spec/mal_block.xml index c53b7e3..556cd8d 100644 --- a/sandbox/mallard/spec/mal_block.xml +++ b/sandbox/mallard/spec/mal_block.xml @@ -1,6 +1,8 @@ <guide xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_block"> <info> + <link type="guide" xref="spec"/> + <version number="0.1" date="2007-02-21" status="incomplete"/> </info> <title>Block Elements</title> diff --git a/sandbox/mallard/spec/mal_caption.xml b/sandbox/mallard/spec/mal_caption.xml index 4de41de..a5115a5 100644 --- a/sandbox/mallard/spec/mal_caption.xml +++ b/sandbox/mallard/spec/mal_caption.xml @@ -1,9 +1,11 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_caption"> <info> <version number="0.1" date="2007-02-05" status="draft"/> <credit type="author" name="Shaun McCance" email="shaunm@gnome.org"/> <copyright year="2007" name="Shaun McCance"/> <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" /> + <link type="guide" xref="mal_block"/> </info> <title>Captions</title> diff --git a/sandbox/mallard/spec/mal_cite.xml b/sandbox/mallard/spec/mal_cite.xml index 40b5555..eb64f0d 100644 --- a/sandbox/mallard/spec/mal_cite.xml +++ b/sandbox/mallard/spec/mal_cite.xml @@ -1,9 +1,11 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_cite"> <info> <version number="0.1" date="2007-02-08" status="draft"/> <credit type="author" name="Shaun McCance" email="shaunm@gnome.org"/> <copyright year="2007" name="Shaun McCance"/> <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" /> + <link type="guide" xref="mal_block"/> </info> <title>Citations</title> diff --git a/sandbox/mallard/spec/mal_cmd.xml b/sandbox/mallard/spec/mal_cmd.xml index 8e6bd26..218d022 100644 --- a/sandbox/mallard/spec/mal_cmd.xml +++ b/sandbox/mallard/spec/mal_cmd.xml @@ -3,7 +3,7 @@ <info> <link type="guide" xref="mal_inline"/> <link type="seealso" xref="mal_screen"/> - <version number="0.1" date="2007-02-05" status="draft"/> + <version number="0.1" date="2007-02-05" status="incomplete"/> <credit type="author" name="Shaun McCance" email="shaunm@gnome.org"/> <copyright year="2007" name="Shaun McCance"/> <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" /> @@ -36,8 +36,8 @@ replaced by the user.</p> <section> <title>Basic Use</title> <code><![CDATA[ -<p>To start <app>Totem Movie Player</app>, enter <cmd>totem</cmd> at the -command line.</p> +<p>To start <app>Totem Movie Player</app>, enter <cmd>totem</cmd> at +the command line.</p> ]]></code> <p>To start <app>Totem Movie Player</app>, enter <cmd>totem</cmd> at the command line.</p> @@ -46,8 +46,9 @@ command line.</p> <section> <title>Using <code>var</code></title> <code><![CDATA[ -<p>To view a file in <app>Totem Movie Player</app>, enter <cmd>totem <var>file</var></cmd> -at the command line, replacing <var>file</var> with the name of the file.</p> +<p>To view a file in <app>Totem Movie Player</app>, enter <cmd>totem +<var>file</var></cmd> at the command line, replacing <var>file</var> +with the name of the file.</p> ]]></code> <p>To view a file in <app>Totem Movie Player</app>, enter <cmd>totem <var>file</var></cmd> at the command line, replacing <var>file</var> with the name of the file.</p> diff --git a/sandbox/mallard/spec/mal_code.xml b/sandbox/mallard/spec/mal_code.xml index 34a6aff..4cfe00f 100644 --- a/sandbox/mallard/spec/mal_code.xml +++ b/sandbox/mallard/spec/mal_code.xml @@ -3,6 +3,7 @@ <info> <link type="guide" xref="mal_block#simple"/> <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Code Snippets</title> @@ -22,7 +23,7 @@ mal_code_inline = element code { }</code></synopsis> <comment> - <cite><name>Shaun McCance</name><date>2006-12-08</date></cite> + <cite name="Shaun McCance" date="2006-12-08"/> <p>Add intro material.</p> </comment> @@ -31,7 +32,7 @@ mal_code_inline = element code { <section id="examples" status="tentative"> <title>Examples</title> <comment> - <cite><name>Shaun McCance</name><date>2007-01-25</date></cite> + <cite name="Shaun McCance" date="2007-01-25"/> <p>Add examples.</p> </comment> </section> @@ -42,7 +43,7 @@ mal_code_inline = element code { <section id="processing" status="tentative"> <title>Processing Expectations</title> <comment> - <cite><name>Shaun McCance</name><date>2007-01-25</date></cite> + <cite name="Shaun McCance" date="2007-01-25"/> <p>Add processing expectations. For block, strip leading/trailing newline. Do not strip leading indentation.</p> </comment> @@ -54,7 +55,7 @@ mal_code_inline = element code { <section id="docbook" status="tentative"> <title>Comparison to DocBook</title> <comment> - <cite><name>Shaun McCance</name><date>2007-01-25</date></cite> + <cite name="Shaun McCance" date="2007-01-25"/> <p>Add: code, class*, func*, programlisting</p> </comment> </section> diff --git a/sandbox/mallard/spec/mal_comment.xml b/sandbox/mallard/spec/mal_comment.xml index 88c8297..4519c78 100644 --- a/sandbox/mallard/spec/mal_comment.xml +++ b/sandbox/mallard/spec/mal_comment.xml @@ -2,6 +2,7 @@ id="mal_comment"> <info> <link type="guide" xref="mal_block#containers"/> + <version number="0.1" date="2007-02-21" status="incomplete"/> </info> <title>Editorial Comments</title> diff --git a/sandbox/mallard/spec/mal_copyright.xml b/sandbox/mallard/spec/mal_copyright.xml index b65623e..4f1cb4c 100644 --- a/sandbox/mallard/spec/mal_copyright.xml +++ b/sandbox/mallard/spec/mal_copyright.xml @@ -1,2 +1,13 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_copyright"> +<info> + <version number="0.1" date="2007-02-23" status="stub"/> + <credit type="author" name="Shaun McCance" email="shaunm@gnome.org"/> + <copyright year="2007" name="Shaun McCance"/> + <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" /> + <link type="guide" xref="spec_info"/> +</info> + +<title>Copyright Information</title> + </topic> diff --git a/sandbox/mallard/spec/mal_credit.xml b/sandbox/mallard/spec/mal_credit.xml index f18a394..efbbc0e 100644 --- a/sandbox/mallard/spec/mal_credit.xml +++ b/sandbox/mallard/spec/mal_credit.xml @@ -1,14 +1,18 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_credit"> <info> - <link type="guide" xref="mal_TODO"/> + <link type="guide" xref="spec_info"/> + <version number="0.1" date="2007-02-22" status="stub"/> </info> <title>Credits</title> <synopsis><code mime="application/relax-ng-compact-syntax"> mal_credit = element credit { - attribute type { "author" | "editor" | "collaborator" | "translator" | "publisher" }, + attribute type { + "author" | "editor" | + "maintainer" | "collaborator" | + "translator" | "publisher" }, attribute name { text }, attribute date { xsd:date } ?, attribute email { text } ? diff --git a/sandbox/mallard/spec/mal_em.xml b/sandbox/mallard/spec/mal_em.xml index ba1d64f..53417df 100644 --- a/sandbox/mallard/spec/mal_em.xml +++ b/sandbox/mallard/spec/mal_em.xml @@ -2,6 +2,7 @@ id="mal_em"> <info> <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Emphasis</title> diff --git a/sandbox/mallard/spec/mal_figure.xml b/sandbox/mallard/spec/mal_figure.xml index 02b142d..d4f0784 100644 --- a/sandbox/mallard/spec/mal_figure.xml +++ b/sandbox/mallard/spec/mal_figure.xml @@ -2,6 +2,7 @@ id="mal_figure"> <info> <link type="guide" xref="mal_block#containers"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Figures</title> diff --git a/sandbox/mallard/spec/mal_file.xml b/sandbox/mallard/spec/mal_file.xml index fcd3367..f460bb0 100644 --- a/sandbox/mallard/spec/mal_file.xml +++ b/sandbox/mallard/spec/mal_file.xml @@ -2,6 +2,7 @@ id="mal_file"> <info> <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>File Names</title> diff --git a/sandbox/mallard/spec/mal_gui.xml b/sandbox/mallard/spec/mal_gui.xml index 7f3c861..767357b 100644 --- a/sandbox/mallard/spec/mal_gui.xml +++ b/sandbox/mallard/spec/mal_gui.xml @@ -2,9 +2,10 @@ id="mal_gui"> <info> <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> -<title>Graphical Interface Elements</title> +<title>GUI Labels</title> <synopsis><code mime="application/relax-ng-compact-syntax"> mal_gui = element gui { diff --git a/sandbox/mallard/spec/mal_guide.xml b/sandbox/mallard/spec/mal_guide.xml index 3673385..6ad11b7 100644 --- a/sandbox/mallard/spec/mal_guide.xml +++ b/sandbox/mallard/spec/mal_guide.xml @@ -1,6 +1,8 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_guide"> <info> + <link type="guide" xref="spec_pages"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Guide Pages</title> diff --git a/sandbox/mallard/spec/mal_inline.xml b/sandbox/mallard/spec/mal_inline.xml index 033b9cd..356e195 100644 --- a/sandbox/mallard/spec/mal_inline.xml +++ b/sandbox/mallard/spec/mal_inline.xml @@ -1,6 +1,8 @@ <guide xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_inline"> <info> + <link type="guide" xref="spec"/> + <version number="0.1" date="2007-02-21" status="incomplete"/> </info> <title>Inline Elements</title> @@ -20,7 +22,8 @@ mal_inline = ( <link xref="mal_output">mal_output</link> | <link xref="mal_quote">mal_quote_inline</link> | <link xref="mal_sys">mal_sys</link> | - <link xref="#simple">mal_inline_simple</link> ) + mal_inline_simple ) +mal_inline_simple = ( <link xref="mal_var">mal_var</link> | text ) </code></synopsis> <comment> @@ -28,17 +31,4 @@ mal_inline = ( <p>Add some intro text</p> </comment> - -<!-- BEGIN simple --> -<section id="simple"> -<title>Simple Inline</title> - -<synopsis><code>mal_inline_simple = ( - <link xref="mal_var">mal_var</link> | - text ) -</code></synopsis> - -</section> -<!-- END simple --> - </guide> diff --git a/sandbox/mallard/spec/mal_input.xml b/sandbox/mallard/spec/mal_input.xml index b65623e..7806032 100644 --- a/sandbox/mallard/spec/mal_input.xml +++ b/sandbox/mallard/spec/mal_input.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_input"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>User Input</title> + </topic> diff --git a/sandbox/mallard/spec/mal_key.xml b/sandbox/mallard/spec/mal_key.xml index b65623e..2e611e6 100644 --- a/sandbox/mallard/spec/mal_key.xml +++ b/sandbox/mallard/spec/mal_key.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_key"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Key Strokes</title> + </topic> diff --git a/sandbox/mallard/spec/mal_license.xml b/sandbox/mallard/spec/mal_license.xml index b65623e..89f0ee6 100644 --- a/sandbox/mallard/spec/mal_license.xml +++ b/sandbox/mallard/spec/mal_license.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_license"> +<info> + <link type="guide" xref="spec_info"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>License Information</title> + </topic> diff --git a/sandbox/mallard/spec/mal_link.xml b/sandbox/mallard/spec/mal_link.xml index b65623e..10b887a 100644 --- a/sandbox/mallard/spec/mal_link.xml +++ b/sandbox/mallard/spec/mal_link.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_link"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Hyperlinks</title> + </topic> diff --git a/sandbox/mallard/spec/mal_list.xml b/sandbox/mallard/spec/mal_list.xml index e3a01f1..238334f 100644 --- a/sandbox/mallard/spec/mal_list.xml +++ b/sandbox/mallard/spec/mal_list.xml @@ -2,6 +2,7 @@ id="mal_list"> <info> <link type="guide" xref="mal_block#containers"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Lists</title> diff --git a/sandbox/mallard/spec/mal_list_bullet.xml b/sandbox/mallard/spec/mal_list_bullet.xml index 64b3fb2..ad49cb6 100644 --- a/sandbox/mallard/spec/mal_list_bullet.xml +++ b/sandbox/mallard/spec/mal_list_bullet.xml @@ -2,6 +2,7 @@ id="mal_list_bullet"> <info> <link type="guide" xref="mal_list"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Bullet Lists</title> diff --git a/sandbox/mallard/spec/mal_list_definition.xml b/sandbox/mallard/spec/mal_list_definition.xml index 11d692d..0bbe172 100644 --- a/sandbox/mallard/spec/mal_list_definition.xml +++ b/sandbox/mallard/spec/mal_list_definition.xml @@ -2,6 +2,7 @@ id="mal_list_definition"> <info> <link type="guide" xref="mal_list"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Definition Lists</title> diff --git a/sandbox/mallard/spec/mal_list_numbered.xml b/sandbox/mallard/spec/mal_list_numbered.xml index 593080c..a579cb5 100644 --- a/sandbox/mallard/spec/mal_list_numbered.xml +++ b/sandbox/mallard/spec/mal_list_numbered.xml @@ -2,6 +2,7 @@ id="mal_list_numbered"> <info> <link type="guide" xref="mal_list"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Numbered Lists</title> diff --git a/sandbox/mallard/spec/mal_list_tree.xml b/sandbox/mallard/spec/mal_list_tree.xml index 1ca9e9a..a4183b3 100644 --- a/sandbox/mallard/spec/mal_list_tree.xml +++ b/sandbox/mallard/spec/mal_list_tree.xml @@ -2,6 +2,7 @@ id="mal_list_tree"> <info> <link type="guide" xref="mal_list"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Tree Lists</title> diff --git a/sandbox/mallard/spec/mal_media.xml b/sandbox/mallard/spec/mal_media.xml index b65623e..5574170 100644 --- a/sandbox/mallard/spec/mal_media.xml +++ b/sandbox/mallard/spec/mal_media.xml @@ -1,2 +1,11 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_media"> +<info> + <link type="guide" xref="mal_inline"/> + <link type="guide" xref="mal_block"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Multimedia Objects</title> + </topic> diff --git a/sandbox/mallard/spec/mal_note.xml b/sandbox/mallard/spec/mal_note.xml index b65623e..6178ec7 100644 --- a/sandbox/mallard/spec/mal_note.xml +++ b/sandbox/mallard/spec/mal_note.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_note"> +<info> + <link type="guide" xref="mal_block#containers"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Notes</title> + </topic> diff --git a/sandbox/mallard/spec/mal_output.xml b/sandbox/mallard/spec/mal_output.xml index b65623e..0490e65 100644 --- a/sandbox/mallard/spec/mal_output.xml +++ b/sandbox/mallard/spec/mal_output.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_output"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Computer Output</title> + </topic> diff --git a/sandbox/mallard/spec/mal_p.xml b/sandbox/mallard/spec/mal_p.xml index 717e5b0..0e78284 100644 --- a/sandbox/mallard/spec/mal_p.xml +++ b/sandbox/mallard/spec/mal_p.xml @@ -2,6 +2,7 @@ id="mal_p"> <info> <link type="guide" xref="mal_block#simple"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Paragraphs</title> diff --git a/sandbox/mallard/spec/mal_quote.xml b/sandbox/mallard/spec/mal_quote.xml index cc04201..779c694 100644 --- a/sandbox/mallard/spec/mal_quote.xml +++ b/sandbox/mallard/spec/mal_quote.xml @@ -1,4 +1,16 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> -render quotes around inline -style="epipgraph" +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_quote"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Quotes</title> + +<comment> + <cite name="Shaun McCance" date="2007-02-21"/> + <p>render quotes around inline</p> + <p>style="epipgraph"</p> +</comment> + </topic> diff --git a/sandbox/mallard/spec/mal_screen.xml b/sandbox/mallard/spec/mal_screen.xml index c0ea56b..df7aaf9 100644 --- a/sandbox/mallard/spec/mal_screen.xml +++ b/sandbox/mallard/spec/mal_screen.xml @@ -1,7 +1,8 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard" - id="mal_block_code"> + id="mal_screen"> <info> <link type="guide" xref="mal_block#simple"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Screens</title> diff --git a/sandbox/mallard/spec/mal_section.xml b/sandbox/mallard/spec/mal_section.xml index b65623e..c8de58a 100644 --- a/sandbox/mallard/spec/mal_section.xml +++ b/sandbox/mallard/spec/mal_section.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_section"> +<info> + <link type="guide" xref="spec_pages" weight="-1"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>Sections</title> + </topic> diff --git a/sandbox/mallard/spec/mal_synopsis.xml b/sandbox/mallard/spec/mal_synopsis.xml index 184f4b2..301bb3e 100644 --- a/sandbox/mallard/spec/mal_synopsis.xml +++ b/sandbox/mallard/spec/mal_synopsis.xml @@ -2,6 +2,7 @@ id="mal_synopsis"> <info> <link type="guide" xref="mal_block#containers"/> + <version number="0.1" date="2007-02-21" status="incomplete"/> </info> <title>Synopses</title> diff --git a/sandbox/mallard/spec/mal_sys.xml b/sandbox/mallard/spec/mal_sys.xml index b65623e..75d4e12 100644 --- a/sandbox/mallard/spec/mal_sys.xml +++ b/sandbox/mallard/spec/mal_sys.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_sys"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>System Items</title> + </topic> diff --git a/sandbox/mallard/spec/mal_topic.xml b/sandbox/mallard/spec/mal_topic.xml index d5324ff..c2b3d83 100644 --- a/sandbox/mallard/spec/mal_topic.xml +++ b/sandbox/mallard/spec/mal_topic.xml @@ -1,6 +1,8 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_topic"> <info> + <link type="guide" xref="spec_pages"/> + <version number="0.1" date="2007-02-21" status="stub"/> </info> <title>Topic Pages</title> diff --git a/sandbox/mallard/spec/mal_var.xml b/sandbox/mallard/spec/mal_var.xml index b65623e..70ea31b 100644 --- a/sandbox/mallard/spec/mal_var.xml +++ b/sandbox/mallard/spec/mal_var.xml @@ -1,2 +1,10 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_var"> +<info> + <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Variable Text</title> + </topic> diff --git a/sandbox/mallard/spec/mal_version.xml b/sandbox/mallard/spec/mal_version.xml new file mode 100644 index 0000000..5368838 --- /dev/null +++ b/sandbox/mallard/spec/mal_version.xml @@ -0,0 +1,20 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_version"> +<info> + <link type="guide" xref="spec_info"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>Version Information</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_version = element version { + attribute number { text }, + attribute date { xsd:date }, + attribute status { "stub" | "incomplete" | "draft" | "review" | "final" }?, + <link xref="mal_title">mal_title</link>?, + <link xref="mal_desc">mal_desc</link>? +} +</code></synopsis> + +</topic> diff --git a/sandbox/mallard/spec/mallard.xml b/sandbox/mallard/spec/mallard.xml new file mode 100644 index 0000000..ed43e05 --- /dev/null +++ b/sandbox/mallard/spec/mallard.xml @@ -0,0 +1,18 @@ +<guide xmlns="http://www.gnome.org/~shaunm/mallard" + id="mallard"> +<info> + <link type="page" xref="10minutes"/> + <link type="page" xref="explore"/> + <link type="page" xref="principles"/> + <link type="page" xref="spec"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>Mallard</title> + +<comment> + <cite name="Shaun McCance" date="2007-02-20"/> + <p>Add some intro text</p> +</comment> + +</guide> diff --git a/sandbox/mallard/spec/principle-guide.xml b/sandbox/mallard/spec/principle-guide.xml new file mode 100644 index 0000000..2f45ad0 --- /dev/null +++ b/sandbox/mallard/spec/principle-guide.xml @@ -0,0 +1,11 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="principle-guide"> +<info> + <version number="0.1" date="2007-02-26" status="stub"/> + <link type="guide" xref="principles#reader"/> + <desc>Ensure the reader doesn't get lost in a link swarm</desc> +</info> + +<title>Guide the Reader</title> + +</topic> diff --git a/sandbox/mallard/spec/principle-justenough.xml b/sandbox/mallard/spec/principle-justenough.xml new file mode 100644 index 0000000..453eb07 --- /dev/null +++ b/sandbox/mallard/spec/principle-justenough.xml @@ -0,0 +1,12 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="principle-justenough"> +<info> + <version number="0.1" date="2007-02-26" status="stub"/> + <link type="guide" xref="principles#writer"/> + <link type="guide" xref="principles#hacker"/> + <desc>Provide just enough markup to mark up what's important</desc> +</info> + +<title>Just Enough Markup</title> + +</topic> diff --git a/sandbox/mallard/spec/principle-redundancy.xml b/sandbox/mallard/spec/principle-redundancy.xml new file mode 100644 index 0000000..43e85a7 --- /dev/null +++ b/sandbox/mallard/spec/principle-redundancy.xml @@ -0,0 +1,11 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="principle-redundancy"> +<info> + <version number="0.1" date="2007-02-26" status="stub"/> + <link type="guide" xref="principles#writer"/> + <desc>Avoid forcing writers to write the same thing twice</desc> +</info> + +<title>Reduce Redundancy</title> + +</topic> diff --git a/sandbox/mallard/spec/principles.xml b/sandbox/mallard/spec/principles.xml new file mode 100644 index 0000000..3ccf744 --- /dev/null +++ b/sandbox/mallard/spec/principles.xml @@ -0,0 +1,43 @@ +<guide xmlns="http://www.gnome.org/~shaunm/mallard" + id="principles"> +<info> + <version number="0.1" date="2007-02-21" status="stub"/> + <desc>The guiding principles behind the design of Mallard</desc> +</info> + +<title>Design Principles</title> + +<comment> + <cite name="Shaun McCance" date="2007-02-27"/> + <p>Add intro content</p> + <p>Add principles: pluggability, implementation speed, l10n</p> +</comment> + +<section id="reader"> + <info> + <title type="link">Principles for the Reader</title> + </info> + + <title>For the Reader</title> + + <p>Readers are the ultimate arbiters of the quality of a documentation + system. The best efforts of the writers and hackers are wasted if the + documention doesn't help the reader to find the information she needs + quickly. The needs of the reader trump all other requirements.</p> +</section> + +<section id="writer"> + <info> + <title type="link">Principles for the Writer</title> + </info> + <title>For the Writer</title> +</section> + +<section id="hacker"> + <info> + <title type="link">Principles for the Hacker</title> + </info> + <title>For the Hacker</title> +</section> + +</guide> diff --git a/sandbox/mallard/spec/spec.xml b/sandbox/mallard/spec/spec.xml new file mode 100644 index 0000000..e0e9c86 --- /dev/null +++ b/sandbox/mallard/spec/spec.xml @@ -0,0 +1,14 @@ +<guide xmlns="http://www.gnome.org/~shaunm/mallard" + id="spec"> +<info> + <version number="0.1" date="2007-02-21" status="stub"/> +</info> + +<title>Specification</title> + +<comment> + <cite name="Shaun McCance" date="2007-02-20"/> + <p>Add some intro text</p> +</comment> + +</guide> diff --git a/sandbox/mallard/spec/spec_info.xml b/sandbox/mallard/spec/spec_info.xml new file mode 100644 index 0000000..984bd44 --- /dev/null +++ b/sandbox/mallard/spec/spec_info.xml @@ -0,0 +1,10 @@ +<guide xmlns="http://www.gnome.org/~shaunm/mallard" + id="spec_info"> +<info> + <link type="guide" xref="spec" weight="-1"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>Information Elements</title> + +</guide> diff --git a/sandbox/mallard/spec/spec_pages.xml b/sandbox/mallard/spec/spec_pages.xml new file mode 100644 index 0000000..9caade9 --- /dev/null +++ b/sandbox/mallard/spec/spec_pages.xml @@ -0,0 +1,15 @@ +<guide xmlns="http://www.gnome.org/~shaunm/mallard" + id="spec_pages"> +<info> + <link type="guide" xref="spec" weight="1"/> + <version number="0.1" date="2007-02-22" status="stub"/> +</info> + +<title>Page Elements</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +default namespace = "http://www.gnome.org/~shaunm/mallard" +start = (mal_guide | mal_topic) +</code></synopsis> + +</guide> diff --git a/sandbox/mallard/xslt/mal-link.xsl b/sandbox/mallard/xslt/mal-link.xsl index 03e7c3c..c5c563f 100644 --- a/sandbox/mallard/xslt/mal-link.xsl +++ b/sandbox/mallard/xslt/mal-link.xsl @@ -17,6 +17,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:mal="http://www.gnome.org/~shaunm/mallard" version="1.0"> <!--!!========================================================================== @@ -33,7 +34,22 @@ $xref: FIXME <xsl:template name="mal.link.content"> <xsl:param name="node" select="."/> <xsl:param name="xref" select="$node/@xref"/> - <xsl:text>FIXME</xsl:text> + <xsl:variable name="linkid"> + <xsl:choose> + <xsl:when test="contains($xref, '#')"> + <xsl:value-of select="$xref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($xref, '#', $xref)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="$cache"> + <!-- FIXME: if empty --> + <xsl:apply-templates mode="mal2html.inline.mode" + select="key('cache_key', $linkid) + /mal:info/mal:title[@type = 'link']/node()"/> + </xsl:for-each> </xsl:template> diff --git a/sandbox/mallard/xslt/mal2cache.xsl b/sandbox/mallard/xslt/mal2cache.xsl index de156c4..81cb0ce 100644 --- a/sandbox/mallard/xslt/mal2cache.xsl +++ b/sandbox/mallard/xslt/mal2cache.xsl @@ -42,6 +42,12 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:attribute name="href"> <xsl:value-of select="$href"/> </xsl:attribute> + <xsl:if test="not(mal:info)"> + <xsl:call-template name="info"> + <xsl:with-param name="info" select="mal:info"/> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:if> <xsl:apply-templates/> </topic> </xsl:template> @@ -55,6 +61,12 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:attribute name="href"> <xsl:value-of select="$href"/> </xsl:attribute> + <xsl:if test="not(mal:info)"> + <xsl:call-template name="info"> + <xsl:with-param name="info" select="mal:info"/> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:if> <xsl:apply-templates/> </guide> </xsl:template> @@ -66,6 +78,13 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:value-of select="@id"/> </xsl:attribute> </xsl:if> + <xsl:if test="not(mal:info)"> + <xsl:call-template name="info"> + <xsl:with-param name="info" select="mal:info"/> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:if> + <xsl:apply-templates/> </section> </xsl:template> @@ -73,8 +92,38 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:copy-of select="."/> </xsl:template> -<xsl:template match="mal:info"> - <xsl:copy-of select="."/> +<xsl:template name="info" match="mal:info"> + <xsl:param name="info" select="."/> + <xsl:param name="node" select="$info/.."/> + <info> + <xsl:if test="not($info/mal:title[@type = 'link'])"> + <title type="link"> + <xsl:copy-of select="$node/mal:title/node()"/> + </title> + </xsl:if> + <xsl:if test="not($info/mal:title[@type = 'sort'])"> + <title type="sort"> + <xsl:choose> + <xsl:when test="$info/mal:title[@type = 'link']"> + <xsl:copy-of select="$info/mal:title[@type = 'link'][1]/node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$node/mal:title/node()"/> + </xsl:otherwise> + </xsl:choose> + </title> + </xsl:if> + <xsl:for-each select="$info/*"> + <xsl:choose> + <xsl:when test="self::mal:link[@type = 'guide' and not(@weight)]"> + <link type="guide" xref="{@xref}" weight="0"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </info> </xsl:template> <xsl:template match="node() | text()"/> diff --git a/sandbox/mallard/xslt/mal2html-block.xsl b/sandbox/mallard/xslt/mal2html-block.xsl index ac145bd..e5b8be9 100644 --- a/sandbox/mallard/xslt/mal2html-block.xsl +++ b/sandbox/mallard/xslt/mal2html-block.xsl @@ -36,40 +36,93 @@ REMARK: Describe this template --> <xsl:template name="mal2html.block.css"> <xsl:text> -h1 { color: #555753; font-size: 1.72em; margin: 0; } -h2 { color: #555753; font-size: 1.44em; margin: 0; border-bottom: solid 1px #aaaaaa; } -h3 { color: #555753; font-size: 1.2em; margin: 0; } -h4 { color: #555753; font-size: 1em; margin: 0 0; } -h5 { color: #555753; font-size: 1em; margin: 0 0; } -h6 { color: #555753; font-size: 1em; margin: 0 0; } -h7 { color: #555753; font-size: 1em; margin: 0 0; } -div.title { color: #555753; font-weight: bold; } +h1.title, h2.title, h3.title, h4.title, h5.title, h6.title, h7.title, div.title { + color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'text-light'"/> + </xsl:call-template> + <xsl:text>; + margin: 0; +} +h1.title, h2.title { + border-bottom: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-medium'"/> + </xsl:call-template> + <xsl:text>; +} +h1.title { font-size: 1.72em; } +h2.title { font-size: 1.44em; } +h3.title { font-size: 1.2em; } +h4.title { font-size: 1em; } +h5.title { font-size: 1em; } +h6.title { font-size: 1em; } +h7.title { font-size: 1em; } +div.title { font-weight: bold; } div.section { margin-top: 2em; clear: both; } div.section div.section { margin-top: 1.72em; margin-left: 1.72em; } div.section div.section div.section { margin-top: 1.44em; } pre.code { + <!-- FIXME: theme --> background: url(mallard-icon-code.png) no-repeat top right; - border: solid 2px #eeeeec; + border: solid 2px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-light'"/> + </xsl:call-template> + <xsl:text>; padding: 0.5em 1em 0.5em 1em; } div.comment { margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; - border: solid 2px #f08d8d; + border: solid 2px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'red-dark'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'red-light'"/> + </xsl:call-template> + <xsl:text>; } -div.comment div.cite { margin-top: 0; font-style: italic; } +div.comment div.cite { margin: 0; font-style: italic; } div.figure { - color: #2e3436; - background-color: #eeeeec; - border: solid 1px #888a85; + color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'text-light'"/> + </xsl:call-template> + <xsl:text>; + border: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-dark'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-medium'"/> + </xsl:call-template> + <xsl:text>; margin-left: 1.72em; padding: 4px; } div.figure-contents { - color: #000000; - background-color: #ffffff; - border: solid 1px #888a85; + color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'text'"/> + </xsl:call-template> + <xsl:text>; + border: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-dark'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'background'"/> + </xsl:call-template> + <xsl:text>; padding: 0.5em 1em 0.5em 1em; margin: 0; text-align: center; @@ -78,15 +131,18 @@ div.figure div.title { margin: 0 0 4px 0; } div.figure div.caption { margin: 4px 0 0 0; } div.synopsis { - color: #2e3436; -<!-- - background-color: #fffcd9; - border-top: solid 2px #a8a68f; - border-bottom: solid 2px #a8a68f; ---> - background-color: #eeeeec; - border-top: solid 2px #729fcf; - border-bottom: solid 2px #729fcf; + border-top: solid 2px; + border-bottom: solid 2px; + border-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'blue-dark'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-light'"/> + </xsl:call-template> + <xsl:text>; padding: 0.5em 1em 0.5em 1em; } div.synopsis pre.code { diff --git a/sandbox/mallard/xslt/mal2html-css.xsl b/sandbox/mallard/xslt/mal2html-css.xsl index c2091ca..144774e 100644 --- a/sandbox/mallard/xslt/mal2html-css.xsl +++ b/sandbox/mallard/xslt/mal2html-css.xsl @@ -84,25 +84,13 @@ by extension stylesheets to extend or override the CSS. <xsl:call-template name="mal2html.block.css"/> <xsl:call-template name="mal2html.inline.css"/> <xsl:call-template name="mal2html.list.css"/> + <xsl:call-template name="mal2html.page.css"/> <xsl:call-template name="mal2html.table.css"/> <xsl:text> -html { height: 100%; } -body { - margin: 0px; - direction: </xsl:text><xsl:call-template name="l10n.direction"/><xsl:text>; - background-color: #eeeeec; - padding: 12px; - min-height: 100%; -} -div.body { - margin: 0; - padding: 12px; - border: solid 1px #babdb6; - max-width: 60em; - background-color: #ffffff; -} div, pre, p { margin: 1em 0 0 0; padding: 0; } .first-child { margin-top: 0; } +a { text-decoration: none; } +a:hover { text-decoration: underline; } </xsl:text> <xsl:call-template name="mal2html.css.custom"/> </xsl:template> diff --git a/sandbox/mallard/xslt/mal2html-list.xsl b/sandbox/mallard/xslt/mal2html-list.xsl new file mode 100644 index 0000000..23207da --- /dev/null +++ b/sandbox/mallard/xslt/mal2html-list.xsl @@ -0,0 +1,90 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<!-- +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; see the file COPYING.LGPL. If not, write to the +Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:mal="http://www.gnome.org/~shaunm/mallard" + xmlns="http://www.w3.org/1999/xhtml" + version="1.0"> + +<!--!!========================================================================== +Mallard to HTML - List Elements + +REMARK: Describe this module +--> + + +<!--**========================================================================== +mal2html.list.css +Outputs CSS that controls the appearance of lists + +REMARK: Describe this template +--> +<xsl:template name="mal2html.list.css"> +<xsl:text> +ul.list-tree { + margin: 0; padding: 0; + list-style-type: none; +} +ul.list-tree li { + margin: 0; padding: 0; +} +ul.list-tree li p { + margin: 0; padding: 0; +} +ul.list-tree ul.list-tree { + margin-left: 1.44em; +} +ul.list-tree ul.list-tree li { + margin-top: 0.69em; +} +</xsl:text> +</xsl:template> + + +<!-- == Bullet Lists == --> + +<!-- == Numbered Lists == --> + +<!-- == Definition Lists == --> + +<!-- == Tree Lists == --> + +<xsl:template mode="mal2html.block.mode" match="mal:list[@type='tree']"> + <div class="list list-tree"> + <ul class="list list-tree"> + <xsl:apply-templates mode="mal2html.list.tree.mode"/> + </ul> + </div> +</xsl:template> + +<xsl:template mode="mal2html.list.tree.mode" match="mal:item"> + <li> + <p> + <xsl:apply-templates mode="mal2html.inline.mode" + select="*[not(self::mal:item)]"/> + </p> + </li> + <xsl:if test="mal:item"> + <ul class="list list-tree"> + <xsl:apply-templates mode="mal2html.list.tree.mode" + select="mal:item"/> + </ul> + </xsl:if> +</xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-page.xsl b/sandbox/mallard/xslt/mal2html-page.xsl new file mode 100644 index 0000000..c1b5b41 --- /dev/null +++ b/sandbox/mallard/xslt/mal2html-page.xsl @@ -0,0 +1,597 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<!-- +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; see the file COPYING.LGPL. If not, write to the +Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:mal="http://www.gnome.org/~shaunm/mallard" + xmlns="http://www.w3.org/1999/xhtml" + version="1.0"> + +<!--!!========================================================================== +Mallard to HTML - Pages + +REMARK: Describe this module +--> + + +<!--**========================================================================== +mal2html.page.copyright +Outputs the copyright notice at the bottom of a page +$node: The top-level #{topic} or #{guide} element + +REMARK: Describe this template +--> +<xsl:template name="db2html.page.copyrights"> + <xsl:param name="node"/> + <div class="copyrights"> + <xsl:for-each select="$node/mal:info/mal:copyright"> + <div class="copyright"> + <!-- FIXME: i18n --> + <xsl:value-of select="concat('© ', @year, ' ', @name)"/> + </div> + </xsl:for-each> + </div> +</xsl:template> + + +<!--**========================================================================== +mal2html.page.guidelinks +Outputs the automatic links from a page to guide pages and sections +$node: The #{topic}, #{guide}, or #{section} element containing the links + +REMARK: Describe this template +--> +<xsl:template name="mal2html.page.guidelinks"> + <xsl:param name="node" select="."/> + <xsl:variable name="id"> + <xsl:choose> + <xsl:when test="$node/self::mal:section"> + <xsl:value-of select="concat(ancestor::mal:topic[1]/@id, '#', @id)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@id"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <!-- FIXME: // is slow --> + <xsl:variable name="pagelinks" + select="$cache//*[mal:info/mal:link[@type = 'page'][@xref = $id]]"/> + <xsl:variable name="guidelinks" + select="mal:info/mal:link[@type = 'guide']"/> + <xsl:if test="$pagelinks or $guidelinks"> + <div class="guidelinks"> + <!-- FIXME: i18n and text sucks --> + <div class="title">More About</div> + <xsl:for-each select="$pagelinks"> + <xsl:variable name="position"> + <xsl:choose> + <xsl:when test="last() = 1 and count($guidelinks) = 0"> + <xsl:text>only</xsl:text> + </xsl:when> + <xsl:when test="position() = 1"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test="position() = last() and count($guidelinks) = 0"> + <xsl:text>last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:call-template name="mal2html.page.guidelink"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="page" select="."/> + <xsl:with-param name="position" select="$position"/> + </xsl:call-template> + </xsl:for-each> + <!-- FIXME: exclude pagelinks --> + <xsl:for-each select="$guidelinks"> + <xsl:variable name="linkid"> + <xsl:choose> + <xsl:when test="contains(@xref, '#')"> + <xsl:value-of select="@xref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat(@xref, '#', @xref)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="position"> + <xsl:choose> + <xsl:when test="last() = 1 and count($pagelinks) = 0"> + <xsl:text>only</xsl:text> + </xsl:when> + <xsl:when test="position() = 1 and count($pagelinks) = 0"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test="position() = last()"> + <xsl:text>last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="$cache"> + <xsl:call-template name="mal2html.page.guidelink"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="page" select="key('cache_key', $linkid)"/> + <xsl:with-param name="position" select="$position"/> + </xsl:call-template> + </xsl:for-each> + </xsl:for-each> + </div> + </xsl:if> + <!-- END guidelinks --> +</xsl:template> + + +<!--**========================================================================== +mal2html.page.guidelink +Outputs an automatic link block from a page or section to a guide +$node: The #{topic}, #{guide}, or #{section} element containing the link +$page: The element from the cache file of the page being linked to +$position: The position of this link in the list, either 'first', 'last', or '' + +REMARK: Describe this template +--> +<xsl:template name="mal2html.page.guidelink"> + <xsl:param name="node" select="."/> + <xsl:param name="page"/> + <xsl:param name="position"/> + <xsl:variable name="xref"> + <xsl:choose> + <xsl:when test="$page/self::mal:section"> + <xsl:value-of select="($page/ancestor::mal:guide | $page/ancestor::mal:topic)[1]/@id"/> + <xsl:text>#</xsl:text> + <xsl:value-of select="$page/@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$page/@id"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <div> + <xsl:attribute name="class"> + <xsl:text>guidelink</xsl:text> + <xsl:choose> + <xsl:when test="$position = 'only'"> + <xsl:text> guidelink-only</xsl:text> + </xsl:when> + <xsl:when test="$position = 'first'"> + <xsl:text> guidelink-first</xsl:text> + </xsl:when> + <xsl:when test="$position = 'last'"> + <xsl:text> guidelink-last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:attribute> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="mal.link.target"> + <xsl:with-param name="xref" select="$xref"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="mal.link.content"> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="xref" select="$xref"/> + </xsl:call-template> + </a> + </div> +</xsl:template> + + +<!--**========================================================================== +mal2html.page.pagelinks +Outputs the automatic links from a guide page or guide section +$node: The #{guide} or #{section} element containing the links + +REMARK: Describe this template +--> +<xsl:template name="mal2html.page.pagelinks"> + <xsl:param name="node" select="."/> + <xsl:variable name="id"> + <xsl:choose> + <xsl:when test="$node/self::mal:section"> + <xsl:value-of select="concat(ancestor::mal:guide[1]/@id, '#', @id)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@id"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="pagelinks" + select="$node/mal:info/mal:link[@type = 'page']"/> + <!-- FIXME: // selectors are slow --> + <!-- FIXME: exclude $pagelinks from $guidelinks --> + <xsl:variable name="guidelinks" + select="$cache//*[mal:info/mal:link[@type = 'guide'][@xref = $id]]"/> + <xsl:if test="$pagelinks or $guidelinks"> + <div class="pagelinks"> + <xsl:for-each select="$pagelinks"> + <xsl:variable name="linkid"> + <xsl:choose> + <xsl:when test="contains(@xref, '#')"> + <xsl:value-of select="@xref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat(@xref, '#', @xref)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="position"> + <xsl:choose> + <xsl:when test="last() = 1 and count($guidelinks) = 0"> + <xsl:text>only</xsl:text> + </xsl:when> + <xsl:when test="position() = 1"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test="position() = last() and count($guidelinks) = 0"> + <xsl:text>last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="$cache"> + <xsl:call-template name="mal2html.page.pagelink"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="page" select="key('cache_key', $linkid)"/> + <xsl:with-param name="position" select="$position"/> + </xsl:call-template> + </xsl:for-each> + </xsl:for-each> + <xsl:for-each select="$guidelinks"> + <xsl:sort select="mal:info/mal:link[@type = 'guide'][@xref = $id]/@weight" + data-type="number" order="descending"/> + <!-- FIXME: lang --> + <xsl:sort select="mal:info/mal:title[@type = 'sort']" + data-type="text" order="ascending"/> + <xsl:call-template name="mal2html.page.pagelink"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="page" select="."/> + <xsl:with-param name="position"> + <xsl:choose> + <xsl:when test="last() = 1 and count($pagelinks) = 0"> + <xsl:text>only</xsl:text> + </xsl:when> + <xsl:when test="position() = 1 and count($pagelinks) = 0"> + <xsl:text>first</xsl:text> + </xsl:when> + <xsl:when test="position() = last()"> + <xsl:text>last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:for-each> + </div> + </xsl:if> +</xsl:template> + + +<!--**========================================================================== +mal2html.page.pagelink +Outputs an automatic link block from a guide to a page +$node: The #{guide} or #{section} element containing the link +$page: The element from the cache file of the page being linked to +$position: The position of this link in the list, either 'first', 'last', or '' + +REMARK: Describe this template +--> +<xsl:template name="mal2html.page.pagelink"> + <xsl:param name="node" select="."/> + <xsl:param name="page"/> + <xsl:param name="position"/> + <xsl:variable name="xref"> + <xsl:choose> + <xsl:when test="$page/self::mal:section"> + <xsl:value-of select="($page/ancestor::mal:guide | $page/ancestor::mal:topic)[1]/@id"/> + <xsl:text>#</xsl:text> + <xsl:value-of select="$page/@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$page/@id"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="linkid"> + <xsl:choose> + <xsl:when test="contains($xref, '#')"> + <xsl:value-of select="$xref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($xref, '#', $xref)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <div> + <xsl:attribute name="class"> + <xsl:text>pagelink</xsl:text> + <xsl:choose> + <xsl:when test="$position = 'only'"> + <xsl:text> pagelink-only</xsl:text> + </xsl:when> + <xsl:when test="$position = 'first'"> + <xsl:text> pagelink-first</xsl:text> + </xsl:when> + <xsl:when test="$position = 'last'"> + <xsl:text> pagelink-last</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:attribute> + <!-- FIXME: call a common linkifier? --> + <div class="title"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="mal.link.target"> + <xsl:with-param name="xref" select="$xref"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="mal.link.content"> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="xref" select="$xref"/> + </xsl:call-template> + </a> + </div> + <xsl:for-each select="$cache"> + <xsl:variable name="desc" + select="key('cache_key', $linkid)/mal:info/mal:desc[1]"/> + <xsl:if test="$desc"> + <div class="desc"> + <!-- FIXME: should desc contain inline or block? --> + <xsl:apply-templates mode="mal2html.inline.mode" select="$desc/node()"/> + </div> + </xsl:if> + </xsl:for-each> + </div> +</xsl:template> + + +<!--**========================================================================== +mal2html.page.css +Outputs CSS that controls the appearance of page elements + +REMARK: Describe this template +--> +<xsl:template name="mal2html.page.css"> +<xsl:text> +html { height: 100%; } +body { + margin: 0px; + direction: </xsl:text><xsl:call-template name="l10n.direction"/><xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-light'"/> + </xsl:call-template> + <xsl:text>; + padding: 12px; + min-height: 100%; +} +<!-- FIXME: only in editor mode & better colors --> +<!-- +body.status-stub { background-color: #ffedc9; } +body.status-draft { background-color: #ffedc9; } +body.status-incomplete { background-color: #ffedc9; } +body.status-review { background-color: #ffedc9; } +--> +div.version { + margin: 0 0 1em 0; + padding: 0.5em 1em 0.5em 1em; + max-width: 60em; + border: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-dark'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'yellow-light'"/> + </xsl:call-template> + <xsl:text>; +} +div.version p.version { + margin-top: 0.2em; +} +div.body { + margin: 0; + padding: 1em; + max-width: 60em; + min-height: 20em; + border: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-medium'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'background'"/> + </xsl:call-template> + <xsl:text>; +} +div.copyrights { + text-align: center; + color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'text-light'"/> + </xsl:call-template> + <xsl:text>; +} +div.pagelinks { + margin-left: 1em; +} +div.pagelink-first, div.pagelink-only { + margin-top: 0; +} +div.pagelink div.title { + font-size: 1em; +} +div.pagelink div.desc { + margin-top: 0.2em; + color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'text-light'"/> + </xsl:call-template> + <xsl:text>; +} +div.guidelinks { + float: right; + width: 10em; + margin-top: -1px; + padding: 0.5em 1em 0.5em 0.5em; + border: solid 1px </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-medium'"/> + </xsl:call-template> + <xsl:text>; + background-color: </xsl:text> + <xsl:call-template name="theme.get_color"> + <xsl:with-param name="id" select="'gray-light'"/> + </xsl:call-template> + <xsl:text>; +} +div.guidelinks div.title { + font-size: 1em; +} +div.guidelink { + margin: 0; +} +</xsl:text> +</xsl:template> + + +<!-- == Matched Templates == --> + +<!-- = / = --> +<xsl:template match="/"> + <!-- FIXME: find a way to just select the version element --> + <xsl:variable name="date"> + <xsl:for-each select="*/mal:info/mal:version"> + <xsl:sort select="@date" data-type="text" order="descending"/> + <xsl:if test="position() = 1"> + <xsl:value-of select="@date"/> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="version" + select="*/mal:info/mal:version[@date = $date][last()]"/> + <html> + <head> + <title> + <xsl:value-of select="/*/mal:title"/> + </title> + <xsl:call-template name="mal2html.css"/> + </head> + <body> + <!-- FIXME: only in editor mode --> + <xsl:if test="$version/@status != ''"> + <xsl:attribute name="class"> + <xsl:value-of select="concat(' status-', $version/@status)"/> + </xsl:attribute> + <div class="version"> + <!-- FIXME: i18n --> + <div class="title">Version Information</div> + <p class="version"> + <xsl:text>Version </xsl:text> + <xsl:value-of select="$version/@number"/> + <xsl:text> on </xsl:text> + <xsl:value-of select="$version/@date"/> + <xsl:text> (</xsl:text> + <xsl:choose> + <xsl:when test="$version/@status = 'stub'"> + <xsl:text>Stub</xsl:text> + </xsl:when> + <xsl:when test="$version/@status = 'incomplete'"> + <xsl:text>Incomplete</xsl:text> + </xsl:when> + <xsl:when test="$version/@status = 'draft'"> + <xsl:text>Draft</xsl:text> + </xsl:when> + <xsl:when test="$version/@status = 'review'"> + <xsl:text>Ready for review</xsl:text> + </xsl:when> + <xsl:when test="$version/@status = 'final'"> + <xsl:text>Final</xsl:text> + </xsl:when> + </xsl:choose> + <xsl:text>)</xsl:text> + </p> + <xsl:apply-templates mode="mal2html.block.mode" select="$version/*"/> + </div> + </xsl:if> + <div class="body"> + <xsl:apply-templates/> + </div> + <xsl:call-template name="db2html.page.copyrights"> + <xsl:with-param name="node" select="mal:topic | mal:guide"/> + </xsl:call-template> + </body> + </html> +</xsl:template> + +<!-- = guide = --> +<xsl:template match="mal:guide"> + <xsl:apply-templates mode="mal2html.block.mode" + select="mal:title | mal:subtitle"/> + <xsl:call-template name="mal2html.page.guidelinks"/> + <div class="contents"> + <xsl:apply-templates + mode="mal2html.block.mode" + select="*[not(self::mal:section | self::mal:title | self::mal:subtitle)]"/> + <xsl:call-template name="mal2html.page.pagelinks"/> + </div> + <xsl:apply-templates select="mal:section"/> +</xsl:template> + +<!-- = topic = --> +<xsl:template match="mal:topic"> + <xsl:apply-templates mode="mal2html.block.mode" + select="mal:title | mal:subtitle"/> + <xsl:call-template name="mal2html.page.guidelinks"/> + <div class="contents"> + <xsl:apply-templates + mode="mal2html.block.mode" + select="*[not(self::mal:section | self::mal:title | self::mal:subtitle)]"/> + </div> + <xsl:apply-templates select="mal:section"/> +</xsl:template> + +<!-- = section = --> +<xsl:template match="mal:section"> + <div class="section" id="{@id}"> + <xsl:apply-templates mode="mal2html.block.mode" + select="mal:title | mal:subtitle"/> + <xsl:call-template name="mal2html.page.guidelinks"/> + <div class="contents"> + <xsl:apply-templates + mode="mal2html.block.mode" + select="*[not(self::mal:section | self::mal:title | self::mal:subtitle)]"/> + <xsl:if test="ancestor::mal:guide"> + <xsl:call-template name="mal2html.page.pagelinks"/> + </xsl:if> + </div> + <xsl:apply-templates select="mal:section"/> + </div> +</xsl:template> + +<!-- = title = --> +<xsl:template mode="mal2html.block.mode" match="mal:title"> + <xsl:variable name="depth" + select="count(ancestor::mal:section) + 1"/> + <xsl:element name="{concat('h', $depth)}"> + <xsl:attribute name="class"> + <xsl:text>title</xsl:text> + </xsl:attribute> + <xsl:apply-templates mode="mal2html.inline.mode"/> + </xsl:element> +</xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html-table.xsl b/sandbox/mallard/xslt/mal2html-table.xsl new file mode 100644 index 0000000..3598f6e --- /dev/null +++ b/sandbox/mallard/xslt/mal2html-table.xsl @@ -0,0 +1,407 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<!-- +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; see the file COPYING.LGPL. If not, write to the +Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:mal="http://www.gnome.org/~shaunm/mallard" + xmlns:str="http://exslt.org/strings" + xmlns="http://www.w3.org/1999/xhtml" + extension-element-prefixes="str" + version="1.0"> + +<!--!!========================================================================== +Mallard to HTML - Table Elements + +REMARK: Describe this module +--> + + +<!--**========================================================================== +mal2html.table.css +Outputs CSS that controls the appearance of tables + +REMARK: Describe this template +--> +<xsl:template name="mal2html.table.css"> +<xsl:text> +table.table { + border-collapse: collapse; + border-color: #555753; + border-width: 1px; +} +td { + padding: 0.5em; + border-color: #888a85; + border-width: 1px; +} +</xsl:text> +</xsl:template> + + +<!-- == Matched Templates == --> + +<!-- = table = --> +<xsl:template mode="mal2html.block.mode" match="mal:table"> + <xsl:variable name="cols" select="mal:col | mal:colgroup/mal:col"/> + <xsl:variable name="style"> + <xsl:if test="@frame and @frame != 'none'"> + <xsl:choose> + <xsl:when test="@frame = 'all'"> + <xsl:text>border-style: solid;</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="str:split(@frame)"> + <xsl:choose> + <xsl:when test=". = 'top'"> + <xsl:text>border-top-style: solid;</xsl:text> + </xsl:when> + <xsl:when test=". = 'bottom'"> + <xsl:text>border-bottom-style: solid;</xsl:text> + </xsl:when> + <xsl:when test=". = 'left'"> + <xsl:text>border-left-style: solid;</xsl:text> + </xsl:when> + <xsl:when test=". = 'right'"> + <xsl:text>border-right-style: solid;</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:variable> + <xsl:variable name="rowrules"> + <xsl:choose> + <xsl:when test="not(@rules) or @rules = 'none'"> + <xsl:text>none</xsl:text> + </xsl:when> + <xsl:when test="@rules = 'all'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test="@rules = 'groups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="str:split(@rules)"> + <xsl:choose> + <xsl:when test=". = 'rows'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test=". = 'rowgroups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="colrules"> + <xsl:choose> + <xsl:when test="not(@rules) or @rules = 'none'"> + <xsl:text>none</xsl:text> + </xsl:when> + <xsl:when test="@rules = 'all'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test="@rules = 'groups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="str:split(@rules)"> + <xsl:choose> + <xsl:when test=". = 'cols'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test=". = 'colgroups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="rowshade"> + <xsl:choose> + <xsl:when test="not(@shade) or @shade = 'none'"> + <xsl:text>none</xsl:text> + </xsl:when> + <xsl:when test="@shade = 'all'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test="@shade = 'groups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="str:split(@shade)"> + <xsl:choose> + <xsl:when test=". = 'rows'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test=". = 'rowgroups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="colshade"> + <xsl:choose> + <xsl:when test="not(@shade) or @shade = 'none'"> + <xsl:text>none</xsl:text> + </xsl:when> + <xsl:when test="@shade = 'all'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test="@shade = 'groups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="str:split(@shade)"> + <xsl:choose> + <xsl:when test=". = 'cols'"> + <xsl:text>all</xsl:text> + </xsl:when> + <xsl:when test=". = 'colgroups'"> + <xsl:text>groups</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <div class="table"> + <table class="table"> + <xsl:if test="$style != ''"> + <xsl:attribute name="style"> + <xsl:value-of select="$style"/> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates select="mal:thead"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + <xsl:apply-templates select="mal:tfoot"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + <xsl:apply-templates select="mal:tr | mal:tbody"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + </table> + </div> +</xsl:template> + +<!-- = tbody = --> +<xsl:template match="mal:tbody"> + <xsl:param name="cols"/> + <xsl:param name="rowrules"/> + <xsl:param name="colrules"/> + <xsl:param name="rowshade"/> + <xsl:param name="colshade"/> + <tbody> + <xsl:apply-templates select="mal:tr"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + </tbody> +</xsl:template> + +<!-- = thead = --> +<xsl:template match="mal:thead"> + <xsl:param name="cols"/> + <xsl:param name="rowrules"/> + <xsl:param name="colrules"/> + <xsl:param name="rowshade"/> + <xsl:param name="colshade"/> + <thead> + <xsl:apply-templates select="mal:tr"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + </thead> +</xsl:template> + +<!-- = tfoot = --> +<xsl:template match="mal:tfoot"> + <xsl:param name="cols"/> + <xsl:param name="rowrules"/> + <xsl:param name="colrules"/> + <xsl:param name="rowshade"/> + <xsl:param name="colshade"/> + <tfoot> + <xsl:apply-templates select="mal:tr"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + </tfoot> +</xsl:template> + +<!-- = tr = --> +<xsl:template match="mal:tr"> + <xsl:param name="cols"/> + <xsl:param name="rowrules"/> + <xsl:param name="colrules"/> + <xsl:param name="rowshade"/> + <xsl:param name="colshade"/> + <tr> + <xsl:apply-templates select="mal:td"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rowrules" select="$rowrules"/> + <xsl:with-param name="colrules" select="$colrules"/> + <xsl:with-param name="rowshade" select="$rowshade"/> + <xsl:with-param name="colshade" select="$colshade"/> + </xsl:apply-templates> + </tr> +</xsl:template> + +<!-- = td = --> +<xsl:template match="mal:td"> + <xsl:param name="cols"/> + <xsl:param name="rowrules"/> + <xsl:param name="colrules"/> + <xsl:param name="rowshade"/> + <xsl:param name="colshade"/> + <xsl:variable name="trpos" select="count(../preceding-sibling::mal:tr) + 1"/> + <xsl:variable name="tdpos" select="count(preceding-sibling::mal:td) + 1"/> + <!-- FIXME: this all breaks with rowspan/colspan --> + <xsl:variable name="shaderow"> + <xsl:choose> + <xsl:when test="$rowshade = 'all'"> + <xsl:choose> + <xsl:when test="../../self::mal:table"> + <xsl:value-of select="($trpos + 1) mod 2"/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="bodies" + select="../../preceding-sibling::mal:tbody | + ../../preceding-sibling::mal:thead "/> + <xsl:variable name="trcount" select="count($bodies/mal:tr) + $trpos"/> + <xsl:value-of select="($trcount + 1) mod 2"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$rowshade = 'groups'"> + <xsl:variable name="bodies" + select="../../preceding-sibling::mal:tbody | + ../../preceding-sibling::mal:thead "/> + <xsl:value-of select="count($bodies) mod 2"/> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:variable name="shadecol"> + <xsl:choose> + <xsl:when test="$colshade = 'all'"> + <xsl:value-of select="($tdpos + 1) mod 2"/> + </xsl:when> + <xsl:when test="$colshade = 'groups'"> + <xsl:if test="count($cols) >= $tdpos"> + <xsl:variable name="col" select="$cols[$tdpos]"/> + <xsl:if test="$col/../self::mal:colgroup"> + <xsl:value-of + select="count($col/../preceding-sibling::mal:colgroup) mod 2"/> + </xsl:if> + </xsl:if> + <!-- FIXME --> + </xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:variable name="style"> + <xsl:choose> + <xsl:when test="$rowrules = 'all'"> + <xsl:choose> + <xsl:when test="../../self::mal:table"> + <xsl:if test="$trpos != 1"> + <xsl:text>border-top-style: solid;</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="$trpos != 1 or + ../../preceding-sibling::mal:thead or + ../../preceding-sibling::mal:tbody "> + <xsl:text>border-top-style: solid;</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:when> + <xsl:when test="$rowrules = 'groups'"> + <xsl:if test="$trpos = 1"> + <xsl:choose> + <xsl:when test="../../self::mal:tbody"> + <xsl:if test="../../../mal:thead | ../../preceding-sibling::mal:tbody"> + <xsl:text>border-top-style: solid;</xsl:text> + </xsl:if> + </xsl:when> + <xsl:when test="../../self::mal:tfoot"> + <xsl:text>border-top-style: solid;</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:if> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="$tdpos = 1"/> + <xsl:when test="$colrules = 'all'"> + <xsl:text>border-left-style: solid;</xsl:text> + </xsl:when> + <xsl:when test="$colrules = 'groups'"> + <xsl:if test="count($cols) >= $tdpos"> + <xsl:variable name="col" select="$cols[$tdpos]"/> + <xsl:if test="$col/../self::mal:colgroup and + not($col/preceding-sibling::mal:col)"> + <xsl:text>border-left-style: solid;</xsl:text> + </xsl:if> + </xsl:if> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="$shaderow = 1 and $shadecol = 1"> + <xsl:text>background-color: #d3d7cf;</xsl:text> + </xsl:when> + <xsl:when test="$shaderow = 1 or $shadecol = 1"> + <xsl:text>background-color: #eeeeec;</xsl:text> + </xsl:when> + </xsl:choose> + </xsl:variable> + <td> + <xsl:if test="$style != ''"> + <xsl:attribute name="style"> + <xsl:value-of select="$style"/> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates mode="mal2html.block.mode"/> + </td> +</xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html.xsl b/sandbox/mallard/xslt/mal2html.xsl index 6636c10..bdfb4a6 100644 --- a/sandbox/mallard/xslt/mal2html.xsl +++ b/sandbox/mallard/xslt/mal2html.xsl @@ -34,8 +34,10 @@ REMARK: Describe this module <xsl:include href="mal2html-inline.xsl"/> <xsl:include href="mal2html-list.xsl"/> <xsl:include href="mal2html-media.xsl"/> +<xsl:include href="mal2html-page.xsl"/> <xsl:include href="mal2html-table.xsl"/> +<xsl:include href="theme.xsl"/> <xsl:include href="util.xsl"/> <xsl:param name="mal.extension" select="'.xhtml'"/> @@ -46,76 +48,7 @@ REMARK: Describe this module (ancestor-or-self::mal:guide | ancestor-or-self::mal:topic)[last()]/@id, '#', @id)"/> -<xsl:template match="/"> - <html> - <head> - <title> - <xsl:value-of select="/*/mal:title"/> - </title> - <xsl:call-template name="mal2html.css"/> - </head> - <body> - <div class="body"> - <xsl:apply-templates/> - </div> - </body> - </html> -</xsl:template> - -<!-- = guide = --> -<xsl:template match="mal:guide"> - <xsl:apply-templates mode="mal2html.block.mode" - select="*[not(self::mal:section)]"/> - <xsl:for-each select="mal:info/mal:link[@type = 'page']"> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="contains(@xref, '#')"> - <xsl:value-of select="@xref"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(@xref, '#', @xref)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <div> - <xsl:for-each select="$cache/mal:cache"> - <xsl:apply-templates select="key('cache_key', $id)/mal:title/node()"/> - </xsl:for-each> - </div> - </xsl:for-each> - <xsl:variable name="id" select="@id"/> - <xsl:for-each select="$cache/*/*[mal:info/mal:link[@type = 'guide'][@xref = $id]]"> - <div> - <xsl:apply-templates select="mal:title/node()"/> - </div> - </xsl:for-each> - <xsl:apply-templates select="mal:section"/> -</xsl:template> - -<!-- = topic = --> -<xsl:template match="mal:topic"> - <xsl:apply-templates mode="mal2html.block.mode" - select="*[not(self::mal:section)]"/> - <xsl:apply-templates select="mal:section"/> -</xsl:template> - -<!-- = section = --> -<xsl:template match="mal:section"> - <div class="section" id="{@id}"> - <xsl:apply-templates mode="mal2html.block.mode"/> - </div> -</xsl:template> - -<!-- = title = --> -<xsl:template mode="mal2html.block.mode" match="mal:title"> - <xsl:variable name="depth" - select="count(ancestor::mal:section) + 1"/> - <xsl:element name="{concat('h', $depth)}"> - <xsl:apply-templates mode="mal2html.inline.mode"/> - </xsl:element> -</xsl:template> - - +<!-- FIXME --> <xsl:template match="*"> <xsl:message> <xsl:text>Unmatched element: </xsl:text> diff --git a/sandbox/mallard/xslt/theme.xml b/sandbox/mallard/xslt/theme.xml new file mode 100644 index 0000000..1ace77d --- /dev/null +++ b/sandbox/mallard/xslt/theme.xml @@ -0,0 +1,49 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<theme xmlns="http://www.gnome.org/~shaunm/gnome-doc-utils/theme"> + + <color id="background" value="#ffffff"/> + <color id="link" value="#1f5b99"/> + <color id="link-visited" value="#991f73"/> + <color id="text" value="#000000"/> + <color id="text-light" value="#4f4f4f"/> + + <color id="blue-light" value="#edf4fa"/> + <color id="blue-medium" value="#bbdbfa"/> + <color id="blue-dark" value="#96c7fa"/> + + <color id="gray-light" value="#f7f7f5"/> + <color id="gray-medium" value="#e0e0df"/> + <color id="gray-dark" value="#cfcfcd"/> + + <color id="red-light" value="#faeded"/> + <color id="red-medium" value="#fac8c8"/> + <color id="red-dark" value="#faa2a2"/> + + <color id="yellow-light" value="#faf8ed"/> + <color id="yellow-medium" value="#f1f2c8"/> + <color id="yellow-dark" value="#fae57d"/> + + <!-- notes/admonitions --> + <icon id="bug" width="48" height="48" src=""/> + <icon id="caution" width="48" height="48" src=""/> + <icon id="important" width="48" height="48" src=""/> + <icon id="note" width="48" height="48" src=""/> + <icon id="tip" width="48" height="48" src=""/> + <icon id="warning" width="48" height="48" src=""/> + + <!-- status information --> + <icon id="status-stub" width="16" height="16" src=""/> + <icon id="status-draft" width="16" height="16" src=""/> + <icon id="status-incomplete" width="16" height="16" src=""/> + <icon id="status-review" width="16" height="16" src=""/> + + <!-- watermarks --> + <icon id="watermark-code" src=""/> + <icon id="watermark-quote-00AB" src=""/> + <icon id="watermark-quote-00BB" src=""/> + <icon id="watermark-quote-201C" src=""/> + <icon id="watermark-quote-201D" src=""/> + <icon id="watermark-quote-201E" src=""/> + <icon id="waterkmark-screen" src=""/> + +</theme> diff --git a/sandbox/mallard/xslt/theme.xsl b/sandbox/mallard/xslt/theme.xsl new file mode 100644 index 0000000..53adf26 --- /dev/null +++ b/sandbox/mallard/xslt/theme.xsl @@ -0,0 +1,78 @@ +<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> +<!-- +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2 of the License, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; see the file COPYING.LGPL. If not, write to the +Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:theme="http://www.gnome.org/~shaunm/gnome-doc-utils/theme" + version="1.0"> + +<!--!!========================================================================== +Themes + +REMARK: Describe this module +--> + + +<xsl:variable name="theme" select="document('theme.xml')"/> + +<xsl:key name="theme_key" match="*[@id]" use="@id"/> + + +<!--**========================================================================== +theme.get_color +--> +<xsl:template name="theme.get_color"> + <xsl:param name="id"/> + <xsl:for-each select="$theme"> + <xsl:value-of select="key('theme_key', $id)/@value"/> + </xsl:for-each> +</xsl:template> + + +<!--**========================================================================== +theme.get_icon_src +--> +<xsl:template name="theme.get_icon_src"> + <xsl:param name="id"/> + <xsl:for-each select="$theme"> + <xsl:value-of select="key('theme_key', $id)/@src"/> + </xsl:for-each> +</xsl:template> + + +<!--**========================================================================== +theme.get_icon_width +--> +<xsl:template name="theme.get_icon_width"> + <xsl:param name="id"/> + <xsl:for-each select="$theme"> + <xsl:value-of select="key('theme_key', $id)/@width"/> + </xsl:for-each> +</xsl:template> + + +<!--**========================================================================== +theme.get_icon_height +--> +<xsl:template name="theme.get_height"> + <xsl:param name="id"/> + <xsl:for-each select="$theme"> + <xsl:value-of select="key('theme_key', $id)/@height"/> + </xsl:for-each> +</xsl:template> + +</xsl:stylesheet> |