Skip to content

Commit

Permalink
Merge branch 'release/2.1.5'
Browse files Browse the repository at this point in the history
Stable release DAPS 2.1.5:

* New Features:
  - parameters for text generation can be set in the config files
    via TXT_PARAMS or via --param/--stringparam on the command line
  - a change introduced in 2.0 made using the original DocBook
    stylesheets for text generation the default. Since this behavior
    is confusing and unexpected, it is reverted with this change:
    * the stylesheets configured via STYLEROOT or --styleroot are
      used by default for text generation
    * to ignore _any_ STYLEROOT definitions, set
      TXT_IGNORE_STYLEROOT="yes" in the config files or use
      --ignore-styleroot on the command line
      (daps -d <DC> text --ignore-styleroot)

* Bugfixes:
  - Fix for issue #294: xmlcatalog returns file:<PATH> rather than
    file://<PATH> on Debian Jessie and openSUSE Tumbleweed and
    caused DAPS to fail with DB5 sources

* Misc
  - added basic debugging output to test suite (--debug)
  • Loading branch information
fsundermeyer committed Dec 7, 2015
2 parents 6cf950a + 0284ea8 commit c468750
Show file tree
Hide file tree
Showing 10 changed files with 330 additions and 180 deletions.
66 changes: 49 additions & 17 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,43 +1,75 @@
-------------------------------------------------------------------
Mon Dec 07 14:43:47 UTC 2015 - [email protected]

Stable release DAPS 2.1.5:

* New Features:
- parameters for text generation can be set in the config files
via TXT_PARAMS or via --param/--stringparam on the command line
- a change introduced in 2.0 made using the original DocBook
stylesheets for text generation the default. Since this behavior
is confusing and unexpected, it is reverted with this change:
* the stylesheets configured via STYLEROOT or --styleroot are
used by default for text generation
* to ignore _any_ STYLEROOT definitions, set
TXT_IGNORE_STYLEROOT="yes" in the config files or use
--ignore-styleroot on the command line
(daps -d <DC> text --ignore-styleroot)

* Bugfixes:
- Fix for issue #294: xmlcatalog returns file:<PATH> rather than
file://<PATH> on Debian Jessie and openSUSE Tumbleweed and
caused DAPS to fail with DB5 sources

* Misc
- added basic debugging output to test suite (--debug)

-------------------------------------------------------------------
Tue Dec 02 13:01:00 UTC 2015 - [email protected]

Stable release DAPS 2.1.4:

Find issues in our GitHub tracker at https://github.com/openSUSE/daps/issues/NUMBER
Find issues in our GitHub tracker at
https://github.com/openSUSE/daps/issues/NUMBER

* Bugfixes:
- Target text shows remarks (issue #293)
- DAPS checklink doesn't work (issue #296)
- ASPELL_EXTRA_DICT from ~/.config/daps/dapsrc is ignored (issue #297)
- ASPELL_EXTRA_DICT from ~/.config/daps/dapsrc is ignored
(issue #297)
- DAPS package includes SUSE wordlist (issue #298)
- Parameter passed with --param is ignored with subcommand "text" (issue #299)
- Target locdrop does not generate graphics-setfiles-$(DOCNAME)$(LANGSTRING).tar.bz2
(issue #302)
- Parameter passed with --param is ignored with subcommand "text"
(issue #299)
- Target locdrop does not generate
graphics-setfiles-$(DOCNAME)$(LANGSTRING).tar.bz2 (issue #302)
- Translation check for locdrop (issue #306)
- Add --optipng to unpack-locdrop (issue #307)
- Add --xmlonly / --imgonly switches to list-srcfiles (issue #310)
- bigfile creates unresolved xrefs for DocBook5 (issue #314)
- Improve DocBook5 -> DocBook4 -> Novdoc Stylesheets (issue #311)
- Enhancements in user guide, thanks to Martin Koeditz (issue #315)
- FO contains wrong image paths when XML contains no profiling PI (issue #316)
- DB-4-to-5 migration: missing book titles/productnames/productnumbers
(issue #319)
- FO contains wrong image paths when XML contains no profiling PI
(issue #316)
- DB-4-to-5 migration: missing book
titles/productnames/productnumbers (issue #319)

* New Features:
- Option --schema lets you specify an URN to a DocBook 5 schema that is to
be used for validation. Will be ignored when validating Docbbok4 documents.
- DOCBOOK5_STYLE_URI, DOCBOOK5_STYLE_URI, and DOCBOOK4_STYLE_URI may now
also point to a local file. If the URN begins with the prefix "file://",
it will not be resolved via xmlcatalog, but rather taken as is (minus
"file://").
- Option --schema lets you specify an URN to a DocBook 5 schema that
is to be used for validation. Will be ignored when validating
Docbbok4 documents.
- DOCBOOK5_STYLE_URI, DOCBOOK5_STYLE_URI, and DOCBOOK4_STYLE_URI
may now also point to a local file. If the URN begins with the
prefix "file://", it will not be resolved via xmlcatalog, but
rather taken as is (minus "file://").
- Add conversion options to online-docs:
. --db5todb4: converts DocBook 5 sources to a DocBook 4 bigfile
. --db5todb4nh: converts DocBook 5 sources to a DocBook 4 bigfile without
a DOCTYPE declaration
. --db5todb4nh: converts DocBook 5 sources to a DocBook 4 bigfile
without a DOCTYPE declaration
. --dbtonovdoc: converts DocBook 4/5 to Novdoc

* Misc:
- Do not set -nocs, hurts us when building Arabic (related: issue #108)
- Do not set -nocs, hurts us when building Arabic
(related: issue #108)
- Avoid adding version attribute on all elements (commit 3a273d5)


Expand Down
30 changes: 19 additions & 11 deletions bin/daps.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ VARLIST=(
STYLEDEVEL
STYLEROOT
TARGET
TXT_USE_DBSTYLES
TXT_IGNORE_STYLEROOT
TXT_PARAMS
WH_SEARCH
VALID_ROOTELEMENTS
VERBOSITY
Expand Down Expand Up @@ -399,8 +400,8 @@ HELP_SUBCOMMAND+=("spellcheck=Spellchecks the file specified with --file or the
SUBCOMMANDS+=("stylecheck=stylecheck")
HELP_SUBCOMMAND+=("stylecheck=Performs a style check on the given DC-file or rootid.")

SUBCOMMANDS+=("text=build_generic")
HELP_SUBCOMMAND+=("text=Build an ASCII text document the from the XML sources.")
SUBCOMMANDS+=("text=build_text")
HELP_SUBCOMMAND+=("text=Build an ASCII text document the from the XML sources. Text output is\ngenerated by creating a single file HTML page parsing the result with w3m.")

SUBCOMMANDS+=("text-name=show_names")
HELP_SUBCOMMAND+=("text-name=Print the file name that would result when building an ASCII text document.")
Expand Down Expand Up @@ -1583,7 +1584,7 @@ DOCBOOK_VERSION=$($XSLTPROC --stylesheet "${DAPSROOT}/daps-xslt/common/get-docbo
if [[ 5 = "$DOCBOOK_VERSION" ]]; then
# resolve stylesheet URN
#
if [[ ${DOCBOOK5_STYLE_URI:0:7} = file:// ]]; then
if [[ ${DOCBOOK5_STYLE_URI:0:5} = file: ]]; then
DOCBOOK_STYLES="$DOCBOOK5_STYLE_URI"
else
DOCBOOK_STYLES=$(xmlcatalog "$XML_MAIN_CATALOG" \
Expand All @@ -1592,16 +1593,18 @@ if [[ 5 = "$DOCBOOK_VERSION" ]]; then
fi
# also get the RNG scheme location
#
if [[ ${DOCBOOK5_RNG_URI:0:7} = file:// ]]; then
if [[ ${DOCBOOK5_RNG_URI:0:5} = file: ]]; then
DOCBOOK5_RNG="$DOCBOOK5_RNG_URI"
else
DOCBOOK5_RNG=$(xmlcatalog "$XML_MAIN_CATALOG" \
"$DOCBOOK5_RNG_URI" 2>/dev/null) || \
exit_on_error "Could not determine the DocBook 5 schema location by resolving \"$DOCBOOK5_RNG_URI\" via xmlcatalog"
fi
# remove file:// prefix
# remove file:// or file: (Debian, Tumbleweed) prefix
# Is there a better way to do this with shell built-ins?
#
DOCBOOK5_RNG=${DOCBOOK5_RNG##*file://}
DOCBOOK5_RNG=${DOCBOOK5_RNG##*file:}
DOCBOOK5_RNG=${DOCBOOK5_RNG#*//}
#
# check if resulting path is valid
#
Expand All @@ -1618,7 +1621,7 @@ if [[ 5 = "$DOCBOOK_VERSION" ]]; then
elif [[ 4 = "$DOCBOOK_VERSION" ]]; then
# resolve stylesheet URN
#
if [[ ${DOCBOOK4_STYLE_URI:0:7} = file:// ]]; then
if [[ ${DOCBOOK4_STYLE_URI:0:5} = file: ]]; then
DOCBOOK_STYLES="$DOCBOOK4_STYLE_URI"
else
DOCBOOK_STYLES=$(xmlcatalog "$XML_MAIN_CATALOG" \
Expand All @@ -1628,18 +1631,23 @@ elif [[ 4 = "$DOCBOOK_VERSION" ]]; then
else
exit_on_error "Fatal: Could not determine the DocBook version from $MAIN. Looks like $MAIN is not a DocBook 4/5 document."
fi
#
# remove the file:// string from the styles

# remove the file:// or file: (Debian, Tumbleweed) string from the styles
# use ##*file:// rather than #file:// because sometimes xmlcatalog also outputs
# warnings to stdout which we would like to ignore. Fortunately the file:// url
# is always the last string
#
DOCBOOK_STYLES=${DOCBOOK_STYLES##*file://}
# Is there a better way to do this with shell built-ins?
#
DOCBOOK_STYLES=${DOCBOOK_STYLES##*file:}
DOCBOOK_STYLES=${DOCBOOK_STYLES#*//}
DOCBOOK_STYLES=${DOCBOOK_STYLES%/}

#
# Check resulting path
#
[[ -d "$DOCBOOK_STYLES" ]] || exit_on_error "DOCBOOK4_STYLE_URI or DOCBOOK5_STYLE_URI points to a non-existing directory \"$DOCBOOK_STYLES\"."

# ...and export
export DOCBOOK_STYLES DOCBOOK5_RNG DOCBOOK_VERSION

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dnl

m4_define(daps_version_major, 2)
m4_define(daps_version_minor, 1)
m4_define(daps_version_micro, [4])
m4_define(daps_version_micro, [5])
# API version
m4_define([daps_api_version],[daps_version_major])

Expand Down
62 changes: 52 additions & 10 deletions etc/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ DIA_OPTIONS="-t cairo-svg"
# There should be no need to change this entry
# Note:
# URI _must_ end with a "/", otherwise it will not be resolved on Ubuntu
# WARNING:
# This value needs to point to the original DocBook stylesheets. It will
# ensure that there always is a fallback in case the stylesheets specified
# elsewhere do not provide the requested output format. These styles are
# also used to generate text output. Only change if the default value
# cannot be resolved by xmlcatalog.
#
DOCBOOK4_STYLE_URI="http://docbook.sourceforge.net/release/xsl/current/"

Expand All @@ -192,6 +198,13 @@ DOCBOOK4_STYLE_URI="http://docbook.sourceforge.net/release/xsl/current/"
# Note:
# URI _must_ end with a "/", otherwise it will not be resolved on Ubuntu
#
# WARNING:
# This value needs to point to the original DocBook stylesheets. It will
# ensure that there always is a fallback in case the stylesheets specified
# elsewhere do not provide the requested output format. These styles are
# also used to generate text output. Only change if the default value
# cannot be resolved by xmlcatalog.
#
DOCBOOK5_STYLE_URI="http://docbook.sourceforge.net/release/xsl-ns/current/"

## Key: DOCBOOK5_RNG_URI
Expand Down Expand Up @@ -672,24 +685,53 @@ STYLEDEVEL=""
# directory here. The DocBook stylesheets will be used as a fallback in case
# styles are not defined for all output formats.
#
# See also FALLBACK_STYLEROOT
# See also: FALLBACK_STYLEROOT
#
STYLEROOT=""

## Key: TXT_USE_DBSTYLES
## -------------------
## Description: Always use original DocBook stylesheets for text output?
## Key: TXT_IGNORE_STYLEROOT
## ---------------------------------
## Description: Ignore styleroot and rather use the original DocBook
## stylesheets for text output?
## Type: yesno
## Default: "yes"
## Default: "no"
#
# Text output is generated by creating a single file HTML page parsing
# the result with w3m. This ensures that e.g. tables are properly
# displayed in the .txt file. Default is to use the original DocBook
# stylesheets to generate the HTML that is used to create the text files. If
# you prefer to use your own stylesheets (STYLEROOT/xhtml/docsbook.xsl) set
# this variable to "no".
# displayed in the .txt file. Default is to use the stylesheets provided
# via STYLEROOT or --styleroot to build the HTML. Set this option to
# "yes" to ignore the STYLEROOT and to use the original DocBook
# stylesheets instead.
#
# NOTE: This will aslo work if STYLEROOT points to the original
# DocBook stylesheets.
#
# See also: TXT_PARAMS
#
TXT_USE_DBSTYLES="yes"
TXT_IGNORE_STYLEROOT="no"


## Key: TXT_PARAMS
## -------------------
## Description: XSL paramters for text file generation
## Type: string
## Default: '--param="generate.permalinks=0" --param="section.autolabel=1" --param="section.label.includes.component.label=2"'
#
# Text output is generated by creating a single file HTML page parsing
# the result with w3m. This ensures that e.g. tables are properly
# displayed in the .txt file. This configuration option can be used to set
# custom XSL parameters - the HTML stylesheets are not necessarily
# configured in a way that is suitable for text output.
# The default value for TXT_PARAMS turns on labelling and makes sure
# admonitions have a text label. Other parameters turn off stuff that is
# of no use in text output.
# For a reference of all HTML parameters refer to
# http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html
#
# NOTE: Make sure to use single quotes to quote the complete string, since it
# contains double quotes
#
TXT_PARAMS='--param="admon.textlabel=1" --param="section.autolabel=1" --param="section.label.includes.component.label=2" --param="optimize.plain.text=1"'

## Key: VALID_ROOTELEMENTS
## --------------------
Expand Down
Loading

0 comments on commit c468750

Please sign in to comment.