From dcb8e4aab35db8437e771880dae1ad24ba709738 Mon Sep 17 00:00:00 2001 From: Alistair Thomas Date: Sat, 11 Mar 2017 21:33:18 +0000 Subject: manual: Add print target for single page HTML and CSS paged media styling --- doc/manual/.gitignore | 3 +- doc/manual/Makefile.am | 18 ++- doc/manual/common.xsl | 268 +++++++++++++++++++++++++++++++++++++++++++- doc/manual/default.css | 37 ++++++- doc/manual/print.xsl | 138 +++++++++++++++++++++++ doc/manual/version.xml.in | 2 +- doc/manual/xhtml.xsl | 277 +++------------------------------------------- 7 files changed, 475 insertions(+), 268 deletions(-) create mode 100644 doc/manual/print.xsl diff --git a/doc/manual/.gitignore b/doc/manual/.gitignore index 944f5eeea..fbf57b271 100644 --- a/doc/manual/.gitignore +++ b/doc/manual/.gitignore @@ -1,3 +1,4 @@ +manual.html version.xml -html/ devhelp/ +html/ diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am index 342feb46e..1791d908c 100644 --- a/doc/manual/Makefile.am +++ b/doc/manual/Makefile.am @@ -11,36 +11,49 @@ book_DATA = \ endif $(builddir)/devhelp/*: devhelp -devhelp: manual.xml version.xml devhelp.xsl xhtml.xsl default.css +devhelp: manual.xml version.xml common.xsl devhelp.xsl xhtml.xsl default.css @$(MKDIR_P) $@ $(AM_V_GEN)$(XSLTPROC) \ --xinclude \ + --path $(srcdir) \ --output $@/$(BOOK_NAME).devhelp2 \ $(srcdir)/devhelp.xsl \ $(srcdir)/manual.xml @$(XSLTPROC) \ --xinclude \ + --path $(srcdir) \ --output $@/index.html \ $(srcdir)/xhtml.xsl \ $(srcdir)/manual.xml @cp $(srcdir)/default.css $@ @touch $@ -html: manual.xml version.xml xhtml.xsl default.css +html: manual.xml version.xml common.xsl xhtml.xsl default.css @$(MKDIR_P) $@ $(AM_V_GEN)$(XSLTPROC) \ --xinclude \ + --stringparam body-class u-center \ --output $@/index.html \ $(srcdir)/xhtml.xsl \ $(srcdir)/manual.xml @cp $(srcdir)/default.css $@ @touch $@ +print: manual.html +manual.html: manual.xml version.xml common.xsl print.xsl default.css + $(AM_V_GEN)$(XSLTPROC) \ + --xinclude \ + --path $(srcdir) \ + --output $@ \ + $(srcdir)/print.xsl \ + $(srcdir)/manual.xml + mostlyclean-local: rm -rf devhelp rm -rf html CLEANFILES = \ + manual.html \ version.xml \ $(NULL) @@ -49,6 +62,7 @@ EXTRA_DIST = \ default.css \ devhelp.xsl \ manual.xml \ + print.xsl \ xhtml.xsl \ $(NULL) diff --git a/doc/manual/common.xsl b/doc/manual/common.xsl index 68cf4bf56..713e6dadc 100644 --- a/doc/manual/common.xsl +++ b/doc/manual/common.xsl @@ -4,8 +4,9 @@ version="1.0" xmlns:str="http://exslt.org/strings" xmlns:exsl="http://exslt.org/common" + xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="exsl" - exclude-result-prefixes="str" + exclude-result-prefixes="str date" > @@ -33,10 +34,275 @@ + + + + + <!DOCTYPE html> + + + + + <meta charset="UTF-8" /> + + + + + <meta name="viewport" content="initial-scale=1"> + + + + + + + + + + <xsl:value-of select="text()"/> - <xsl:value-of select="/article/section/title"/> + + + + + + + + +

+ +
    + +
  • + + + + + + + + +
      + +
    • + + + + + + + +
    • +
      +
    +
    +
  • +
    +
+ +
+ + + + + + + + + + + +
Vala version:
Release:
Status:
Copyright: + © + + + +
License:
+
+ + +

+
+ + + + + + + + + +

+
+ + + + + + + + + + + + + + + + + +

 

+
+ + + + + + + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + \n + + + + \n\n + + + + + + + + +
  • +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + diff --git a/doc/manual/default.css b/doc/manual/default.css index f118ad5c5..1e69dff8c 100644 --- a/doc/manual/default.css +++ b/doc/manual/default.css @@ -3,7 +3,6 @@ body { font-family: cantarell, sans-serif; text-align: justify; margin-top: 2.8em; - max-width: 35em; } h1, h2, h3, h4 { @@ -160,7 +159,6 @@ pre { .c-document_version { border: solid 2px #ccc; border-radius: 4px; width: 100%; - font-sizde: 95%; } .c-document_version tr td:first-child { text-align: right; } .c-document_version tr:nth-child(odd) { background-color: #f0f0f0; } @@ -180,3 +178,38 @@ blockquote span.literal { float: right; overflow: hidden; } +.u-center { + margin-left: auto; + margin-right: auto; +} + +@media screen { + body { max-width: 35em; } +} + +@media print { + * { background: none !important; } + h1 { + text-align: center; + padding: 2em 0 4em 0; + } + h1+p, h1+p+p, h1+p+p+p { max-width: 28em; + margin: 0 auto 1em; + } + .c-document_version { position: absolute; bottom: 0; } + h2, .toc { page-break-before: always; } + h1, h2, h3, h4 { page-break-after: avoid; } + h2, h3, h4 { + border: none; + padding: 0; + } +} + +@page { + counter-increment: page; + @top-center { content: "Vala Reference Manual"; } + @bottom-center { + content: counter(page); + } + font-family: cantarell, sans-serif; +} diff --git a/doc/manual/print.xsl b/doc/manual/print.xsl new file mode 100644 index 000000000..969e93d16 --- /dev/null +++ b/doc/manual/print.xsl @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
    • + + + + + + + +
    • +
      +
    +
    + +
    + + +

    + +
      + +
    • + + + + + + + + + +
        + +
      • + + + + + + + +
      • +
        +
      +
      +
    • +
      +
    + +
    + + + + + + + + + +

    +
    + + + + + + + + + +

    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + diff --git a/doc/manual/version.xml.in b/doc/manual/version.xml.in index e89676864..3811e287c 100644 --- a/doc/manual/version.xml.in +++ b/doc/manual/version.xml.in @@ -2,7 +2,7 @@ -The Vala programming language is a high level language that produces binaries for the native platform. The binaries maintain the C Application Binary Interface (ABI) and so can be built as either an application or a library. +Vala is a high level programming language that produces binaries for the native platform. The binaries maintain the C Application Binary Interface (ABI) and can be built as either an application or a library. The Vala Reference Manual gives details on Vala's syntax and type system, including polymorphism using interfaces and type parameters (generics). Vala includes additional code generation routines, for example D-Bus inter-process communication and GTK+3 composite templates, these are only referred to in the Attributes section. The reference manual does not provide a tutorial for these features. Vala is developed in a collaborative and self-supporting way by its users. They provide bug reports, documentation, patches, patch reviews and core development. Following this model of development the manual has an editable version at https://wiki.gnome.org/Projects/Vala/Manual . diff --git a/doc/manual/xhtml.xsl b/doc/manual/xhtml.xsl index 425309088..19390bc21 100644 --- a/doc/manual/xhtml.xsl +++ b/doc/manual/xhtml.xsl @@ -4,9 +4,8 @@ version="1.0" xmlns:str="http://exslt.org/strings" xmlns:exsl="http://exslt.org/common" - xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="exsl" - exclude-result-prefixes="str date" + exclude-result-prefixes="str" > @@ -19,13 +18,20 @@ media-type="text/html" /> + + + - + + + + + @@ -48,8 +54,12 @@ + + + + - - <!DOCTYPE html> - - - - - <meta charset="UTF-8" /> - - - - - - - - - - <xsl:value-of select="text()"/> - <xsl:value-of select="/article/section/title"/> - - - - - - -
    + + o-navbar + Contents
    @@ -141,238 +130,4 @@ - -

    - -
      - -
    • - - - - - - - - -
        - -
      • - - - - - - - -
      • -
        -
      -
      -
    • -
      -
    - -
    - - - - - - - - - - - -
    Vala version:
    Release:
    Status:
    Copyright: - © - - - -
    License:
    -
    - - -

    -
    - - - - - - - - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -

     

    -
    - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - \n - - - - \n\n - - - - -
    -
    - - -
  • -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.1