diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2007-02-09 16:52:25 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2007-02-09 16:52:25 +0000 |
commit | 7f702e4ae048346953641aaebb556630e5ea9f06 (patch) | |
tree | a5da67a682903117a3cb2061dcb5a86f6e5b0906 /sandbox | |
parent | 441bdeb14810795e5c5b1d94635fb34077d4086b (diff) | |
download | gnome-doc-utils-7f702e4ae048346953641aaebb556630e5ea9f06.tar.gz |
html/Makefile - Copy figures over
* html/Makefile
- Copy figures over
* html/mallard-icon-code.png:
- Added block code watermark from the BeanStalk mockups
* rng/Makefile:
- Don't leave an empty mallard.rng around when it can't be built
* spec/mal_list.xml:
* spec/mal_list_bullet.xml:
* spec/mal_list_definition.xml:
* spec/mal_list_numbered.xml:
* spec/mal_list_tree.xml:
- Starting to hash out the list types
* spec/TODO:
* spec/legal.xml:
* spec/mal_app.xml:
* spec/mal_block.xml:
* spec/mal_caption.xml:
* spec/mal_cite.xml:
* spec/mal_cmd.xml:
* spec/mal_comment.xml:
* spec/mal_credit.xml:
* spec/mal_gui.xml:
* spec/mal_info.xml:
* spec/mal_inline.xml:
* spec/mal_license.xml:
* spec/mal_synopsis.xml:
* spec/mal_topic.xml:
- Added content
* spec/Makefile:
- Exclude legal from the pages to check
- Added status-report target
* xslt/mal2html-inline.xsl:
- Some styling work
* xslt/mal2html-media.xsl:
- Partial support for block images
* xslt/util.xsl:
- Utility template to strip leading/trailing newlines
* xslt/mal2html.xsl:
- Include mal2html-media.xsl and util.xsl
* xslt/mal-link.xsl:
- Put in FIXME text for non-yet-complete automatic link content
* xslt/mal2html-block.xsl:
- Some styling work
- Added figure and caption support
- Made the code template use util.strip_newlines
- Implemented new attribute form of of caption
svn path=/trunk/; revision=881
Diffstat (limited to 'sandbox')
31 files changed, 703 insertions, 164 deletions
diff --git a/sandbox/mallard/ChangeLog b/sandbox/mallard/ChangeLog index 155b29d..bf16cff 100644 --- a/sandbox/mallard/ChangeLog +++ b/sandbox/mallard/ChangeLog @@ -1,3 +1,63 @@ +2007-02-09 Shaun McCance <shaunm@gnome.org> + + * html/Makefile + - Copy figures over + + * html/mallard-icon-code.png: + - Added block code watermark from the BeanStalk mockups + + * rng/Makefile: + - Don't leave an empty mallard.rng around when it can't be built + + * spec/mal_list.xml: + * spec/mal_list_bullet.xml: + * spec/mal_list_definition.xml: + * spec/mal_list_numbered.xml: + * spec/mal_list_tree.xml: + - Starting to hash out the list types + + * spec/TODO: + * spec/legal.xml: + * spec/mal_app.xml: + * spec/mal_block.xml: + * spec/mal_caption.xml: + * spec/mal_cite.xml: + * spec/mal_cmd.xml: + * spec/mal_comment.xml: + * spec/mal_credit.xml: + * spec/mal_gui.xml: + * spec/mal_info.xml: + * spec/mal_inline.xml: + * spec/mal_license.xml: + * spec/mal_synopsis.xml: + * spec/mal_topic.xml: + - Added content + + * spec/Makefile: + - Exclude legal from the pages to check + - Added status-report target + + * xslt/mal2html-inline.xsl: + - Some styling work + + * xslt/mal2html-media.xsl: + - Partial support for block images + + * xslt/util.xsl: + - Utility template to strip leading/trailing newlines + + * xslt/mal2html.xsl: + - Include mal2html-media.xsl and util.xsl + + * xslt/mal-link.xsl: + - Put in FIXME text for non-yet-complete automatic link content + + * xslt/mal2html-block.xsl: + - Some styling work + - Added figure and caption support + - Made the code template use util.strip_newlines + - Implemented new attribute form of of caption + 2007-02-02 Shaun McCance <shaunm@gnome.org> * spec/Makefile: diff --git a/sandbox/mallard/html/Makefile b/sandbox/mallard/html/Makefile index 53fae81..f124581 100644 --- a/sandbox/mallard/html/Makefile +++ b/sandbox/mallard/html/Makefile @@ -1,6 +1,6 @@ pages=$(patsubst %.xml,%.xhtml, $(notdir $(wildcard ../spec/*.xml))) -all: $(pages) mallard.cache +all: $(pages) figures mallard.cache mallard.cache : $(wildcard ../xslt/*.xsl) echo '<cache xmlns="http://www.gnome.org/~shaunm/mallard">' >> $@.tmp @@ -14,3 +14,7 @@ $(pages) : mallard.cache $(pages) : $(wildcard ../xslt/*.xsl) $(pages) : %.xhtml : ../spec/%.xml xsltproc -o $@ ../xslt/mal2html.xsl $< + +figures: + if [ ! -d figures ]; then mkdir figures; fi + cp ../spec/figures/*.png figures/ diff --git a/sandbox/mallard/html/mallard-icon-code.png b/sandbox/mallard/html/mallard-icon-code.png Binary files differnew file mode 100644 index 0000000..75918d2 --- /dev/null +++ b/sandbox/mallard/html/mallard-icon-code.png diff --git a/sandbox/mallard/rng/Makefile b/sandbox/mallard/rng/Makefile index 28cffd5..06b55d6 100644 --- a/sandbox/mallard/rng/Makefile +++ b/sandbox/mallard/rng/Makefile @@ -6,4 +6,5 @@ mallard.rnc: $(wildcard ../spec/*.xml) done > mallard.rnc mallard.rng: mallard.rnc rnc2rng.awk - awk -f rnc2rng.awk mallard.rnc | xmllint --format - > mallard.rng + awk -f rnc2rng.awk mallard.rnc > $@.tmp || ( rm -f $@.tmp && exit 1 ) + xmllint --format $@.tmp > $@ || ( rm -f $@.tmp && exit 1 ) diff --git a/sandbox/mallard/spec/Makefile b/sandbox/mallard/spec/Makefile index 14c57d8..72908b4 100644 --- a/sandbox/mallard/spec/Makefile +++ b/sandbox/mallard/spec/Makefile @@ -1,15 +1,17 @@ -.PHONY: check-validate check-links +pages=$(filter-out legal.xml, $(wildcard *.xml)) + +.PHONY: check-validate check-links status-report check-validate: @(cd ../rng/ && $(MAKE) mallard.rnc) - xmllint --noout --relaxng ../rng/mallard.rng *.xml + xmllint --noout --relaxng ../rng/mallard.rng $(pages) check-links: - @files=$$(for file in *.xml; do \ + @files=$$(for page in $(pages); do \ xml sel -t -m "//*[@xref and contains(@xref, '#')]" \ - -v "substring-before(@xref, '#')" -n "$$file"; \ + -v "substring-before(@xref, '#')" -n "$$page"; \ xml sel -t -m "//*[@xref and not(contains(@xref, '#'))]" \ - -v "@xref" -n "$$file"; \ + -v "@xref" -n "$$page"; \ done | sort -u); \ for file in $$files; do \ if [ ! -f "$$file.xml" -a ! -f "$$file.TODO" ]; then \ @@ -18,5 +20,38 @@ check-links: fi; \ done; +status_xslt='<xsl:stylesheet version="1.0" \ + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \ + xmlns:mal="http://www.gnome.org/~shaunm/mallard"> \ +<xsl:output method="text"/> \ +<xsl:param name="base"/> \ +<xsl:template match="/"> \ + <xsl:variable name="version" select="*/mal:info/mal:version"/> \ + <xsl:if test="not($$version)"> \ + <xsl:value-of select="$$base"/> \ + <xsl:text>: none&\#x000A;</xsl:text> \ + </xsl:if> \ + <xsl:for-each select="$$version"> \ + <xsl:sort select="@date" date-type="text" order="descending"/> \ + <xsl:if test="position() = 1"> \ + <xsl:value-of select="$$base"/> \ + <xsl:text>: </xsl:text> \ + <xsl:choose> \ + <xsl:when test="@status"> \ + <xsl:value-of select="@status"/> \ + <xsl:text>&\#x000A;</xsl:text> \ + </xsl:when> \ + <xsl:otherwise> \ + <xsl:text>none&\#x000A;</xsl:text> \ + </xsl:otherwise> \ + </xsl:choose> \ + </xsl:if> \ + </xsl:for-each> \ +</xsl:template> \ +</xsl:stylesheet>' - +status-report: + @for page in $(pages); do \ + base=`echo "$$page" | sed -e 's/.xml$$//'`; \ + echo $(status_xslt) | xsltproc --stringparam base "$$base" - "$$page"; \ + done diff --git a/sandbox/mallard/spec/TODO b/sandbox/mallard/spec/TODO index e5d19e4..7b29306 100644 --- a/sandbox/mallard/spec/TODO +++ b/sandbox/mallard/spec/TODO @@ -1,3 +1,17 @@ -@status on guide, topic, section +intro text: + - what it is + - what it isn't + - in what elements it's used + - what content is valid +sections: + - examples + - processing expectations + - html comparison + - docbook comparison +display environments: + - rich display + - terminal + - print + - aural diff --git a/sandbox/mallard/spec/legal.xml b/sandbox/mallard/spec/legal.xml new file mode 100644 index 0000000..0d974a8 --- /dev/null +++ b/sandbox/mallard/spec/legal.xml @@ -0,0 +1,8 @@ +<license href="http://www.gnu.org/licenses/fdl.txt"> +<p>Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or any +later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the +license is included on the page +<link xref="gfdl">GNU Free Documentation License</link>.</p> +</license> diff --git a/sandbox/mallard/spec/mal_app.xml b/sandbox/mallard/spec/mal_app.xml index 1b548e9..d33a988 100644 --- a/sandbox/mallard/spec/mal_app.xml +++ b/sandbox/mallard/spec/mal_app.xml @@ -2,6 +2,10 @@ id="mal_app"> <info> <link type="guide" xref="mal_inline"/> + <version number="0.1" date="2007-02-08" status="review"/> + <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" /> </info> <title>Application Names</title> @@ -12,9 +16,34 @@ mal_app = element app { } </code></synopsis> -<comment> - <cite><name>Shaun McCance</name><date>2007-01-30</date></cite> - <p>Add examples, processing expectations</p> -</comment> +<p>The <code>app</code> element marks the human-readable name of an +application. It should not be used to mark the name of the command +used to run an application; use <code xref="mal_cmd">cmd</code> for +this purpose instead.</p> + + +<!-- BEGIN processing --> +<section id="processing"> + <title>Processing Expectations</title> + + <p>Application names are usually nouns, and are often a common word + or phrase that are indicative of their functionality. Frequently, + they are simply the name of what the application is. In English and + many other languages, the use of an application name in a sentence + may sound like the author has simply mistakenly omitted an article + if the application name is not understood to be a title.</p> + + <p>For example, the calculator application that comes with GNOME is + called <app>Calculator</app>. If an author were to write <quote>To + start <app>Calculator</app>…</quote>, then a reader may confuse this + for <quote>To start the calculator…</quote> with an error. This is + even more pronounced in language like German, where nouns are always + capitalized.</p> + + <p>For this reason, it is recommended that application names marked + with the <code>app</code> element are rendered in italics are using + some other font variation.</p> +</section> +<!-- END processing --> </topic> diff --git a/sandbox/mallard/spec/mal_block.xml b/sandbox/mallard/spec/mal_block.xml index bed954b..c53b7e3 100644 --- a/sandbox/mallard/spec/mal_block.xml +++ b/sandbox/mallard/spec/mal_block.xml @@ -16,7 +16,7 @@ mal_block = ( </code></synopsis> <comment> - <cite><name>Shaun McCance</name><date>2006-11-16</date></cite> + <cite name="Shaun McCance" date="2006-11-16"/> <p>Add some intro text</p> </comment> diff --git a/sandbox/mallard/spec/mal_caption.xml b/sandbox/mallard/spec/mal_caption.xml index b65623e..2f96787 100644 --- a/sandbox/mallard/spec/mal_caption.xml +++ b/sandbox/mallard/spec/mal_caption.xml @@ -1,2 +1,70 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<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" /> +</info> + +<title>Captions</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_caption = element caption { + <link xref="mal_inline">mal_inline</link>+ +} +</code></synopsis> + +<p>The <code>caption</code> element marks a short text caption at the +bottom of a <link xref="mal_figure">figure</link>. Captions provide +a short textual description of the contents of the figure, often an +image. Captions are simple block elements that can contain all +general <link xref="mal_inline">inline content</link>.</p> + + +<!-- BEGIN examples --> +<section id="examples"> + <title>Examples</title> + + <p>More exaples of figures can be found on the page <link xref="mal_figure"/>.</p> + + <code><![CDATA[ +<figure> + <media type="image" mime="image/png" href="figures/mallard.png"/> + <caption>Drake, the Mallard mascot</caption> +</figure> +]]></code> + <figure> + <media type="image" mime="image/png" href="figures/mallard.png"/> + <caption>Drake, the Mallard mascot</caption> + </figure> + + <comment> + <cite name="Shaun McCance" date="2007-02-06"/> + <p>Maybe add an example with a non-image figure? Should we even allow these?</p> + </comment> +</section> +<!-- END examples --> + + +<!-- BEGIN processing --> +<section id="processing"> + <title>Processing Expectations</title> + + <p>The exact display of a caption will depend on how the enclosing figure is + displayed. A caption is a block of text that should be displayed directly + below the normal contents of the enclosing figure.</p> + + <p>Display tools should attempt to display the caption in a way that makes it + clear that it belongs to the enclosing figure. For example, if a display tool + draws a frame around the enclosing figure, it may choose to place the caption + inside that frame. If the figure is indented from its enclosing block, the + caption should also be at the same indentation level.</p> + + <p>Captions are typically displayed directly below the normal contents of the + enclosing figure, with very little vertical space above them. If the enclosing + figure contains content other than images, then display tools should be careful + to ensure the caption is not confused with the normal figure content.</p> +</section> +<!-- END processing --> + </topic> diff --git a/sandbox/mallard/spec/mal_cite.xml b/sandbox/mallard/spec/mal_cite.xml index b65623e..40b5555 100644 --- a/sandbox/mallard/spec/mal_cite.xml +++ b/sandbox/mallard/spec/mal_cite.xml @@ -1,2 +1,32 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<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" /> +</info> + +<title>Citations</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_cite = element cite { + attribute name { text }, + attribute date { xsd:date }? +} +</code></synopsis> + +<comment> + <cite name="Shaun McCance" date="2007-02-08"/> + <p>Possibly add source for block quote citations.</p> +</comment> + +<p>The <code>cite</code> element provides information about the source of a +<code xref="mal_quote">quote</code> or a <code xref="mal_comment">comment</code> +element.</p> + +<comment> + <cite name="Shaun McCance" date="2007-02-08"/> + <p>Add examples, processing expectations.</p> +</comment> + </topic> diff --git a/sandbox/mallard/spec/mal_cmd.xml b/sandbox/mallard/spec/mal_cmd.xml index 2fc2364..8e6bd26 100644 --- a/sandbox/mallard/spec/mal_cmd.xml +++ b/sandbox/mallard/spec/mal_cmd.xml @@ -2,6 +2,11 @@ id="mal_cmd"> <info> <link type="guide" xref="mal_inline"/> + <link type="seealso" xref="mal_screen"/> + <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" /> </info> <title>Commands</title> @@ -12,9 +17,53 @@ mal_cmd = element cmd { } </code></synopsis> -<comment> - <cite><name>Shaun McCance</name><date>2007-01-30</date></cite> - <p>Add examples, processing expectations</p> -</comment> +<p>The <code>cmd</code> element marks the command used to run a program. +It should not be used to mark the human-readable name of an application; +use <code xref="mal_app">app</code> for this purpose instead.</p> + +<p>The <code>cmd</code> element may be used to mark the entire command, +including all arguments. Mallard does not contain elements to mark the +arguments specifically, as there is rarely a need to distinguish them +typographically. The <code xref="mal_var">var</code> element may be +used inside a <code>cmd</code> element to indicate text that should be +replaced by the user.</p> + + +<!-- BEGIN examples --> +<section id="examples"> + <title>Examples</title> + + <section> + <title>Basic Use</title> + <code><![CDATA[ +<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> + </section> + + <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> +]]></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> + </section> +</section> +<!-- END examples --> + + +<!-- BEGIN processing --> +<section id="processing"> + <title>Processing Expectations</title> + <comment> + <cite name="Shaun McCance" date="2007-02-06"/> + <p>Add processing expectations.</p> + </comment> +</section> +<!-- END processing --> </topic> diff --git a/sandbox/mallard/spec/mal_comment.xml b/sandbox/mallard/spec/mal_comment.xml index 59fea8f..88c8297 100644 --- a/sandbox/mallard/spec/mal_comment.xml +++ b/sandbox/mallard/spec/mal_comment.xml @@ -37,11 +37,11 @@ attribute. Writers are highly encouraged to provide a <code xref="mal_date">mal --> <comment> - <cite><name>Shaun McCance</name><date>2006-11-16</date></cite> + <cite name="Shaun McCance" date="2006-11-16"/> <p>Add examples, processing expectations</p> <comment> - <cite><name>Shaun McCance</name><date>2007-01-23</date></cite> + <cite name="Shaun McCance" date="2007-01-23"/> <p>This is a test of nested comments.</p> </comment> </comment> diff --git a/sandbox/mallard/spec/mal_credit.xml b/sandbox/mallard/spec/mal_credit.xml index 0e5bc9a..f18a394 100644 --- a/sandbox/mallard/spec/mal_credit.xml +++ b/sandbox/mallard/spec/mal_credit.xml @@ -8,10 +8,10 @@ <synopsis><code mime="application/relax-ng-compact-syntax"> mal_credit = element credit { - attribute type { "author" | "editor" | "collaborator" | "translator" }, - ( <link xref="mal_name">mal_name</link> & - <link xref="mal_date">mal_date</link>? & - <link xref="mal_email">mal_email</link>? ) + attribute type { "author" | "editor" | "collaborator" | "translator" | "publisher" }, + attribute name { text }, + attribute date { xsd:date } ?, + attribute email { text } ? } </code></synopsis> diff --git a/sandbox/mallard/spec/mal_gui.xml b/sandbox/mallard/spec/mal_gui.xml index d9f3ba3..7f3c861 100644 --- a/sandbox/mallard/spec/mal_gui.xml +++ b/sandbox/mallard/spec/mal_gui.xml @@ -8,13 +8,20 @@ <synopsis><code mime="application/relax-ng-compact-syntax"> mal_gui = element gui { - <link xref="mal_inline#simple">mal_inline_simple</link>+ + attribute type { "check" | "radio" | "menuitem" }?, + ( mal_gui + | + <link xref="mal_inline#simple">mal_inline_simple</link> + ) } </code></synopsis> <comment> - <cite><name>Shaun McCance</name><date>2007-01-30</date></cite> + <cite name="Shaun McCance" date="2007-01-30"/> <p>Add examples, processing expectations</p> </comment> +<comment> + <cite name="Shaun McCance" date="2007-02-07"/> + <p>Fix the content model, make type correspond to gui/inline content.</p> +</comment> + </topic> diff --git a/sandbox/mallard/spec/mal_info.xml b/sandbox/mallard/spec/mal_info.xml index b65623e..45dcec7 100644 --- a/sandbox/mallard/spec/mal_info.xml +++ b/sandbox/mallard/spec/mal_info.xml @@ -1,2 +1,20 @@ <topic xmlns="http://www.gnome.org/~shaunm/mallard"> +<!-- +credit (type) +credit/date +credit/email +credit/name + +copyright +copyright/date +copyright/name + +link (guide/page/seealso) + +? version number date +? license +? notice +? desc +? keyword +--> </topic> diff --git a/sandbox/mallard/spec/mal_inline.xml b/sandbox/mallard/spec/mal_inline.xml index 8ebc9eb..033b9cd 100644 --- a/sandbox/mallard/spec/mal_inline.xml +++ b/sandbox/mallard/spec/mal_inline.xml @@ -10,16 +10,13 @@ mal_inline = ( <link xref="mal_app">mal_app</link> | <link xref="mal_cmd">mal_cmd</link> | <link xref="mal_code">mal_code_inline</link> | - <link xref="mal_date">mal_date</link> | <link xref="mal_em">mal_em</link> | - <link xref="mal_email">mal_email</link> | <link xref="mal_file">mal_file</link> | <link xref="mal_gui">mal_gui</link> | <link xref="mal_input">mal_input</link> | <link xref="mal_key">mal_key</link> | <link xref="mal_link">mal_link</link> | <link xref="mal_media">mal_media</link> | - <link xref="mal_name">mal_name</link> | <link xref="mal_output">mal_output</link> | <link xref="mal_quote">mal_quote_inline</link> | <link xref="mal_sys">mal_sys</link> | @@ -27,7 +24,7 @@ mal_inline = ( </code></synopsis> <comment> - <cite><name>Shaun McCance</name><date>2006-11-16</date></cite> + <cite name="Shaun McCance" date="2006-11-16"/> <p>Add some intro text</p> </comment> diff --git a/sandbox/mallard/spec/mal_license.xml b/sandbox/mallard/spec/mal_license.xml new file mode 100644 index 0000000..b65623e --- /dev/null +++ b/sandbox/mallard/spec/mal_license.xml @@ -0,0 +1,2 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard"> +</topic> diff --git a/sandbox/mallard/spec/mal_list.xml b/sandbox/mallard/spec/mal_list.xml index 0a62d3f..e3a01f1 100644 --- a/sandbox/mallard/spec/mal_list.xml +++ b/sandbox/mallard/spec/mal_list.xml @@ -1,4 +1,4 @@ -<topic xmlns="http://www.gnome.org/~shaunm/mallard" +<guide xmlns="http://www.gnome.org/~shaunm/mallard" id="mal_list"> <info> <link type="guide" xref="mal_block#containers"/> @@ -8,9 +8,10 @@ <synopsis><code mime="application/relax-ng-compact-syntax"> mal_list = ( - <link xref="#bullet">mal_list_bullet</link> | - <link xref="#numbered">mal_list_numbered</link> | - <link xref="#definition">mal_list_definition</link> ) + <link xref="mal_list_bullet">mal_list_bullet</link> | + <link xref="mal_list_numbered">mal_list_numbered</link> | + <link xref="mal_list_definition">mal_list_definition</link> | + <link xref="mal_list_tree">mal_list_tree</link> ) </code></synopsis> <comment> @@ -18,53 +19,9 @@ mal_list = ( <p>Add explanation, examples, processing expectations</p> </comment> +<comment> + <cite><name>Shaun McCance</name><date>2007-02-09</date></cite> + <p>Unmarked lists and segmented lists</p> +</comment> -<!-- BEGIN bullet --> -<section id="bullet"> -<title>Bullet Lists</title> - -<synopsis><code mime="application/relax-ng-compact-syntax"> -mal_list_bullet = element_list { - attribute type { "bullet" } ?, - attribute style { text } ?, - element item { - <link xref="mal_block#simple">mal_block_simple</link> + - } + -}</code></synopsis> -</section> -<!-- END bullet --> - - -<!-- BEGIN numbered --> -<section id="numberd"> -<title>Numbered Lists</title> - -<synopsis><code mime="application/relax-ng-compact-syntax"> -mal_list_numbered = element_list { - attribute type { "numbered" }, - attribute style { text } ?, - element item { - <link xref="mal_block#simple">mal_block_simple</link> + - } + -}</code></synopsis> -</section> -<!-- END numbered --> - - -<!-- BEGIN definition --> -<section id="definition"> -<title>Definition Lists</title> - -<synopsis><code mime="application/relax-ng-compact-syntax"> -mal_list_definition = element_list { - attribute type { "definition" }, - attribute style { text } ?, - element item { - <link xref="mal_title">mal_title</link> +, - <link xref="mal_block#simple">mal_block_simple</link> + - } + -}</code></synopsis> -</section> -<!-- END definition --> - -</topic> +</guide> diff --git a/sandbox/mallard/spec/mal_list_bullet.xml b/sandbox/mallard/spec/mal_list_bullet.xml new file mode 100644 index 0000000..64b3fb2 --- /dev/null +++ b/sandbox/mallard/spec/mal_list_bullet.xml @@ -0,0 +1,20 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_list_bullet"> +<info> + <link type="guide" xref="mal_list"/> +</info> + +<title>Bullet Lists</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_list_bullet = element_list { + attribute type { "bullet" } ?, + attribute style { text } ?, + <link xref="mal_title">mal_title</link> ?, + element item { + <link xref="mal_block#simple">mal_block_simple</link> +, + <link xref="mal_list">mal_list</link> ? + } + +}</code></synopsis> + +</topic> diff --git a/sandbox/mallard/spec/mal_list_definition.xml b/sandbox/mallard/spec/mal_list_definition.xml new file mode 100644 index 0000000..11d692d --- /dev/null +++ b/sandbox/mallard/spec/mal_list_definition.xml @@ -0,0 +1,20 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_list_definition"> +<info> + <link type="guide" xref="mal_list"/> +</info> + +<title>Definition Lists</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_list_definition = element_list { + attribute type { "definition" }, + attribute style { text } ?, + element item { + <link xref="mal_title">mal_title</link> +, + <link xref="mal_block#simple">mal_block_simple</link> +, + <link xref="mal_list">mal_list</link> ? + } + +}</code></synopsis> + +</topic> diff --git a/sandbox/mallard/spec/mal_list_numbered.xml b/sandbox/mallard/spec/mal_list_numbered.xml new file mode 100644 index 0000000..593080c --- /dev/null +++ b/sandbox/mallard/spec/mal_list_numbered.xml @@ -0,0 +1,20 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_list_numbered"> +<info> + <link type="guide" xref="mal_list"/> +</info> + +<title>Numbered Lists</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_list_numbered = element_list { + attribute type { "numbered" }, + attribute style { text } ?, + <link xref="mal_title">mal_title</link> ?, + element item { + <link xref="mal_block#simple">mal_block_simple</link> +, + <link xref="mal_list">mal_list</link> ? + } +, +}</code></synopsis> + +</topic> diff --git a/sandbox/mallard/spec/mal_list_tree.xml b/sandbox/mallard/spec/mal_list_tree.xml new file mode 100644 index 0000000..2027a45 --- /dev/null +++ b/sandbox/mallard/spec/mal_list_tree.xml @@ -0,0 +1,19 @@ +<topic xmlns="http://www.gnome.org/~shaunm/mallard" + id="mal_list_tree"> +<info> + <link type="guide" xref="mal_list"/> +</info> + +<title>Tree Lists</title> + +<synopsis><code mime="application/relax-ng-compact-syntax"> +mal_list_tree = element_list { + attribute type { "tree" }, + attribute style { text } ?, + element item { + <link xref="mal_inline">mal_inline</link> +, + mal_list_tree ? + } +, +}</code></synopsis> + +</topic> diff --git a/sandbox/mallard/spec/mal_synopsis.xml b/sandbox/mallard/spec/mal_synopsis.xml index 7bdf57d..184f4b2 100644 --- a/sandbox/mallard/spec/mal_synopsis.xml +++ b/sandbox/mallard/spec/mal_synopsis.xml @@ -9,8 +9,8 @@ <synopsis><code mime="application/relax-ng-compact-syntax"> mal_synopsis = element synopsis { <link xref="mal_attr">mal_attr_common</link>, - <link xref="mal_title">mal_title</link>?, - <link xref="mal_block#simple">mal_block_simple</link>+, + <link xref="mal_title">mal_title</link> ?, + <link xref="mal_block#simple">mal_block_simple</link> + }</code></synopsis> <p>The <code>synopsis</code> element allows you to mark up a block as diff --git a/sandbox/mallard/spec/mal_topic.xml b/sandbox/mallard/spec/mal_topic.xml index 014c113..d5324ff 100644 --- a/sandbox/mallard/spec/mal_topic.xml +++ b/sandbox/mallard/spec/mal_topic.xml @@ -7,7 +7,15 @@ <synopsis><code mime="application/relax-ng-compact-syntax"> mal_topic = element topic { - <link xref="mal_info">mal_info_topic</link>?, + element info { + <link xref="mal_credit">mal_credit</link> * & + <link xref="mal_copyright">mal_copyright</link> * & + <link xref="mal_desc">mal_desc</link> ? & + <link xref="mal_license">mal_license</link> * & + <link xref="mal_link#guide">mal_link_guide</link> * & + <link xref="mal_link#seealso">mal_link_seealso</link> * & + <link xref="mal_version">mal_version</link> * + } ?, <link xref="mal_title">mal_title</link>, <link xref="mal_block">mal_block</link>+, <link xref="mal_section">mal_section_topic</link>* diff --git a/sandbox/mallard/xslt/mal-link.xsl b/sandbox/mallard/xslt/mal-link.xsl index abb8d12..03e7c3c 100644 --- a/sandbox/mallard/xslt/mal-link.xsl +++ b/sandbox/mallard/xslt/mal-link.xsl @@ -33,7 +33,7 @@ $xref: FIXME <xsl:template name="mal.link.content"> <xsl:param name="node" select="."/> <xsl:param name="xref" select="$node/@xref"/> - <!-- FIXME --> + <xsl:text>FIXME</xsl:text> </xsl:template> diff --git a/sandbox/mallard/xslt/mal2html-block.xsl b/sandbox/mallard/xslt/mal2html-block.xsl index 8967311..c89dc7a 100644 --- a/sandbox/mallard/xslt/mal2html-block.xsl +++ b/sandbox/mallard/xslt/mal2html-block.xsl @@ -36,41 +36,60 @@ REMARK: Describe this template --> <xsl:template name="mal2html.block.css"> <xsl:text> -<!-- FIXME: margins should be original ems, not adjusted --> -h1 { font-size: 1.72em; margin: 0; } -h2 { font-size: 1.44em; margin: 0; } -h3 { font-size: 1.2em; margin: 0; } -h4 { font-size: 1em; margin: 0 0; } -h5 { font-size: 1em; margin: 0 0; } -h6 { font-size: 1em; margin: 0 0; } -h7 { font-size: 1em; margin: 0 0; } -div.section { margin-top: 2em; } -div.section div.section { margin-top: 1.44em; } -div.section div.section div.section { margin-top: 1.2em; } +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; } +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 { - background-color: #eeeeec; - border: solid 2px #babdb6; + background: url(mallard-icon-code.png) no-repeat top right; + border: solid 2px #eeeeec; + padding: 1em; } div.comment { margin-left: 1.72em; - margin-right: 1em; padding: 0 1em 1em 1em; - background-color: #fcaf3e; - border: solid 1px #f57900; - -moz-border-radius: 8px; + background-color: #f0dddd; + border: solid 2px #f08d8d; } div.comment div.cite { font-style: italic; } div.comment div.titlecite { margin-top: 0; } -div.synopsis { +div.figure { + color: #2e3436; background-color: #eeeeec; - border: solid 1px #babdb6; - -moz-border-radius: 8px; + border: solid 1px #888a85; + margin-left: 1.72em; + padding: 4px 4px 4px 4px; +} +div.figure-contents { + color: #000000; + background-color: #ffffff; + border: solid 1px #888a85; + padding: 0 1em 1em 1em; + margin: 0; + text-align: center; +} +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; padding: 0 1em 1em 1em; } div.synopsis pre.code { background: none; border: none; + padding: 0; } div.title { font-size: 1.2em; @@ -83,60 +102,33 @@ div.title { <!-- == Matched Templates == --> +<!-- = caption = --> +<xsl:template mode="mal2html.block.mode" match="mal:caption"> + <div class="caption"> + <xsl:apply-templates mode="mal2html.block.mode"/> + </div> +</xsl:template> + <!-- = code = --> <xsl:template mode="mal2html.block.mode" match="mal:code"> - <!-- FIXME: strip leading/trailing newline --> + <xsl:variable name="first" select="node()[1]/self::text()"/> + <xsl:variable name="last" select="node()[last()]/self::text()"/> <pre class="code"> - <!-- FIXME: if there's only one piece of text() --> - <xsl:if test="node()[1]/self::text()"> - <xsl:choose> - <!-- CR LF --> - <xsl:when test="starts-with(text()[1], '
')"> - <xsl:value-of select="substring-after(text()[1], '
')"/> - </xsl:when> - <!-- CR --> - <xsl:when test="starts-with(text()[1], '
')"> - <xsl:value-of select="substring-after(text()[1], '
')"/> - </xsl:when> - <!-- LF --> - <xsl:when test="starts-with(text()[1], '
')"> - <xsl:value-of select="substring-after(text()[1], '
')"/> - </xsl:when> - <!-- NEL --> - <xsl:when test="starts-with(text()[1], '…')"> - <xsl:value-of select="substring-after(text()[1], '…')"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="text()[1]"/> - </xsl:otherwise> - </xsl:choose> + <xsl:if test="$first"> + <xsl:call-template name="util.strip_newlines"> + <xsl:with-param name="string" select="$first"/> + <xsl:with-param name="leading" select="true()"/> + <xsl:with-param name="trailing" select="$first = $last"/> + </xsl:call-template> </xsl:if> <xsl:apply-templates mode="mal2html.inline.mode" - select="node()[not((position() = 1 or position() = last()) - and self::text())]"/> - <xsl:if test="node()[last()]/self::text()"> - <xsl:variable name="text" select="text()[last()]"/> - <xsl:choose> - <!-- CR LF --> - <xsl:when test="substring($text, -2) = '
'"> - <xsl:value-of select="substring($text, 1, string-length($text) - 2 )"/> - </xsl:when> - <!-- CR --> - <xsl:when test="substring($text, -1) = '
'"> - <xsl:value-of select="substring($text, 1, string-length($text) - 1 )"/> - </xsl:when> - <!-- LF --> - <xsl:when test="substring($text, -1) = '
'"> - <xsl:value-of select="substring($text, 1, string-length($text) - 1 )"/> - </xsl:when> - <!-- NEL --> - <xsl:when test="substring($text, -1) = '…'"> - <xsl:value-of select="substring($text, 1, string-length($text) - 1 )"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$text"/> - </xsl:otherwise> - </xsl:choose> + select="node()[not(. = $first or . = $last)]"/> + <xsl:if test="$last and ($first != $last)"> + <xsl:call-template name="util.strip_newlines"> + <xsl:with-param name="string" select="$last"/> + <xsl:with-param name="leading" select="false()"/> + <xsl:with-param name="trailing" select="true()"/> + </xsl:call-template> </xsl:if> </pre> </xsl:template> @@ -151,7 +143,7 @@ div.title { <!-- = comment/title = --> <xsl:template mode="mal2html.block.mode" match="mal:comment/mal:title"> <div class="title"> - <xsl:apply-templates/> + <xsl:apply-templates mode="mal2html.inline.mode"/> </div> </xsl:template> @@ -166,20 +158,42 @@ div.title { </xsl:attribute> <!-- FIXME: i18n --> <xsl:choose> - <xsl:when test="mal:name and mal:date"> + <xsl:when test="@name and @date"> <xsl:text>from </xsl:text> - <xsl:apply-templates mode="mal2html.inline.mode" select="mal:name"/> + <xsl:apply-templates mode="mal2html.inline.mode" select="@name"/> <xsl:text> on </xsl:text> - <xsl:apply-templates mode="mal2html.inline.mode" select="mal:date"/> + <xsl:apply-templates mode="mal2html.inline.mode" select="@date"/> </xsl:when> <xsl:otherwise> <xsl:text>from </xsl:text> - <xsl:apply-templates select="mal:name"/> + <xsl:apply-templates mode="mal2html.inline.mode" select="@name"/> </xsl:otherwise> </xsl:choose> </div> </xsl:template> +<!-- = figure = --> +<xsl:template mode="mal2html.block.mode" match="mal:figure"> + <div class="figure"> + <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/> + <div class="figure-contents"> + <xsl:apply-templates mode="mal2html.block.mode" + select="*[not(self::mal:title or self::mal:caption)]"/> + </div> + <xsl:apply-templates mode="mal2html.block.mode" select="mal:caption"/> + </div> +</xsl:template> + +<!-- = figure/title = --> +<xsl:template mode="mal2html.block.mode" match="mal:figure/mal:title"> + <div class="title"> + <xsl:apply-templates mode="mal2html.inline.mode"/> + </div> +</xsl:template> + +<!-- = info = --> +<xsl:template mode="mal2html.block.mode" match="mal:info"/> + <!-- = p = --> <xsl:template mode="mal2html.block.mode" match="mal:p"> <p class="p"> @@ -197,7 +211,7 @@ div.title { <!-- = synopsis/title = --> <xsl:template mode="mal2html.block.mode" match="mal:synopsis/mal:title"> <div class="title"> - <xsl:apply-templates/> + <xsl:apply-templates mode="mal2html.inline.mode"/> </div> </xsl:template> diff --git a/sandbox/mallard/xslt/mal2html-inline.xsl b/sandbox/mallard/xslt/mal2html-inline.xsl index 8db29d9..c4c8151 100644 --- a/sandbox/mallard/xslt/mal2html-inline.xsl +++ b/sandbox/mallard/xslt/mal2html-inline.xsl @@ -106,8 +106,13 @@ REMARK: Describe this template --> <xsl:template name="mal2html.inline.css"> <xsl:text> -span.app { color: red; } -span.cmd { font-family: monospace; } +span.app { font-style: italic; } +span.cmd { + font-family: monospace; + background-color: #f0f0f0; + padding-left: 0.2em; + padding-right: 0.4em; +} span.code { font-family: monospace; } span.em { font-style: italic; } span.email { color: red; } diff --git a/sandbox/mallard/xslt/mal2html-media.xsl b/sandbox/mallard/xslt/mal2html-media.xsl new file mode 100644 index 0000000..0d56215 --- /dev/null +++ b/sandbox/mallard/xslt/mal2html-media.xsl @@ -0,0 +1,41 @@ +<?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 - Media Elements + +REMARK: Describe this module +--> + + +<!-- == Matched Templates == --> + +<!-- = mal2html.block.mode % media/image = --> +<xsl:template mode="mal2html.block.mode" + match="mal:media[@type='image']"> + <div class="media media-image"> + <img src="{@href}"/> + </div> +</xsl:template> + +</xsl:stylesheet> diff --git a/sandbox/mallard/xslt/mal2html.xsl b/sandbox/mallard/xslt/mal2html.xsl index b7e4447..b44464c 100644 --- a/sandbox/mallard/xslt/mal2html.xsl +++ b/sandbox/mallard/xslt/mal2html.xsl @@ -32,6 +32,9 @@ REMARK: Describe this module <xsl:include href="mal2html-block.xsl"/> <xsl:include href="mal2html-css.xsl"/> <xsl:include href="mal2html-inline.xsl"/> +<xsl:include href="mal2html-media.xsl"/> + +<xsl:include href="util.xsl"/> <xsl:param name="mal.extension" select="'.xhtml'"/> diff --git a/sandbox/mallard/xslt/util.xsl b/sandbox/mallard/xslt/util.xsl new file mode 100644 index 0000000..c71b5b7 --- /dev/null +++ b/sandbox/mallard/xslt/util.xsl @@ -0,0 +1,110 @@ +<?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" + version="1.0"> + +<!--!!========================================================================== +Common XSLT Utilities + +REMARK: Describe this module +--> + + +<!--**========================================================================== +util.strip_newlines +Strips leading or trailing newlines from a string +$string: The string to strip newlines from +$leading: Whether to strip leading newlines +$trailing: Whether to strip trailing newlines + +This template strips at most one leading and one trailing newline from ${string}. +The newline may come in four different forms: U+000D U+000A (CR LF), U+000D (CR), +U+000A (LF), and U+0085 (NEL). This is useful for preformatted block elements +where leading and trailing newlines are ignored to make source formatting easier +for authors. +--> +<xsl:template name="util.strip_newlines"> + <xsl:param name="string"/> + <xsl:param name="leading" select="false()"/> + <xsl:param name="trailing" select="false()"/> + <xsl:choose> + <xsl:when test="$leading"> + <xsl:variable name="new"> + <xsl:choose> + <!-- CR LF --> + <xsl:when test="starts-with($string, '
')"> + <xsl:value-of select="substring-after($string, '
')"/> + </xsl:when> + <!-- CR --> + <xsl:when test="starts-with($string, '
')"> + <xsl:value-of select="substring-after($string, '
')"/> + </xsl:when> + <!-- LF --> + <xsl:when test="starts-with($string, '
')"> + <xsl:value-of select="substring-after($string, '
')"/> + </xsl:when> + <!-- NEL --> + <xsl:when test="starts-with($string, '…')"> + <xsl:value-of select="substring-after($string, '…')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$string"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$trailing"> + <xsl:call-template name="util.strip_newlines"> + <xsl:with-param name="string" select="$new"/> + <xsl:with-param name="leading" select="false()"/> + <xsl:with-param name="trailing" select="true()"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$new"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$trailing"> + <xsl:choose> + <!-- CR LF --> + <xsl:when test="substring($string, -2) = '
'"> + <xsl:value-of select="substring($string, 1, string-length($string) - 2 )"/> + </xsl:when> + <!-- CR --> + <xsl:when test="substring($string, -1) = '
'"> + <xsl:value-of select="substring($string, 1, string-length($string) - 1 )"/> + </xsl:when> + <!-- LF --> + <xsl:when test="substring($string, -1) = '
'"> + <xsl:value-of select="substring($string, 1, string-length($string) - 1 )"/> + </xsl:when> + <!-- NEL --> + <xsl:when test="substring($string, -1) = '…'"> + <xsl:value-of select="substring($string, 1, string-length($string) - 1 )"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$string"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> |