Skip to content

Commit

Permalink
Merge branch 'release/v0.7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr committed Mar 10, 2018
2 parents 005f344 + d70aa80 commit 5ca96df
Show file tree
Hide file tree
Showing 25 changed files with 277 additions and 458 deletions.
8 changes: 8 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Problem


## Expected Behaviour


## See Also

5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixes # .

Changes proposed in this pull request:
*

3 changes: 3 additions & 0 deletions .hgignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ build/*
build-20??????/*
test-output/*
tmp/

*.zip
*.tar.*
7 changes: 0 additions & 7 deletions .hgflow

This file was deleted.

1 change: 0 additions & 1 deletion .hgsigs

This file was deleted.

46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: python
python:
- '3.6'

env:
global:
- VERSION=$(git describe)

before_install:
- echo "TRAVIS_TAG=$TRAVIS_TAG"
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH"
- echo "TRAVIS_COMMIT=$TRAVIS_COMMIT"
- echo "TRAVIS_COMMIT_MESSAGE=$TRAVIS_COMMIT_MESSAGE"
- echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"

install:
- sudo apt-get update -q
- sudo apt-get install xsltproc
- sudo apt-get install libsaxon-java libxml-commons-resolver1.1-java libsaxon-java libxerces2-java
- sudo apt-get install trang jing
- sudo apt-get install python3 python3-lxml

script:
- ./bin/buildbook.py -v --archive

before_deploy:
- git config --local user.name "Travis CI"
- git config --local user.email "[email protected]"

deploy:
provider: releases
api_key:
secure: e3VKJ/VJiwrE+n/g1gITroGq/1II+vgp2A89xjtKmzwfIALUm098iTBXAGzEhzWeg+aP4R0vBNk/Ud7H2Ehxg7iJfYx7Vo16EJGpeo8maXakaTtXBGEPXpxW1UGQ35DZ0uNsJLEEMRE8jSjCe9sQDRIkUEfK58uAg1+I0T/C1Z26xlfB9luROiyOj1dNvF6V90vBybn5SmHVgAomRSPbFtVYXyr60aEb6S/eOOJD84kRvIPrrdY48DiiX+1LX7BTkdcP+wHCi6XHNN4pWT48h1BmP2SCPJvMqDIfak3d7abyk+oUdPG/dopicVWftjH+6yedHaPkdQyxLCRUxpzyUKtHxHSTpEEJ9Foa89JSTdZocAUBEFhFshESvVMBxGuLDdng+2lWgd1QnxzmzOQTmUYVhi5NKttfrrXmzqE+YnTmgQd5wJQWJLbkvZENSFmrE+fxZkeEHaiC3tSvR0Q3sIjZY87gAE1HWsB1r9Bu97k96rnoTWaHCGxRJ4smRPS0PY7gTAfHFntmyCYtKi7H0NAAZRIxkbP156WTFGQgkK8zQqzLAPCrJ4XzQokoiqDMK3jZOMcaOg5RIXsu+8/McjQ33511vshl4MdYZDbnkWhaSuEQG6+Prnx0/d9ziJSHRETQLwxjba/u5XD7ryVc7gVXau0r4l7Yh3ON3YHqF/w=
file:
- DBCookBook-$VERSION-html.tar.bz2
- DBCookBook-$VERSION-html.zip
skip_cleanup: true
on:
branch: master
tags: true
repo: tomschr/dbcookbook

notifications:
email:
on_success: change
on_failure: change
12 changes: 12 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sat Mar 10 23:25:00 UTC 2018 - [email protected]

Version 0.7.3 Work on infrastructure:

* Create issue template (#20)
* First draft of .travis.yml (#18 and #22)
* Create archives (#16)
* Move to GitHub (#15)
* Add horizontal scrollbar for HTML program listings (#4)
* Fix XPath in structure/remove-blocks-in-para/move-blocks-outof-para.xsl (#1)

-------------------------------------------------------------------
Sun May 21 22:08:00 UTC 2017 - [email protected]

Expand Down
484 changes: 94 additions & 390 deletions DocBook-Cookbook.xpr

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions LICENSE
45 changes: 5 additions & 40 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
===================================
Welcome to "The DoCookBook"
===================================
:Info: See https://github/tomschr/doccookbook
:Info: See https://github/tomschr/dbcookbook
:Author: Thomas Schraitle <tom_schr AT web DOT de>
:Description: Short overview of this project
:Description: Cookbook for DocBook and DocBook XSL stylesheets
:HTML: http://doccookbook.sourceforge.net


License
Expand Down Expand Up @@ -89,49 +90,13 @@ to improve the book? Great! If you want to contribute to the book, you can
do it in different ways:

* Write me a mail to <tom_schr (AT) web.de> and send me your comments
* Extend the tickets (Ideas for New Topics) at http://github/tomschr/doccookbook/issues
* Clone my repository on Sourcforge and send me patches
* Extend the tickets (Ideas for New Topics) at http://github/tomschr/dbcookbook/issues
* Clone this repository and send me patches

This repository uses `git flow` from https://github.com/petervanderdoes/gitflow-avh
see `Vincent Driessen Git branching model <http://nvie.com/posts/a-successful-git-branching-model/>`_


Here is a procedure about how to clone the repository:

1. Download Mercurial from http://mercurial.selenic.com and install it on your system.

2. Clone my Sourceforge repository with the Mercurial command hg::

$ hg clone http://hg.code.sf.net/p/doccookbook/code dbcookbook

3. Install `hg flow` from above URL and enter::

$ hg flow init

4. Create a new feature branch by using::

$ hg flow feature start FEATURE_NAME

5. If you want to create a new topic, decide in which chapter it could belong (markup, common customizations, structure, fo, html, or any other). For example, if you want an addition to DocBook´s structure chapter, use the existing template and copy it (where 'FOO' is an abstract term; replace it with something meaningful)::

$ hg copy en/xml/topic.empty.xml en/xml/structure/topic.FOO.xml

6. Open the XML file which contains a chapter element. In our example, it would be en/xml/dbc-structure.xml. Scroll to the <xi:include> elements and insert the following code::

<xi:include href="structure/topic.foo.xml"/>

7. Open the XML file en/xml/structure/topic.foo.xml and write your topic.

8. When you are finished, publish your feature branch::

$ hg flow feature publish FEATURE_NAME

9. Create a pull request.



Find more information about Mercurial at http://mercurial.selenic.com/.


How to build the book
---------------------
Expand Down
3 changes: 3 additions & 0 deletions bin/buildbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from dbcookbook.env import initenv
from dbcookbook.formats import html
from dbcookbook.categories import resolvecategories
from dbcookbook.zip import createzip

_abspath=os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))+"/"

Expand All @@ -35,6 +36,7 @@ def main():
initenv(*parserobj)
resolvecategories(*parserobj)
html(*parserobj)
createzip(*parserobj)

return parserobj

Expand Down Expand Up @@ -64,6 +66,7 @@ def __test():
if obj[1].test:
internaltest()

logger.info("Success!")
logger.debug("{line} END {line}".format(**locals()))

# EOF
5 changes: 5 additions & 0 deletions bin/dbcookbook/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def parsecommandline():
type=int,
default=1,
)
parser.add_argument('-A', '--archive',
help="Create compressed files of the HTML build (default: %(default)s)",
action='store_true',
default=False,
)
parser.add_argument('mainfile',
help="Use main XML file (default: %(default)s)",
default=MAINFILE,
Expand Down
7 changes: 6 additions & 1 deletion bin/dbcookbook/dbcookbook.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ project=doccookbook
site=frs.sourceforge.net
path=/home/frs/project/${project}

[Archive]
zipfile=DBCookBook-@[email protected]
tarfile=DBCookBook-@[email protected]
root=DBCookBook-@VERSION@

[XSLT1]
dir=${Common:basexslt1}
commondir=${dir}common/
Expand All @@ -58,4 +63,4 @@ cssdir=${dir}css/
jsdir=${Common:origxslt2dir}js/


# EOF
# EOF
70 changes: 70 additions & 0 deletions bin/dbcookbook/zip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#
#

from configparser import InterpolationMissingOptionError
from pathlib import Path
import os
import shlex
import subprocess
import tarfile
import zipfile

try:
import zlib
compression = zipfile.ZIP_DEFLATED
except:
compression = zipfile.ZIP_STORED

from .config import config
from .log import trace, logger


def createzip(parser, args=None):
if args is not None and not args.archive:
logger.info("Skipping compressed archive creation")
return

# TODO: maybe there is a better method:
version = subprocess.check_output(shlex.split("git describe"))
version = version.decode("utf-8").strip()

logger.info("** Creating Archives **")
try:
zipfilename = config.get('Archive', 'zipfile').replace("@VERSION@", version)
tarfilename = config.get('Archive', 'tarfile').replace("@VERSION@", version)
root = os.path.normpath(config.get('Archive', 'root')).replace("@VERSION@", version)
htmldir = os.path.normpath(config.get('Common', 'htmldir'))
except InterpolationMissingOptionError as error:
logger.warning(error)

logger.info("Creating ZIP archive %r...", zipfilename)
logger.info("Creating Tar archive %r...", tarfilename)
logger.info("root=%r", root)
logger.info("htmldir=%r", htmldir)

MODES = {'.gz': 'w:gz',
'.bz2': 'w:bz2',
'.xz': 'w:xz'}
writemode = MODES.get(os.path.splitext(tarfilename)[-1], 'w')
logger.info("Using mode=%s for tar archive", writemode)

with zipfile.ZipFile(zipfilename, mode="w", compression=compression) as zf, \
tarfile.open(tarfilename, mode=writemode, dereference=True) as tf:
path = Path(htmldir)
PATHS=('*.html', 'css/*', 'highlighter/*', 'js/*')
for p in PATHS:
for pp in path.glob(p):
dest = root / pp.relative_to(htmldir)
zf.write(str(pp), arcname=str(dest))
tf.add(str(pp), arcname=str(dest), recursive=False)
logger.info("Adding %r...", str(dest))

PATHS=('examples/**/*', 'png/**/*', )
for p in PATHS:
for pp in path.rglob(p):
dest = root / pp.relative_to(htmldir)
zf.write(str(pp), arcname=str(dest))
tf.add(str(pp), arcname=str(dest), recursive=False)
logger.info("Adding %r...", str(dest))

logger.info("Successfully created archives")
2 changes: 1 addition & 1 deletion en/xml/dbc-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<title>Common Customizations</title>
<info>
<definitions definitionfile="defs.xml"/>
<biblioid class="other" otherclass="ticket">20</biblioid>
<biblioid class="other" otherclass="ticket">7</biblioid>
<keywordset>
<keyword>common customizations</keyword>
</keywordset>
Expand Down
2 changes: 1 addition & 1 deletion en/xml/dbc-fo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<title>Print Customizations</title>
<info>
<definitions definitionfile="defs.xml"/>
<biblioid class="other" otherclass="ticket">22</biblioid>
<biblioid class="other" otherclass="ticket">9</biblioid>
<keywordset>
<keyword>fo customizations</keyword>
<keyword>print</keyword>
Expand Down
2 changes: 1 addition & 1 deletion en/xml/dbc-html.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<title>(X)HTML Customizations</title>
<info>
<definitions definitionfile="defs.xml"/>
<biblioid class="other" otherclass="ticket">23</biblioid>
<biblioid class="other" otherclass="ticket">10</biblioid>
<keywordset>
<keyword>html customizations</keyword>
<keyword>online</keyword>
Expand Down
2 changes: 1 addition & 1 deletion en/xml/dbc-markup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<title>Knowing DocBook’s Structure</title>
<info>
<definitions definitionfile="defs.xml"/>
<biblioid class="other" otherclass="ticket">19</biblioid>
<biblioid class="other" otherclass="ticket">6</biblioid>
<keywordset>
<keyword>docbook markup</keyword>
</keywordset>
Expand Down
2 changes: 1 addition & 1 deletion en/xml/dbc-structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<info>
<definitions definitionfile="defs.xml"/>
<biblioid class="other" otherclass="ticket">21</biblioid>
<biblioid class="other" otherclass="ticket">8</biblioid>
<keywordset>
<keyword>docbook structure</keyword>
</keywordset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
select="following-sibling::*[&dbselfblocks;][1]"/>
</xsl:template>

<xsl:template match="d:para/*|d:para/text()" mode="copy">
<xsl:template match="d:para/node()" mode="copy">
<xsl:copy-of select="."/>
<xsl:if test="not(following-sibling::node()[1][&dbselfblocks;])">
<xsl:apply-templates select="following-sibling::node()[1]"
Expand Down
11 changes: 5 additions & 6 deletions frameworks/xslt/xhtml/navigation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,14 @@
<table width="100%" class="userfooter">
<tbody>
<tr>
<td><a href="{$base.project.url}">Project @Sourceforge.net®</a></td>
<td>
<td><a href="{$base.project.url}">Project@GitHub</a></td>
<td></td>
<td align="right">
<xsl:if test="$ticketnr">
<a href="{concat($ticket.url, $ticketnr, '/')}"
title="Ticket#{$ticketnr}">Ticket#<xsl:value-of
select="$ticketnr"/></a>
<a href="{concat($ticket.url, $ticketnr, '/')}"
title="Issue#{$ticketnr}">Issue#<xsl:value-of select="$ticketnr"/></a>
</xsl:if>
</td>
<td align="right"><a href="{$base.code.url}">Code @Sourceforge.net®</a></td>
</tr>
</tbody>
</table>
Expand Down
8 changes: 4 additions & 4 deletions frameworks/xslt/xhtml/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<!--<xsl:param name="css.decoration" select="0"/>-->
<!-- base.url and base.url.path are used for Dublin Core metadata: -->
<xsl:param name="base.url">http://doccookbook.sf.net</xsl:param>
<xsl:param name="base.project.url">http://sf.net/projects/doccookbook/</xsl:param>
<xsl:param name="base.code.url">http://sourceforge.net/p/doccookbook/code</xsl:param>
<xsl:param name="base.url">https://github.com/tomschr/dbcookbook</xsl:param>
<xsl:param name="base.project.url">https://github.com/tomschr/dbcookbook</xsl:param>
<xsl:param name="base.code.url">https://github.com/tomschr/dbcookbook</xsl:param>
<xsl:param name="base.url.path">/html/en/</xsl:param>

<xsl:param name="base.dir">build/tmp/</xsl:param>
Expand Down Expand Up @@ -52,7 +52,7 @@
<xsl:param name="section.autolabel.max.depth">1</xsl:param>

<xsl:param name="table.borders.with.css" select="0"/>
<xsl:param name="ticket.url">https://sf.net/p/doccookbook/tickets/</xsl:param>
<xsl:param name="ticket.url">https://github.com/tomschr/dbcookbook/issues/</xsl:param>
<xsl:param name="toc.section.depth">1</xsl:param>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="ulink.target" select="0"/>
Expand Down
4 changes: 2 additions & 2 deletions frameworks/xslt/xhtml/titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@
mode="chapter.titlepage.recto.auto.mode">
<xsl:variable name="ticketnr" select="normalize-space(.)"/>
<div class="ticket">
<xsl:value-of select="concat('See also Ticket#', $ticketnr, ': ')"/>
<a href="{concat($ticket.url, $ticketnr, '/')}" title="Ticket#{$ticketnr}">
<xsl:value-of select="concat('See also Issue#', $ticketnr, ': ')"/>
<a href="{concat($ticket.url, $ticketnr, '/')}" title="Issue#{$ticketnr}">
<xsl:value-of select="concat($ticket.url, $ticketnr, '/')"/>
</a>
</div>
Expand Down
Loading

0 comments on commit 5ca96df

Please sign in to comment.