From 8cd560b2f3ba55a1ac45f4dcd859f8470897ffe4 Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 8 Jan 2014 17:18:07 +0100 Subject: Bring gtk-doc up to date. It should build again and be properly included with make dist. Based on nautilus-python changes, see below for the details. https://git.gnome.org/browse/nautilus-python/log/docs?h=nautilus-3.0 --- docs/Makefile.am | 38 ++++-- docs/xsl/common.xsl | 19 +++ docs/xsl/devhelp.xsl | 154 ++++++++++++++++++++++++ docs/xsl/fixxref.py | 67 +++++++++++ docs/xsl/html.xsl | 285 ++++++++++++++++++++++++++++++++++++++++++++ docs/xsl/pdf-style.xsl | 11 ++ docs/xsl/pdf.xsl | 259 ++++++++++++++++++++++++++++++++++++++++ docs/xsl/ref-html-style.xsl | 54 +++++++++ docs/xsl/style.css | 10 ++ 9 files changed, 886 insertions(+), 11 deletions(-) create mode 100644 docs/xsl/common.xsl create mode 100644 docs/xsl/devhelp.xsl create mode 100755 docs/xsl/fixxref.py create mode 100644 docs/xsl/html.xsl create mode 100644 docs/xsl/pdf-style.xsl create mode 100644 docs/xsl/pdf.xsl create mode 100644 docs/xsl/ref-html-style.xsl create mode 100644 docs/xsl/style.css (limited to 'docs') diff --git a/docs/Makefile.am b/docs/Makefile.am index 6416f94..d406f66 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -3,10 +3,10 @@ BUILDDIR = $(top_builddir)/docs REF_VERSION = $(VERSION) FULL_VERSION = $(VERSION) -HTML_STYLE = $(PYGOBJECT_DATADIR)/pygobject/xsl/ref-html-style.xsl -PDF_STYLE = $(PYGOBJECT_DATADIR)/pygobject/xsl/pdf-style.xsl +FIXXREF = $(srcdir)/xsl/fixxref.py +HTML_STYLE = $(srcdir)/xsl/ref-html-style.xsl -XMLFILES = \ +XML_FILES = \ reference/caja-python-ref.xml \ reference/caja-python-overview.xml \ reference/caja-python-overview-example.xml \ @@ -27,7 +27,7 @@ XMLFILES = \ reference/caja-python-operation-result.xml HTMLdir = $(datadir)/gtk-doc/html/caja-python -HTMLFILES = \ +HTML_FILES = \ html/index.html \ html/index.sgml \ html/caja-python-overview.html \ @@ -48,39 +48,55 @@ HTMLFILES = \ html/caja-python-enum-reference.html \ html/enum-caja-python-operation-result.html \ html/caja-python.devhelp +HTML_DATA = $(HTML_FILES) -CSS_FILES = $(PYGOBJECT_PYGDOCS)/style.css +XSL_FILES = \ + xsl/common.xsl \ + xsl/devhelp.xsl \ + xsl/html.xsl \ + xsl/pdf-style.xsl \ + xsl/pdf.xsl \ + xsl/style.css +XSL_DATA = $(XSL_FILES) $(FIXXREF) +XSLdir = $(BUILDDIR)/xsl + +CSS_FILES = xsl/style.css CSSdir = $(HTMLdir) CSS_DATA = $(CSS_FILES) BUILT_SOURCES = \ reference/builddate.xml \ - $(HTMLFILES) + $(HTML_FILES) CLEANFILES = \ caja-python-ref.* \ reference/builddate.xml \ - $(HTMLFILES) + $(HTML_FILES) EXTRA_DIST = \ - $(XMLFILES) + $(XML_FILES) \ + $(XSL_FILES) \ + $(FIXXREF) \ + $(HTML_STYLE) REFERENCE_DEPS = \ reference \ - $(XMLFILES) + $(XML_FILES) \ + $(XSL_FILES) \ + $(FIXXREF) if ENABLE_GTK_DOC reference/builddate.xml: $(REFERENCE_DEPS) $(PYTHON) -c 'import datetime; print datetime.date.today()' > $@ -$(HTMLFILES): $(REFERENCE_DEPS) +$(HTML_FILES): $(REFERENCE_DEPS) xsltproc --nonet --xinclude -o $(BUILDDIR)/html/ \ --path $(BUILDDIR)/reference:$(srcdir)/reference \ --stringparam gtkdoc.bookname "caja-python" \ --stringparam gtkdoc.version ${REF_VERSION} \ $(HTML_STYLE) $(srcdir)/reference/caja-python-ref.xml - $(PYGOBJECT_FIXXREF) -i $(PYGOBJECT_PYGDOCS) $(BUILDDIR)/html + $(FIXXREF) -i xsl $(BUILDDIR)/html touch $@ endif diff --git a/docs/xsl/common.xsl b/docs/xsl/common.xsl new file mode 100644 index 0000000..606313f --- /dev/null +++ b/docs/xsl/common.xsl @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/docs/xsl/devhelp.xsl b/docs/xsl/devhelp.xsl new file mode 100644 index 0000000..ce27739 --- /dev/null +++ b/docs/xsl/devhelp.xsl @@ -0,0 +1,154 @@ + + + + + + + + + + + + book + + + .devhelp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + diff --git a/docs/xsl/fixxref.py b/docs/xsl/fixxref.py new file mode 100755 index 0000000..f3287b3 --- /dev/null +++ b/docs/xsl/fixxref.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- Mode: Python; py-indent-offset: 4 -*- + +import getopt +import os +import re +import sys + +anchors = {} +anchor_pat = re.compile(r'''^\s*''', + re.MULTILINE | re.VERBOSE) +link_pat = re.compile(r'''(.*?) + ''', re.DOTALL | re.VERBOSE) +def scan_index_dir(idir): + for root, dirs, files in os.walk(idir): + if 'index.sgml' in files: + scan_index_file(os.path.join(root, 'index.sgml')) + return + +def scan_index_file(ifile): + buf = open(ifile).read() + for id, href in anchor_pat.findall(buf): + anchors[id] = href + +def fix_xrefs(hdir): + for f in os.listdir(hdir): + if os.path.splitext(f)[1] == '.html': + fix_html_file(os.path.join(hdir, f)) + +def link_subst(m): + id, text = m.groups() + if anchors.has_key(id): + return '' + text + '' + return text + +def fix_html_file(hfile): + buf = open(hfile).read() + buf = link_pat.sub(link_subst, buf) + open(hfile, 'w').write(buf) + +def usage(e=None): + if e: + sys.stderr.write('fixxref.py: %s\n' % e) + sys.stderr.write('usage: fixxref.py [-i index-dir] html-dir\n') + sys.exit(1) + +if __name__ == '__main__': + try: + opts, args = getopt.getopt(sys.argv[1:], "i:h:", + ["index-dir=", "html-dir="]) + except getopt.error, e: + usage(e) + + index_dirs = [] + for opt, arg in opts: + if opt in ('-i', '--index-dir'): + index_dirs.append(arg) + + if len(args) != 1: + usage() + + for idir in index_dirs: + scan_index_dir(idir) + + html_dir = args[0] + fix_xrefs(html_dir) diff --git a/docs/xsl/html.xsl b/docs/xsl/html.xsl new file mode 100644 index 0000000..d8fea78 --- /dev/null +++ b/docs/xsl/html.xsl @@ -0,0 +1,285 @@ + + + +]> + + + +style.css + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
  + +  
+ -- + +  
+
+ + + + + +
+ +
+
+ +
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+      class 
+      
+      
+        (
+                )
+      
+      :&RE;
+
+      
+    
+
+ + + + + + + + , + + + + + + + + + +   + + + + + + , + + + + + + + + + , + + + + + + + + + , + + + + + + + + +      + + + + + + + + +   + + + + + + +   + + + + + + = + + + + + + + void  + + + + + + + + + + + + , + + + + + + + + + + def + + ( + + ) + + + + + + + + + + ( + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
diff --git a/docs/xsl/pdf-style.xsl b/docs/xsl/pdf-style.xsl new file mode 100644 index 0000000..d4a8e02 --- /dev/null +++ b/docs/xsl/pdf-style.xsl @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/docs/xsl/pdf.xsl b/docs/xsl/pdf.xsl new file mode 100644 index 0000000..375ba40 --- /dev/null +++ b/docs/xsl/pdf.xsl @@ -0,0 +1,259 @@ + + + +]> + + + +0.5in + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + class + + + ( + + ) + +  : + + + + + &RE; + + + + + + + + + , + + + + + + +   + + + + + , + + + + + + + , + + + + + + + , + + + + + + +      + + + + + + + +   + + + + +   + + + + = + + + + + void  + + + + + + + + + , + + + + + + + + def + + ( + + ) + + + + + + + + + ( + + ) + + + + + + + + + + + + + diff --git a/docs/xsl/ref-html-style.xsl b/docs/xsl/ref-html-style.xsl new file mode 100644 index 0000000..380e6a6 --- /dev/null +++ b/docs/xsl/ref-html-style.xsl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + <ANCHOR id=" + + " href=" + + + / + + + "> + + + + + + + + + + + + + + + + + + + diff --git a/docs/xsl/style.css b/docs/xsl/style.css new file mode 100644 index 0000000..59abc74 --- /dev/null +++ b/docs/xsl/style.css @@ -0,0 +1,10 @@ +.programlisting { +font: monospace; +background-color: #E0E0E0; +padding: 5; +} + +pre.synopsis { +background-color: #E0E0E0; +padding: 5; +} -- cgit v1.2.1