Commit f1a7b073 authored by Tim Lunn's avatar Tim Lunn

New upstream version 1.28

parent c241bebb
......@@ -9,6 +9,7 @@ bin_SCRIPTS = \
gtkdoc-fixxref \
gtkdoc-mkdb \
gtkdoc-mkhtml \
gtkdoc-mkhtml2 \
gtkdoc-mkman \
gtkdoc-mkpdf \
gtkdoc-rebase \
......@@ -43,6 +44,7 @@ pylibdata_DATA = \
gtkdoc/md_to_db.py \
gtkdoc/mkdb.py \
gtkdoc/mkhtml.py \
gtkdoc/mkhtml2.py \
gtkdoc/mkman.py \
gtkdoc/mkpdf.py \
gtkdoc/rebase.py \
......@@ -85,6 +87,7 @@ CLEANFILES = \
gtkdoc-fixxrefc \
gtkdoc-mkdbc \
gtkdoc-mkhtmlc \
gtkdoc-mkhtml2c \
gtkdoc-mkmanc \
gtkdoc-mkpdfc \
gtkdoc-rebasec \
......@@ -97,6 +100,7 @@ CLEANFILES = \
gtkdoc/md_to_db.pyc \
gtkdoc/mkdb.pyc \
gtkdoc/mkhtml.pyc \
gtkdoc/mkhtml2.pyc \
gtkdoc/mkman.pyc \
gtkdoc/mkpdf.pyc \
gtkdoc/rebase.pyc \
......@@ -110,6 +114,7 @@ DISTCLEANFILES = \
gtkdocize \
gtkdoc-mkdb \
gtkdoc-mkhtml \
gtkdoc-mkhtml2 \
gtkdoc-mkman \
gtkdoc-mkpdf \
gtk-doc.pc \
......
......@@ -105,8 +105,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = gtk-doc.pc gtkdoc/config.py gtkdoc-check \
gtkdoc-depscan gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mkhtml \
gtkdoc-mkman gtkdoc-mkpdf gtkdoc-rebase gtkdoc-scan \
gtkdoc-scangobj gtkdocize
gtkdoc-mkhtml2 gtkdoc-mkman gtkdoc-mkpdf gtkdoc-rebase \
gtkdoc-scan gtkdoc-scangobj gtkdocize
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
......@@ -200,10 +200,11 @@ DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gtk-doc.pc.in \
$(srcdir)/gtkdoc-check.in $(srcdir)/gtkdoc-depscan.in \
$(srcdir)/gtkdoc-fixxref.in $(srcdir)/gtkdoc-mkdb.in \
$(srcdir)/gtkdoc-mkhtml.in $(srcdir)/gtkdoc-mkman.in \
$(srcdir)/gtkdoc-mkpdf.in $(srcdir)/gtkdoc-rebase.in \
$(srcdir)/gtkdoc-scan.in $(srcdir)/gtkdoc-scangobj.in \
$(srcdir)/gtkdocize.in $(top_srcdir)/build-aux/compile \
$(srcdir)/gtkdoc-mkhtml.in $(srcdir)/gtkdoc-mkhtml2.in \
$(srcdir)/gtkdoc-mkman.in $(srcdir)/gtkdoc-mkpdf.in \
$(srcdir)/gtkdoc-rebase.in $(srcdir)/gtkdoc-scan.in \
$(srcdir)/gtkdoc-scangobj.in $(srcdir)/gtkdocize.in \
$(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/install-sh \
......@@ -211,7 +212,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gtk-doc.pc.in \
$(top_srcdir)/build-aux/missing \
$(top_srcdir)/gtkdoc/config.py.in AUTHORS COPYING ChangeLog \
INSTALL NEWS README TODO build-aux/compile \
build-aux/config.guess build-aux/config.sub \
build-aux/config.guess build-aux/config.sub build-aux/depcomp \
build-aux/install-sh build-aux/ltmain.sh build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
......@@ -412,6 +413,7 @@ bin_SCRIPTS = \
gtkdoc-fixxref \
gtkdoc-mkdb \
gtkdoc-mkhtml \
gtkdoc-mkhtml2 \
gtkdoc-mkman \
gtkdoc-mkpdf \
gtkdoc-rebase \
......@@ -446,6 +448,7 @@ pylibdata_DATA = \
gtkdoc/md_to_db.py \
gtkdoc/mkdb.py \
gtkdoc/mkhtml.py \
gtkdoc/mkhtml2.py \
gtkdoc/mkman.py \
gtkdoc/mkpdf.py \
gtkdoc/rebase.py \
......@@ -483,6 +486,7 @@ CLEANFILES = \
gtkdoc-fixxrefc \
gtkdoc-mkdbc \
gtkdoc-mkhtmlc \
gtkdoc-mkhtml2c \
gtkdoc-mkmanc \
gtkdoc-mkpdfc \
gtkdoc-rebasec \
......@@ -495,6 +499,7 @@ CLEANFILES = \
gtkdoc/md_to_db.pyc \
gtkdoc/mkdb.pyc \
gtkdoc/mkhtml.pyc \
gtkdoc/mkhtml2.pyc \
gtkdoc/mkman.pyc \
gtkdoc/mkpdf.pyc \
gtkdoc/rebase.pyc \
......@@ -508,6 +513,7 @@ DISTCLEANFILES = \
gtkdocize \
gtkdoc-mkdb \
gtkdoc-mkhtml \
gtkdoc-mkhtml2 \
gtkdoc-mkman \
gtkdoc-mkpdf \
gtk-doc.pc \
......@@ -577,6 +583,8 @@ gtkdoc-mkdb: $(top_builddir)/config.status $(srcdir)/gtkdoc-mkdb.in
cd $(top_builddir) && $(SHELL) ./config.status $@
gtkdoc-mkhtml: $(top_builddir)/config.status $(srcdir)/gtkdoc-mkhtml.in
cd $(top_builddir) && $(SHELL) ./config.status $@
gtkdoc-mkhtml2: $(top_builddir)/config.status $(srcdir)/gtkdoc-mkhtml2.in
cd $(top_builddir) && $(SHELL) ./config.status $@
gtkdoc-mkman: $(top_builddir)/config.status $(srcdir)/gtkdoc-mkman.in
cd $(top_builddir) && $(SHELL) ./config.status $@
gtkdoc-mkpdf: $(top_builddir)/config.status $(srcdir)/gtkdoc-mkpdf.in
......
GTK-Doc 1.28 (Mar 24 2018)
==============
Bug fixes.
Changes
o 791928 : gtk-doc doesn't understand 'stability: Obsolete'
o 792148 : cmake: Installed GtkDocConfig.cmake has incorrect bindir path
o 792661 : use pygments to do syntax highlighing
o 793599 : Please run testsuite with V=0
o 794051 : rebase: fix on-line location extraction from devhelp files
o 794182 : private_header regex is broken
Contributors
Anders Jonsson
Arnaud Rebillout
Behdad Esfahbod
Bruce Mitchener
Daniel Mustieles
Marek Černocký
Rafael Fontenelle
Stefan Sauer
Tim-Philipp Müller
Tim Sabsch
GTK-Doc 1.27 (Dec 07 2017)
==============
......
......@@ -3,6 +3,17 @@ EXTRA_DIST = \
GtkDocConfigVersion.cmake.in \
GtkDocScanGObjWrapper.cmake
CLEANFILES = \
GtkDocConfig.cmake \
GtkDocConfigVersion.cmake
# Generate this here rather than via configure.ac so that
# bindir is substituted as an expanded path rather than
# using ${exec_prefix} as it would if substituted via
# configure.ac.
GtkDocConfig.cmake: GtkDocConfig.cmake.in
$(SED) -e 's|[@]bindir@|$(bindir)|g' < "$<" > "$@"
cmakedir = $(libdir)/cmake/GtkDoc
cmake_DATA = \
GtkDocConfig.cmake \
......
......@@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = GtkDocConfig.cmake GtkDocConfigVersion.cmake
CONFIG_CLEAN_FILES = GtkDocConfigVersion.cmake
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
......@@ -150,8 +150,8 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(cmakedir)"
DATA = $(cmake_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/GtkDocConfig.cmake.in \
$(srcdir)/GtkDocConfigVersion.cmake.in $(srcdir)/Makefile.in
am__DIST_COMMON = $(srcdir)/GtkDocConfigVersion.cmake.in \
$(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
......@@ -307,6 +307,10 @@ EXTRA_DIST = \
GtkDocConfigVersion.cmake.in \
GtkDocScanGObjWrapper.cmake
CLEANFILES = \
GtkDocConfig.cmake \
GtkDocConfigVersion.cmake
cmakedir = $(libdir)/cmake/GtkDoc
cmake_DATA = \
GtkDocConfig.cmake \
......@@ -345,8 +349,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
GtkDocConfig.cmake: $(top_builddir)/config.status $(srcdir)/GtkDocConfig.cmake.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
GtkDocConfigVersion.cmake: $(top_builddir)/config.status $(srcdir)/GtkDocConfigVersion.cmake.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
......@@ -442,6 +444,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
......@@ -534,6 +537,13 @@ uninstall-am: uninstall-cmakeDATA
.PRECIOUS: Makefile
# Generate this here rather than via configure.ac so that
# bindir is substituted as an expanded path rather than
# using ${exec_prefix} as it would if substituted via
# configure.ac.
GtkDocConfig.cmake: GtkDocConfig.cmake.in
$(SED) -e 's|[@]bindir@|$(bindir)|g' < "$<" > "$@"
-include $(top_srcdir)/git.mk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gtk-doc 1.27.
# Generated by GNU Autoconf 2.69 for gtk-doc 1.28.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc>.
#
......@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gtk-doc'
PACKAGE_TARNAME='gtk-doc'
PACKAGE_VERSION='1.27'
PACKAGE_STRING='gtk-doc 1.27'
PACKAGE_VERSION='1.28'
PACKAGE_STRING='gtk-doc 1.28'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc'
PACKAGE_URL=''
......@@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gtk-doc 1.27 to adapt to many kinds of systems.
\`configure' configures gtk-doc 1.28 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1451,7 +1451,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gtk-doc 1.27:";;
short | recursive ) echo "Configuration of gtk-doc 1.28:";;
esac
cat <<\_ACEOF
......@@ -1582,7 +1582,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gtk-doc configure 1.27
gtk-doc configure 1.28
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1860,7 +1860,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gtk-doc $as_me 1.27, which was
It was created by gtk-doc $as_me 1.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2727,7 +2727,7 @@ fi
# Define the identity of the package.
PACKAGE='gtk-doc'
VERSION='1.27'
VERSION='1.28'
cat >>confdefs.h <<_ACEOF
......@@ -13487,7 +13487,8 @@ else
fi
ac_config_files="$ac_config_files Makefile gtk-doc.pc cmake/Makefile cmake/GtkDocConfig.cmake cmake/GtkDocConfigVersion.cmake gtkdoc/config.py help/Makefile help/manual/Makefile tests/Makefile tests/annotations/Makefile tests/annotations/src/Makefile tests/annotations/docs/Makefile tests/bugs/Makefile tests/bugs/src/Makefile tests/bugs/docs/Makefile tests/empty/Makefile tests/empty/src/Makefile tests/empty/docs/Makefile tests/fail/Makefile tests/fail/src/Makefile tests/fail/docs/Makefile tests/gobject/Makefile tests/gobject/src/Makefile tests/gobject/docs/Makefile tests/program/Makefile tests/program/src/Makefile tests/program/docs/Makefile tests/repro/Makefile tests/repro/src/Makefile tests/repro/docs/Makefile"
# cmake/GtkDocConfig.cmake is handled in the Makefile, not here.
ac_config_files="$ac_config_files Makefile gtk-doc.pc cmake/Makefile cmake/GtkDocConfigVersion.cmake gtkdoc/config.py help/Makefile help/manual/Makefile tests/Makefile tests/annotations/Makefile tests/annotations/src/Makefile tests/annotations/docs/Makefile tests/bugs/Makefile tests/bugs/src/Makefile tests/bugs/docs/Makefile tests/empty/Makefile tests/empty/src/Makefile tests/empty/docs/Makefile tests/fail/Makefile tests/fail/src/Makefile tests/fail/docs/Makefile tests/gobject/Makefile tests/gobject/src/Makefile tests/gobject/docs/Makefile tests/program/Makefile tests/program/src/Makefile tests/program/docs/Makefile tests/repro/Makefile tests/repro/src/Makefile tests/repro/docs/Makefile"
ac_config_files="$ac_config_files gtkdoc-check"
......@@ -13500,6 +13501,8 @@ ac_config_files="$ac_config_files gtkdoc-mkdb"
ac_config_files="$ac_config_files gtkdoc-mkhtml"
ac_config_files="$ac_config_files gtkdoc-mkhtml2"
ac_config_files="$ac_config_files gtkdoc-mkman"
ac_config_files="$ac_config_files gtkdoc-mkpdf"
......@@ -14096,7 +14099,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gtk-doc $as_me 1.27, which was
This file was extended by gtk-doc $as_me 1.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -14153,7 +14156,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gtk-doc config.status 1.27
gtk-doc config.status 1.28
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......@@ -14559,7 +14562,6 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"gtk-doc.pc") CONFIG_FILES="$CONFIG_FILES gtk-doc.pc" ;;
"cmake/Makefile") CONFIG_FILES="$CONFIG_FILES cmake/Makefile" ;;
"cmake/GtkDocConfig.cmake") CONFIG_FILES="$CONFIG_FILES cmake/GtkDocConfig.cmake" ;;
"cmake/GtkDocConfigVersion.cmake") CONFIG_FILES="$CONFIG_FILES cmake/GtkDocConfigVersion.cmake" ;;
"gtkdoc/config.py") CONFIG_FILES="$CONFIG_FILES gtkdoc/config.py" ;;
"help/Makefile") CONFIG_FILES="$CONFIG_FILES help/Makefile" ;;
......@@ -14591,6 +14593,7 @@ do
"gtkdoc-fixxref") CONFIG_FILES="$CONFIG_FILES gtkdoc-fixxref" ;;
"gtkdoc-mkdb") CONFIG_FILES="$CONFIG_FILES gtkdoc-mkdb" ;;
"gtkdoc-mkhtml") CONFIG_FILES="$CONFIG_FILES gtkdoc-mkhtml" ;;
"gtkdoc-mkhtml2") CONFIG_FILES="$CONFIG_FILES gtkdoc-mkhtml2" ;;
"gtkdoc-mkman") CONFIG_FILES="$CONFIG_FILES gtkdoc-mkman" ;;
"gtkdoc-mkpdf") CONFIG_FILES="$CONFIG_FILES gtkdoc-mkpdf" ;;
"gtkdoc-rebase") CONFIG_FILES="$CONFIG_FILES gtkdoc-rebase" ;;
......@@ -15667,6 +15670,7 @@ ltmain=$ac_aux_dir/ltmain.sh
"gtkdoc-fixxref":F) chmod +x gtkdoc-fixxref ;;
"gtkdoc-mkdb":F) chmod +x gtkdoc-mkdb ;;
"gtkdoc-mkhtml":F) chmod +x gtkdoc-mkhtml ;;
"gtkdoc-mkhtml2":F) chmod +x gtkdoc-mkhtml2 ;;
"gtkdoc-mkman":F) chmod +x gtkdoc-mkman ;;
"gtkdoc-mkpdf":F) chmod +x gtkdoc-mkpdf ;;
"gtkdoc-rebase":F) chmod +x gtkdoc-rebase ;;
......
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
dnl Use a simple 2-digit version number for a while, since our old example
dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9.
dnl FIXME: I can't see anything failing (1.14.1), lets try to use a three digit
dnl number for the development version
m4_define(gtk_doc_version, 1.27)
dnl We're using a two digit number for the releases and
dnl a three digit number for the development version
m4_define(gtk_doc_version, 1.28)
AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])
......@@ -212,10 +210,10 @@ if test "x$have_yelp_tools" != "xyes"; then
fi
AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
# cmake/GtkDocConfig.cmake is handled in the Makefile, not here.
AC_CONFIG_FILES([Makefile
gtk-doc.pc
cmake/Makefile
cmake/GtkDocConfig.cmake
cmake/GtkDocConfigVersion.cmake
gtkdoc/config.py
help/Makefile
......@@ -250,6 +248,7 @@ AC_CONFIG_FILES([gtkdoc-depscan], [chmod +x gtkdoc-depscan])
AC_CONFIG_FILES([gtkdoc-fixxref], [chmod +x gtkdoc-fixxref])
AC_CONFIG_FILES([gtkdoc-mkdb], [chmod +x gtkdoc-mkdb])
AC_CONFIG_FILES([gtkdoc-mkhtml], [chmod +x gtkdoc-mkhtml])
AC_CONFIG_FILES([gtkdoc-mkhtml2], [chmod +x gtkdoc-mkhtml2])
AC_CONFIG_FILES([gtkdoc-mkman], [chmod +x gtkdoc-mkman])
AC_CONFIG_FILES([gtkdoc-mkpdf], [chmod +x gtkdoc-mkpdf])
AC_CONFIG_FILES([gtkdoc-rebase], [chmod +x gtkdoc-rebase])
......
......@@ -99,7 +99,7 @@ GTKDOC_LIBS=
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Comment this out if you want 'make check' to test you doc status
# Comment this out if you don't want 'make check' to test you doc status
# and run some sanity checks
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = \
......
......@@ -17,6 +17,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
####################################
# Everything below here is generic #
####################################
......
......@@ -5,8 +5,9 @@
version="1.0">
<!-- import the chunked XSL stylesheet -->
<!-- http://www.sagehill.net/docbookxsl/Chunking.html says we should use
"chunkfast.xsl", but I can see a difference -->
<!-- http://www.sagehill.net/docbookxsl/Chunking.html#FastChunking says we should use
"chunkfast.xsl", but I can't see a difference. Also it is not clear wheter
one should still set "chunk.fast". Again, no meassuable difference. -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
<xsl:include href="devhelp2.xsl"/>
<xsl:include href="version-greater-or-equal.xsl"/>
......
#!@PYTHON@
# -*- python; coding: utf-8 -*-
#
# gtk-doc - GTK DocBook documentation generator.
# Copyright (C) 2018 Stefan Sauer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
import argparse
import sys
sys.path.append('@PYTHON_PACKAGE_DIR@')
from gtkdoc import common, config, mkhtml2
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gtkdoc-mkhtml version %s - generate documentation in html format' % config.version)
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('args', nargs='*',
help='MODULE DRIVER_FILE')
# TODO: only for testing, replace with env-var
parser.add_argument('--uninstalled', action='store_true', default=False,
help='???')
options = parser.parse_args()
if len(options.args) != 2:
sys.exit('Too few arguments')
common.setup_logging()
sys.exit(mkhtml2.run(options))
......@@ -63,13 +63,12 @@ def setup_logging():
Set python log level to the value of the environment variable (DEBUG, INFO,
WARNING, ERROR and CRITICAL) or INFO if the environment variable is empty.
"""
log_level = os.environ.get('GTKDOC_TRACE')
log_level = os.environ.get('GTKDOC_TRACE', 'WARNING')
if log_level == '':
log_level = 'INFO'
if log_level:
logging.basicConfig(stream=sys.stdout,
level=logging.getLevelName(log_level.upper()),
format='%(asctime)s:%(filename)s:%(funcName)s:%(lineno)d:%(levelname)s:%(message)s')
log_level = 'WARNING'
logging.basicConfig(stream=sys.stdout,
level=logging.getLevelName(log_level.upper()),
format='%(asctime)s:%(filename)s:%(funcName)s:%(lineno)d:%(levelname)s:%(message)s')
# When redirecting the output on python2 or if run with a non utf-8 locale
# we get UnicodeEncodeError:
encoding = sys.stdout.encoding
......
version = "1.27"
version = "1.28"
# tools
dblatex = '/usr/bin/dblatex'
......
......@@ -55,13 +55,25 @@ NoLinks = {
'GInterface'
}
# Cache of dirs we already scanned for index files
DirCache = {}
def Run(options):
logging.info('options: %s', str(options.__dict__))
LoadIndicies(options.module_dir, options.html_dir, options.extra_dir)
ReadSections(options.module)
FixCrossReferences(options.module_dir, options.module, options.src_lang)
# TODO(ensonic): try to refactor so that we get a list of path's and then just
# loop over them.
# - module_dir is by default 'html'
# - html_dir can be set by configure, defaults to $(docdir)
def LoadIndicies(module_dir, html_dir, extra_dirs):
# Cache of dirs we already scanned for index files
dir_cache = {}
path_prefix = ''
m = re.search(r'(.*?)/share/gtk-doc/html', options.html_dir)
m = re.search(r'(.*?)/share/gtk-doc/html', html_dir)
if m:
path_prefix = m.group(1)
logging.info('Path prefix: %s', path_prefix)
......@@ -78,25 +90,25 @@ def Run(options):
Links['GFlags'] = dir + '/gobject/gobject-Enumeration-and-Flag-Types.html'
Links['GInterface'] = dir + '/gobject/GTypeModule.html'
if dir != options.html_dir:
if dir != html_dir:
logging.info('Scanning GLib directory: %s', dir)
ScanIndices(dir, (re.search(prefix_match, dir) is None))
ScanIndices(dir, (re.search(prefix_match, dir) is None), dir_cache)
path = os.environ.get('GNOME2_PATH')
if path:
for dir in path.split(':'):
dir += 'share/gtk-doc/html'
if os.path.exists(dir) and dir != options.html_dir:
if os.path.exists(dir) and dir != html_dir:
logging.info('Scanning GNOME2_PATH directory: %s', dir)
ScanIndices(dir, (re.search(prefix_match, dir) is None))
ScanIndices(dir, (re.search(prefix_match, dir) is None), dir_cache)
logging.info('Scanning HTML_DIR directory: %s', options.html_dir)
ScanIndices(options.html_dir, 0)
logging.info('Scanning MODULE_DIR directory: %s', options.module_dir)
ScanIndices(options.module_dir, 0)
logging.info('Scanning HTML_DIR directory: %s', html_dir)
ScanIndices(html_dir, False, dir_cache)
logging.info('Scanning MODULE_DIR directory: %s', module_dir)
ScanIndices(module_dir, False, dir_cache)
# check all extra dirs, but skip already scanned dirs or subdirs of those
for dir in options.extra_dir:
for dir in extra_dirs:
dir = dir.rstrip('/')
logging.info('Scanning EXTRA_DIR directory: %s', dir)
......@@ -104,18 +116,15 @@ def Run(options):
# prefix as the target directory of the docs, we need to use absolute
# directories for the links
if not dir.startswith('..') and re.search(prefix_match, dir) is None:
ScanIndices(dir, 1)
ScanIndices(dir, True, dir_cache)
else:
ScanIndices(dir, 0)
ReadSections(options)
FixCrossReferences(options)
ScanIndices(dir, False, dir_cache)
def ScanIndices(scan_dir, use_absolute_links):
if not scan_dir or scan_dir in DirCache:
def ScanIndices(scan_dir, use_absolute_links, dir_cache):
if not scan_dir or scan_dir in dir_cache:
return
DirCache[scan_dir] = 1
dir_cache[scan_dir] = 1
logging.info('Scanning index directory: %s, absolute: %d', scan_dir, use_absolute_links)
......@@ -148,7 +157,7 @@ gunzip %s
# Now recursively scan the subdirectories.
for subdir in subdirs:
ScanIndices(subdir, use_absolute_links)
ScanIndices(subdir, use_absolute_links, dir_cache)
def ReadDevhelp(file, use_absolute_links):
......@@ -181,8 +190,9 @@ def ReadDevhelp(file, use_absolute_links):
Links[m.group(2)] = dir + link
def ReadSections(options):
for line in common.open_text(options.module + '-sections.txt'):
def ReadSections(module):
"""We don't warn on missing links to non-public sysmbols."""
for line in common.open_text(module + '-sections.txt'):
m1 = re.search(r'^<SUBSECTION\s*(.*)>', line)
if line.startswith('#') or line.strip() == '':
continue
......@@ -204,18 +214,17 @@ def ReadSections(options):
NoLinks.add(common.CreateValidSGMLID(symbol))
def FixCrossReferences(options):
scan_dir = options.module_dir
def FixCrossReferences(module_dir, module, src_lang):
# TODO(ensonic): use glob.glob()?
for entry in sorted(os.listdir(scan_dir)):
full_entry = os.path.join(scan_dir, entry)
for entry in sorted(os.listdir(module_dir)):
full_entry = os.path.join(module_dir, entry)
if os.path.isdir(full_entry):
continue
elif entry.endswith('.html') or entry.endswith('.htm'):
FixHTMLFile(options, full_entry)
FixHTMLFile(src_lang, module, full_entry)
def FixHTMLFile(options, file):
def FixHTMLFile(src_lang, module, file):
logging.info('Fixing file: %s', file)
content = common.open_text(file).read()
......@@ -226,13 +235,13 @@ def FixHTMLFile(options, file):
# we could patch the customization to have <code class="xxx"> inside of <pre>
if config.highlight.endswith('vim'):
def repl_func(m):
return HighlightSourceVim(options, m.group(1), m.group(2))
return HighlightSourceVim(src_lang, m.group(1), m.group(2))
content = re.sub(
r'<div class=\"(example-contents|informalexample)\"><pre class=\"programlisting\">(.*?)</pre></div>',
repl_func, content, flags=re.DOTALL)
else:
def repl_func(m):
return HighlightSource(options, m.group(1), m.group(2))
return HighlightSource(src_lang, m.group(1), m.group(2))
content = re.sub(
r'<div class=\"(example-contents|informalexample)\"><pre class=\"programlisting\">(.*?)</pre></div>',
repl_func, content, flags=re.DOTALL)
......@@ -252,7 +261,7 @@ def FixHTMLFile(options, file):
def repl_func_with_ix(i):
def repl_func(m):
return MakeXRef(options, file, i + 1, m.group(1), m.group(2))
return MakeXRef(module, file, i + 1, m.group(1), m.group(2))
return repl_func
for i in range(len(lines)):
......@@ -269,7 +278,7 @@ def FixHTMLFile(options, file):
os.rename(new_file, file)
def MakeXRef(options, file, line, id, text):
def MakeXRef(module, file, line, id, text):
href = Links.get(id)
# This is a workaround for some inconsistency we have with CreateValidSGMLID
......@@ -286,7 +295,7 @@ def MakeXRef(options, file, line, id, text):
if href:
# if it is a link to same module, remove path to make it work uninstalled
m = re.search(r'^\.\./' + options.module + '/(.*)$', href)
m = re.search(r'^\.\./' + module + '/(.*)$', href)
if m:
href = m.group(1)
logging.info('Fixing link to uninstalled doc: %s, %s, %s', id, href, text)
......@@ -331,12 +340,12 @@ def MakeGtkDocLink(pre, symbol, post):
return pre + '<GTKDOCLINK HREF="' + id + '">' + symbol + '</GTKDOCLINK>' + post
def HighlightSource(options, type, source):
def HighlightSource(src_lang, type, source):
# write source to a temp file
# FIXME: use .c for now to hint the language to the highlighter
with tempfile.NamedTemporaryFile(mode='w+', suffix='.c') as f:
temp_source_file = HighlightSourcePreProcess(f, source)
highlight_options = config.highlight_options.replace('$SRC_LANG', options.src_lang)
highlight_options = config.highlight_options.replace('$SRC_LANG', src_lang)
logging.info('running %s %s %s', config.highlight, highlight_options, temp_source_file)
......@@ -364,15 +373,15 @@ def HighlightSource(options, type, source):
return HighlightSourcePostprocess(type, highlighted_source)
def HighlightSourceVim(options, type, source):
def HighlightSourceVim(src_lang, type, source):
# write source to a temp file
with tempfile.NamedTemporaryFile(mode='w+', suffix='.h') as f:
temp_source_file = HighlightSourcePreProcess(f, source)
# format source
# TODO(ensonic): use p.communicate()
script = "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|e %s|syn on|set syntax=%s|run! plugin/tohtml.vim|run! syntax/2html.vim|w! out.html|qa!' | " % (
temp_source_file, options.src_lang, temp_source_file)
script = "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|e %s|syn on|set syntax=%s|run! plugin/tohtml.vim|run! syntax/2html.vim|w! %s.html|qa!' | " % (
temp_source_file, src_lang, temp_source_file)
script += "%s -n -e -u NONE -T xterm >/dev/null" % config.highlight
subprocess.check_call([script], shell=True)
......
......@@ -603,7 +603,7 @@ def MarkDownParseSpanElements(text):
def EscapeEntities(text):
return text.replace('&', '&amp;').replace('<', '&lt;').replace('<', '&gt;')
return text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
def ReplaceEntities(text):
......@@ -629,7 +629,7 @@ def MarkDownOutputDocBook(blocksref, symbol, context):
blocks = blocksref
for block in blocks:
#$output += "\n<!-- beg type='" . $block->{"type"} . "'-->\n"
# $output += "\n<!-- beg type='" . $block->{"type"} . "'-->\n"
if block["type"] == "paragraph":
text = MarkDownParseSpanElements(block["text"])
......@@ -688,9 +688,9 @@ def MarkDownOutputDocBook(blocksref, symbol, context):
output += "<informalexample><screen><![CDATA[\n"
tag = "screen"
else:
output += "<informalexample><programlisting language=\"%s\"><![CDATA[\n" % block['language']
output += "<informalexample><programlisting role=\"example\" language=\"%s\"><![CDATA[\n" % block['language']
else:
output += "<informalexample><programlisting><![CDATA[\n"
output += "<informalexample><programlisting role=\"example\"><![CDATA[\n"
logging.debug('listing for %s: [%s]', symbol, '\n'.join(block['lines']))
for line in block["lines"]:
......@@ -703,7 +703,7 @@ def MarkDownOutputDocBook(blocksref, symbol, context):
else:
output += block["text"] + "\n"
#$output += "\n<!-- end type='" . $block->{"type"} . "'-->\n"
# $output += "\n<!-- end type='" . $block->{"type"} . "'-->\n"
return output
......
......@@ -235,6 +235,8 @@ def Run(options):
global MODULE, INLINE_MARKUP_MODE, DEFAULT_STABILITY, NAME_SPACE, \
DB_OUTPUT_DIR, doctype_header
logging.info('options: %s', str(options.__dict__))
# We should pass the options variable around instead of this global variable horror
# but too much of the code expects these to be around. Fix this once the transition is done.
MODULE = options.module
......@@ -454,7 +456,7 @@ def OutputDB(file, options):