Alexandre Julliard : Move the documentation tools to the git
repository.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Sep 11 14:46:37 CDT 2007
Module: tools
Branch: master
Commit: 5a27329c2fa39b57226efc178b2e5ef35cdaa97b
URL: http://source.winehq.org/git/tools.git/?a=commit;h=5a27329c2fa39b57226efc178b2e5ef35cdaa97b
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Sep 11 21:34:04 2007 +0200
Move the documentation tools to the git repository.
---
html2template | 93 ++++++++++++++++++++++++++++++++++++++++++++++
wine_release | 2 +-
winedoc.css | 10 +++++
winedoc_release | 2 +-
winehtml.dsl | 27 +++++++++++++
wineprint.dsl | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 243 insertions(+), 2 deletions(-)
diff --git a/html2template b/html2template
new file mode 100755
index 0000000..fa09567
--- /dev/null
+++ b/html2template
@@ -0,0 +1,93 @@
+#!/usr/bin/perl -w
+# Francois Gouget <fgouget at codeweavers.com>
+# Jeremy Newman <jnewman at codeweavers.com>
+use strict;
+use Getopt::Std;
+
+# This is a convenience script for building the website docs for
+# www.winehq.com. WineHQ is a template based website so that the
+# generated files must have a slightly special format:
+# * everything outside the <body> tag must be stripped
+# * the title is specified using a special tag on the first line
+# * the filenames don't end in '.html'
+
+sub skip_to_gt($)
+{
+ my $line=$_[0];
+ while (defined $line)
+ {
+ return $line if ($line =~ s/^[^>]*>//i);
+ $line=<>;
+ }
+ return undef;
+}
+
+sub grab_cdata($)
+{
+ my $line=$_[0];
+ my $cdata;
+ while (defined $line)
+ {
+ if ($line =~ s/^([^<]*)<.*$/$1/i)
+ {
+ chomp $line;
+ $cdata=(defined $cdata?"$cdata $line":$line);
+ return ($cdata,$line);
+ }
+ chomp $line;
+ $cdata=(defined $cdata?"$cdata $line":$line);
+ $line=<>;
+ }
+ return ($cdata,$line);
+}
+
+sub convert_to_template()
+{
+ my $line;
+ while ($line=<>)
+ {
+ if ($line =~ s/^.*<title\s*//i)
+ {
+ $line=skip_to_gt($line);
+ my ($title,$line)=grab_cdata($line);
+ print "<!--TITLE:[$title]-->\n";
+ }
+ elsif ($line =~ s/^.*<body//i)
+ {
+ $line=skip_to_gt($line);
+ last;
+ }
+ }
+
+ my $exit;
+ do
+ {
+ $exit=($line =~ s/<\/body.*$//i);
+ $line=~s/(href=\"[^.\/]*)\.(htm|html)([^\"]*\")/$1$3/gi;
+ print $line;
+ }
+ while (!$exit and $line=<>);
+}
+
+#
+# main
+#
+
+# get command line options
+# $opts{'i'} = input file name
+# $opts{'o'} = output file name
+my %opts;
+getopt('io', \%opts);
+
+if (defined($opts{'i'}))
+{
+ open STDIN, "<$opts{'i'}" or die "cannot read from $opts{'i'}: $!";
+}
+
+if (defined($opts{'o'}))
+{
+ open STDOUT, ">$opts{'o'}" or die "cannot write to $opts{'o'}: $!";
+}
+
+convert_to_template();
+exit 0;
diff --git a/wine_release b/wine_release
index 909ae14..e6ae152 100755
--- a/wine_release
+++ b/wine_release
@@ -69,7 +69,7 @@ for f in $manpages
do
name=`basename $f .man`
make -C `dirname $f` $name.man
- nroff -man $f | ../bin/man2html --pgsize=100000 | ../html2template -o $templates_dir/en/docs/$name.template
+ nroff -man $f | ../bin/man2html --pgsize=100000 | $tools_dir/html2template -o $templates_dir/en/docs/$name.template
done
git diff -M --stat wine-$oldver wine-$version >../ds$version.txt
diff --git a/winedoc.css b/winedoc.css
new file mode 100644
index 0000000..f93abba
--- /dev/null
+++ b/winedoc.css
@@ -0,0 +1,10 @@
+body { background-color: #FFFFFF; color: #000000; }
+
+a:link { color: #a50d0d; }
+a:visited { color: #505050; }
+a:active { color: #a50d0d; }
+
+.screen { background-color: #E0D0D0; padding: 0.5ex; }
+.question { border-top: dashed thin; font-weight: bolder; }
+
+.userinput { font-weight: bold; }
diff --git a/winedoc_release b/winedoc_release
index 0fc6c2d..165287f 100755
--- a/winedoc_release
+++ b/winedoc_release
@@ -37,7 +37,7 @@ echo "==== BUILDING SGML DOCUMENTATION ===="
books="wineusr-guide winedev-guide winelib-guide"
langs="en"
site_base_dir="/home/winehq/opt/lostwages"
-tools_dir="/home/winehq/opt/tools"
+tools_dir="/home/winehq/opt/git-tools"
guides_base_dir="$site_base_dir/docs"
winehq_base_dir="$site_base_dir/templates"
diff --git a/winehtml.dsl b/winehtml.dsl
new file mode 100644
index 0000000..5270a99
--- /dev/null
+++ b/winehtml.dsl
@@ -0,0 +1,27 @@
+<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
+<!ENTITY walsh-style PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
+<!ENTITY cygnus-style SYSTEM "/usr/lib/sgml/stylesheet/dsssl/docbook/cygnus/cygnus-both.dsl" CDATA DSSSL>
+]>
+
+<style-sheet>
+<style-specification id="html" use="docbook">
+<style-specification-body>
+
+; Use the section id as the filename rather than
+; cryptic filenames like x1547.html
+(define %use-id-as-filename% #t)
+
+; Repeat the section number in each section to make it easier
+; when browsing the doc
+(define %section-autolabel% #t)
+
+; Use CSS to make the look of the documentation customizable
+(define %stylesheet% "winedoc.css")
+(define %stylesheet-type% "text/css")
+
+</style-specification-body>
+</style-specification>
+
+<external-specification id="docbook" document="walsh-style">
+
+</style-sheet>
diff --git a/wineprint.dsl b/wineprint.dsl
new file mode 100644
index 0000000..7f53b2f
--- /dev/null
+++ b/wineprint.dsl
@@ -0,0 +1,111 @@
+<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
+<!ENTITY print-ss PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA DSSSL>
+]>
+
+<style-sheet>
+
+<style-specification id="print" use="print-stylesheet">
+<style-specification-body>
+
+;; I was hoping that this would take out the many blank pages in the
+;; PDF file, but it doesn't, it just slides the page numbers over.
+(define %two-side% #f)
+
+(define %generate-book-titlepage% #t)
+
+;;Titlepage Not Separate
+(define (chunk-skip-first-element-list)
+ (list (normalize "sect1")
+ (normalize "section")))
+
+;;Titlepage Separate?
+;(define (chunk-skip-first-element-list)
+; '())
+
+(define (list-element-list)
+ ;; fixes bug in Table of Contents generation
+ '())
+
+(define (toc-depth nd)
+ 2)
+
+;; This seems to have no affect
+(define %generate-book-titlepage-on-separate-page% #f)
+
+(define %body-start-indent%
+ ;; Default indent of body text
+ 2pi)
+
+(define %para-indent-firstpara%
+ ;; First line start-indent for the first paragraph
+ 0pt)
+
+(define %para-indent%
+ ;; First line start-indent for paragraphs (other than the first)
+ 0pt)
+
+(define %block-start-indent%
+ ;; Extra start-indent for block-elements
+ 2pt)
+
+;;Define distance between paragraphs
+(define %para-sep%
+ (/ %bf-size% 2.0))
+
+;;Define distance between block elements (figures, tables, etc.).
+(define %block-sep%
+ (* %para-sep% 1.0))
+;; (* %para-sep% 2.0))
+
+(define %hyphenation%
+ ;; Allow automatic hyphenation?
+ #t)
+
+(define %left-margin% 5pi)
+(define %right-margin% 5pi)
+(define %top-margin% 5pi)
+(define %bottom-margin% 5pi)
+
+(define %footer-margin% 2pi)
+(define %header-margin% 2pi)
+
+(define %line-spacing-factor% 1.3)
+ ;; Factor used to calculate leading
+ ;; The leading is calculated by multiplying the current font size by the
+ ;; '%line-spacing-factor%'. For example, if the font size is 10pt and
+ ;; the '%line-spacing-factor%' is 1.1, then the text will be
+ ;; printed "10-on-11".
+
+(define %head-before-factor%
+ ;; Factor used to calculate space above a title
+ ;; The space before a title is calculated by multiplying the font size
+ ;; used in the title by the '%head-before-factor%'.
+;; 0.75)
+ 0.5)
+
+(define %head-after-factor%
+ ;; Factor used to calculate space below a title
+ ;; The space after a title is calculated by multiplying the font size used
+ ;; in the title by the '%head-after-factor%'.
+ 0.5)
+
+(define %input-whitespace-treatment% 'collapse)
+
+(define ($generate-book-lot-list$)
+ ;; Which Lists of Titles should be produced for Books?
+ (list ))
+
+(define tex-backend
+ ;; Are we using the TeX backend?
+ ;; This parameter exists so that '-V tex-backend' can be used on the
+ ;; command line to explicitly select the TeX backend.
+ #t)
+
+</style-specification-body>
+</style-specification>
+
+<external-specification id="print-stylesheet" document="print-ss">
+
+</style-sheet>
+
+
More information about the wine-cvs
mailing list