Merge branch 'debian-experimental'
Samuel Thibault
2 years ago
0 | name: Make check | |
1 | ||
2 | on: | |
3 | push: | |
4 | branches: [ master ] | |
5 | pull_request: | |
6 | branches: [ master ] | |
7 | ||
8 | env: | |
9 | LIBLOUIS_VERSION: 3.17.0 | |
10 | ||
11 | jobs: | |
12 | build: | |
13 | name: Build with liblouis master | |
14 | ||
15 | runs-on: ubuntu-latest | |
16 | ||
17 | steps: | |
18 | - uses: actions/checkout@v2 | |
19 | - name: Install dependencies | |
20 | run: sudo apt-get update -qq && sudo apt-get install -y texinfo libxml2-dev libxml2 openjdk-8-jdk | |
21 | - name: Fetch and build liblouis | |
22 | run: | | |
23 | wget https://github.com/liblouis/liblouis/archive/master.tar.gz | |
24 | tar -xf master.tar.gz | |
25 | ( cd liblouis-* && ./autogen.sh && ./configure && make && sudo make install ) | |
26 | sudo ldconfig | |
27 | - name: Autogen && configure | |
28 | run: | | |
29 | ./autogen.sh | |
30 | ./configure | |
31 | - name: make | |
32 | run: make | |
33 | - name: make check | |
34 | run: make check | |
35 | - name: Store the test suite log | |
36 | if: ${{ always() }} # store the test suite log even if the tests failed | |
37 | uses: actions/upload-artifact@v2 | |
38 | with: | |
39 | name: test-suite-liblouis-master.log | |
40 | path: tests/test-suite.log | |
41 | ||
42 | build-stable: | |
43 | name: Build with liblouis stable | |
44 | ||
45 | runs-on: ubuntu-latest | |
46 | ||
47 | steps: | |
48 | - uses: actions/checkout@v2 | |
49 | - name: Install dependencies | |
50 | run: sudo apt-get update -qq && sudo apt-get install -y texinfo libxml2-dev libxml2 openjdk-8-jdk | |
51 | - name: Fetch and build liblouis | |
52 | run: | | |
53 | wget https://github.com/liblouis/liblouis/releases/download/v${LIBLOUIS_VERSION}/liblouis-${LIBLOUIS_VERSION}.tar.gz | |
54 | tar -xf liblouis-*.tar.gz | |
55 | ( cd liblouis-${LIBLOUIS_VERSION} && ./configure && make && sudo make install ) | |
56 | sudo ldconfig | |
57 | - name: Autogen && configure | |
58 | run: | | |
59 | ./autogen.sh | |
60 | ./configure | |
61 | - name: make | |
62 | run: make | |
63 | - name: make check | |
64 | run: make check | |
65 | - name: Store the test suite log | |
66 | if: ${{ always() }} # store the test suite log even if the tests failed | |
67 | uses: actions/upload-artifact@v2 | |
68 | with: | |
69 | name: test-suite-liblouis-stable.log | |
70 | path: tests/test-suite.log | |
71 |
22 | 22 | config.status |
23 | 23 | configure |
24 | 24 | |
25 | build-aux/ar-lib | |
25 | 26 | build-aux/compile |
26 | 27 | build-aux/config.guess |
27 | 28 | build-aux/config.sub |
59 | 60 | liblouisutdml/stamp-h1 |
60 | 61 | |
61 | 62 | liblouisutdml-*.tar.gz |
63 | liblouisutdml-*.zip | |
62 | 64 | |
63 | 65 | libtool |
64 | 66 |
0 | # define liblouisutdml so that Travis CI service can build and test it | |
1 | ||
2 | sudo: enabled | |
3 | dist: trusty | |
4 | ||
5 | language: c | |
6 | ||
7 | compiler: | |
8 | - gcc | |
9 | ||
10 | # make sure we have libxml and java (for jni.h). Texinfo is needed to | |
11 | # build the documentation. | |
12 | before_install: | |
13 | - sudo apt-get update -qq | |
14 | - sudo apt-get install -y texinfo libxml2-dev libxml2 openjdk-6-jdk | |
15 | ||
16 | # let's have two parallel builds. One with stable liblouis and one | |
17 | # with bleeding edge liblouis | |
18 | env: | |
19 | - LIBLOUIS_VERSION=3.15.0 | |
20 | - LIBLOUIS_VERSION=master | |
21 | ||
22 | script: ./scripts/run-tests.sh | |
23 | ||
24 | after_failure: | |
25 | - cat tests/test-suite.log | |
26 | - cat tests/run_test_suite.sh.log | |
27 | ||
28 | # tell the irc channel about the results of the build | |
29 | notifications: | |
30 | irc: "irc.oftc.net#liblouis" |
0 | liblouisutdml 2.9.0 has been released | |
0 | liblouisutdml 2.10.0 has been released | |
1 | 1 | |
2 | 2 | The liblouis developer team is proud to announce the liblouisutdml |
3 | release 2.9.0. The release is available for download at: | |
3 | release 2.10.0. The release is available for download at: | |
4 | 4 | |
5 | 5 | https://github.com/liblouis/liblouisutdml/releases |
6 | 6 | |
16 | 16 | Noteworthy changes in this release |
17 | 17 | ================================== |
18 | 18 | |
19 | This Liblouisutdml release fixes a couple of bugs and adds support for | |
20 | liblouis 3.15. | |
19 | This minor Liblouisutdml release improves the documentation and improves | |
20 | the build and test infrastructure. It also adds support for liblouis | |
21 | 3.17. | |
21 | 22 | |
22 | 23 | For a detailed list of all the changes refer to the list of closed |
23 | 24 | issues [2]_. |
25 | 26 | New features |
26 | 27 | ------------ |
27 | 28 | |
28 | - Add support for liblouis 3.15 | |
29 | ||
30 | Bug fixes | |
31 | --------- | |
32 | ||
33 | - Fix a buffer overflow thanks to Samuel Thibault | |
34 | - Fix a typo in ``make_makefile.c`` thanks to Arend Arends | |
35 | - Fix a few bugs in the windows make file generator thanks to Christian | |
36 | Egli | |
29 | - Add support for liblouis 3.17 | |
37 | 30 | |
38 | 31 | Other |
39 | 32 | ----- |
40 | 33 | |
41 | - Improvements to the help screen thanks to Sebastian Humenda | |
42 | - Fix some math test cases thanks to Christian Egli | |
34 | - Improve the documentation thanks to Norbert Márkus | |
35 | - New Dockerfiles to cross-compile using mingw thanks to Christian Egli | |
43 | 36 | |
44 | 37 | Share and Enjoy! |
45 | 38 | |
52 | 45 | https://github.com/liblouis/liblouis |
53 | 46 | |
54 | 47 | .. [2] |
55 | https://github.com/liblouis/liblouisutdml/milestone/5?closed=1 | |
48 | https://github.com/liblouis/liblouisutdml/milestone/6?closed=1 |
0 | FROM debian:latest | |
1 | ||
2 | # This is a dockerfile that creates an environment to cross-compile | |
3 | # liblouisutdml for Windows. It includes libyaml and liblouis. | |
4 | ||
5 | LABEL maintainer="Liblouis Maintainers <liblouis-liblouisxml@freelists.org>" | |
6 | ||
7 | # Fetch build dependencies | |
8 | RUN apt-get update && apt-get install -y \ | |
9 | autoconf \ | |
10 | automake \ | |
11 | curl \ | |
12 | libtool \ | |
13 | make \ | |
14 | pkg-config \ | |
15 | texinfo \ | |
16 | zip \ | |
17 | patch \ | |
18 | && rm -rf /var/lib/apt/lists/* | |
19 | ||
20 | # install wine for 32-bit architecture | |
21 | RUN apt-get update && dpkg --add-architecture i386 && apt-get update && apt-get install -y \ | |
22 | fonts-wine \ | |
23 | libc6-dev-i386-x32-cross \ | |
24 | mingw-w64 \ | |
25 | mingw-w64-i686-dev \ | |
26 | wine \ | |
27 | wine32 \ | |
28 | && rm -rf /var/lib/apt/lists/* | |
29 | ||
30 | ARG LIBYAML_VERSION=0.1.4 | |
31 | ARG LIBLOUIS_VERSION=3.17.0 | |
32 | ARG LIBXML2_VERSION=2.9.9 | |
33 | ENV HOST=i686-w64-mingw32 \ | |
34 | PREFIX=/usr/build/win32 \ | |
35 | SRCDIR=/usr/src/ \ | |
36 | PKG_CONFIG_PATH=/usr/build/win32/lib/pkgconfig/ | |
37 | ||
38 | # Build and install libyaml | |
39 | WORKDIR ${SRCDIR} | |
40 | RUN curl -L https://github.com/yaml/libyaml/archive/${LIBYAML_VERSION}.tar.gz | tar zx | |
41 | WORKDIR ${SRCDIR}/libyaml-${LIBYAML_VERSION} | |
42 | # Unfortunately we need to apply a patch to version 0.1.4 of libyaml. But regretfully we | |
43 | # depend on 0.1.4 to have a statically linked version of libyaml. With newer versions of | |
44 | # liblouis we haven't managed to produce a self-contained lou_checkyaml.exe so far. | |
45 | ADD https://raw.githubusercontent.com/liblouis/liblouis/master/libyaml_mingw.patch . | |
46 | RUN patch -p1 <libyaml_mingw.patch | |
47 | RUN ./bootstrap && \ | |
48 | ./configure --host ${HOST} --prefix=${PREFIX} && \ | |
49 | make && \ | |
50 | make install | |
51 | ||
52 | # Build and install libxml2 | |
53 | WORKDIR ${SRCDIR} | |
54 | RUN curl -L ftp://xmlsoft.org/libxml2/libxml2-${LIBXML2_VERSION}.tar.gz | tar zx | |
55 | WORKDIR ${SRCDIR}/libxml2-${LIBXML2_VERSION} | |
56 | RUN autoreconf -i && \ | |
57 | ./configure --with-zlib=no --with-iconv=no --with-python=no --with-threads=no --host ${HOST} --prefix=${PREFIX} && \ | |
58 | make && \ | |
59 | make install | |
60 | ||
61 | # Build and install liblouis | |
62 | WORKDIR ${SRCDIR} | |
63 | RUN curl -L https://github.com/liblouis/liblouis/archive/v${LIBLOUIS_VERSION}.tar.gz | tar zx | |
64 | WORKDIR ${SRCDIR}/liblouis-${LIBLOUIS_VERSION} | |
65 | RUN ./autogen.sh && \ | |
66 | ./configure --host ${HOST} --enable-ucs4 \ | |
67 | --prefix=${PREFIX} \ | |
68 | CFLAGS='-O0' \ | |
69 | CPPFLAGS="-I${PREFIX}/include/" LDFLAGS="-L${PREFIX}/lib/" && \ | |
70 | make LDFLAGS="-L${PREFIX}/lib/ -avoid-version -Xcompiler -static-libgcc" && \ | |
71 | make install | |
72 | ||
73 | # Build release artifact, i.e. liblouisutdml zip | |
74 | ADD . ${SRCDIR}/liblouisutdml | |
75 | WORKDIR ${SRCDIR}/liblouisutdml | |
76 | RUN ./autogen.sh && \ | |
77 | ./configure --host ${HOST} --disable-java-bindings --prefix=${PREFIX} && \ | |
78 | make && \ | |
79 | make install && \ | |
80 | cd ${PREFIX} && \ | |
81 | zip -r ${SRCDIR}/liblouisutdml/liblouisutdml.zip * |
0 | FROM debian:latest | |
1 | ||
2 | # This is a dockerfile that creates an environment to cross-compile | |
3 | # liblouisutdml for Windows. It includes libyaml and liblouis. | |
4 | ||
5 | LABEL maintainer="Liblouis Maintainers <liblouis-liblouisxml@freelists.org>" | |
6 | ||
7 | # Fetch build dependencies | |
8 | RUN apt-get update && apt-get install -y \ | |
9 | autoconf \ | |
10 | automake \ | |
11 | curl \ | |
12 | libtool \ | |
13 | make \ | |
14 | mingw-w64 \ | |
15 | pkg-config \ | |
16 | texinfo \ | |
17 | wine64 \ | |
18 | zip \ | |
19 | patch \ | |
20 | && rm -rf /var/lib/apt/lists/* | |
21 | ||
22 | ARG LIBYAML_VERSION=0.1.4 | |
23 | ARG LIBLOUIS_VERSION=3.17.0 | |
24 | ARG LIBXML2_VERSION=2.9.9 | |
25 | ENV HOST=x86_64-w64-mingw32 \ | |
26 | PREFIX=/usr/build/win64 \ | |
27 | SRCDIR=/usr/src/ \ | |
28 | PKG_CONFIG_PATH=/usr/build/win64/lib/pkgconfig/ | |
29 | ||
30 | # Build and install libyaml | |
31 | WORKDIR ${SRCDIR} | |
32 | RUN curl -L https://github.com/yaml/libyaml/archive/${LIBYAML_VERSION}.tar.gz | tar zx | |
33 | WORKDIR ${SRCDIR}/libyaml-${LIBYAML_VERSION} | |
34 | # Unfortunately we need to apply a patch to version 0.1.4 of libyaml. But regretfully we | |
35 | # depend on 0.1.4 to have a statically linked version of libyaml. With newer versions of | |
36 | # liblouis we haven't managed to produce a self-contained lou_checkyaml.exe so far. | |
37 | ADD https://raw.githubusercontent.com/liblouis/liblouis/master/libyaml_mingw.patch . | |
38 | RUN patch -p1 <libyaml_mingw.patch | |
39 | RUN ./bootstrap && \ | |
40 | ./configure --host ${HOST} --prefix=${PREFIX} && \ | |
41 | make && \ | |
42 | make install | |
43 | ||
44 | # Build and install libxml2 | |
45 | WORKDIR ${SRCDIR} | |
46 | RUN curl -L ftp://xmlsoft.org/libxml2/libxml2-${LIBXML2_VERSION}.tar.gz | tar zx | |
47 | WORKDIR ${SRCDIR}/libxml2-${LIBXML2_VERSION} | |
48 | RUN autoreconf -i && \ | |
49 | ./configure --with-zlib=no --with-iconv=no --with-python=no --with-threads=no --host ${HOST} --prefix=${PREFIX} && \ | |
50 | make && \ | |
51 | make install | |
52 | ||
53 | # Build and install liblouis | |
54 | WORKDIR ${SRCDIR} | |
55 | RUN curl -L https://github.com/liblouis/liblouis/archive/v${LIBLOUIS_VERSION}.tar.gz | tar zx | |
56 | WORKDIR ${SRCDIR}/liblouis-${LIBLOUIS_VERSION} | |
57 | RUN ./autogen.sh && \ | |
58 | ./configure --host ${HOST} --enable-ucs4 \ | |
59 | --prefix=${PREFIX} \ | |
60 | CPPFLAGS="-I${PREFIX}/include/" LDFLAGS="-L${PREFIX}/lib/" && \ | |
61 | make LDFLAGS="-L${PREFIX}/lib/ -avoid-version -Xcompiler -static-libgcc" && \ | |
62 | make install | |
63 | ||
64 | # Build release artifact, i.e. liblouisutdml zip | |
65 | ADD . ${SRCDIR}/liblouisutdml | |
66 | WORKDIR ${SRCDIR}/liblouisutdml | |
67 | RUN ./autogen.sh && \ | |
68 | ./configure --host ${HOST} --disable-java-bindings --prefix=${PREFIX} && \ | |
69 | make && \ | |
70 | make install && \ | |
71 | cd ${PREFIX} && \ | |
72 | zip -r ${SRCDIR}/liblouisutdml/liblouisutdml.zip * |
5 | 5 | pkgconfig_DATA = liblouisutdml.pc |
6 | 6 | |
7 | 7 | EXTRA_DIST = liblouisutdml.pc README.windows README.mac README |
8 | ||
9 | WINDIST_FILES = liblouisutdml-$(VERSION)-win32.zip liblouisutdml-$(VERSION)-win64.zip | |
10 | ||
11 | .PHONY: distwin | |
12 | distwin: $(WINDIST_FILES) | |
13 | ||
14 | liblouisutdml-$(VERSION)-win32.zip: Dockerfile.win32 | |
15 | docker build -f $< -t liblouisutdml/win32 . | |
16 | time=$$(date +'%Y%m%d-%H%M%S') && \ | |
17 | docker create --name="tmp_$$time" liblouisutdml/win32 && \ | |
18 | docker cp "tmp_$$time":/usr/src/liblouisutdml/liblouisutdml.zip $@ && \ | |
19 | docker rm tmp_$$time | |
20 | ||
21 | liblouisutdml-$(VERSION)-win64.zip: Dockerfile.win64 | |
22 | docker build -f $< -t liblouisutdml/win64 . | |
23 | time=$$(date +'%Y%m%d-%H%M%S') && \ | |
24 | docker create --name="tmp_$$time" liblouisutdml/win64 && \ | |
25 | docker cp "tmp_$$time":/usr/src/liblouisutdml/liblouisutdml.zip $@ && \ | |
26 | docker rm tmp_$$time | |
27 | ||
28 | clean-local: | |
29 | rm -rf $(WINDIST_FILES) | |
30 |
0 | 0 | liblouisxml NEWS -- history of user-visible changes. |
1 | ||
2 | * Noteworthy changes in release 2.10.0 (2021-03-10) | |
3 | ||
4 | This minor Liblouisutdml release improves the documentation and | |
5 | improves the build and test infrastructure. It also adds support for | |
6 | liblouis 3.17. | |
7 | ||
8 | For a detailed list of all the changes refer to [[https://github.com/liblouis/liblouisutdml/milestone/6?closed=1][the list of closed | |
9 | issues]]. | |
10 | ||
11 | ** New features | |
12 | - Add support for liblouis 3.17 | |
13 | ||
14 | ** Other | |
15 | - Improve the documentation thanks to Norbert Márkus | |
16 | - New Dockerfiles to cross-compile using mingw thanks to Christian | |
17 | Egli | |
1 | 18 | |
2 | 19 | * Noteworthy changes in release 2.9.0 (2020-08-31) |
3 | 20 |
0 | 0 | |
1 | 1 | # Introduction |
2 | 2 | |
3 | [![Build Status](https://travis-ci.org/liblouis/liblouisutdml.svg?branch=master)](https://travis-ci.org/liblouis/liblouisutdml) | |
3 | [![Make check/distcheck](https://github.com/liblouis/liblouisutdml/actions/workflows/main.yml/badge.svg)](https://github.com/liblouis/liblouisutdml/actions/workflows/main.yml) | |
4 | 4 | |
5 | 5 | Liblouisutdml is an open-source library providing complete braille |
6 | 6 | transcription services for xml, html and text documents. It translates |
87 | 87 | |
88 | 88 | # Docker for cross-compiling |
89 | 89 | |
90 | You can use a Docker image to cross-compile liblouisutdml using mingw. | |
90 | You can use a Dockerfile to cross-compile liblouisutdml using mingw | |
91 | either for 32 or for 64 bit architecture: | |
91 | 92 | |
92 | 93 | ``` console |
93 | docker build -f Dockerfile.mingw . | |
94 | # for 32 bit architecture | |
95 | docker build -f Dockerfile.win32 . | |
96 | # for 64 bit architecture | |
97 | docker build -f Dockerfile.win64 . | |
98 | ``` | |
99 | Then grab the artifact from the docker container. | |
100 | ||
101 | Or instead let the Makefile do it all for you: | |
102 | ||
103 | ``` console | |
104 | make distwin | |
94 | 105 | ``` |
95 | 106 | |
96 | 107 | [liblouis]: http://www.liblouis.org/ |
0 | 0 | # Process this file with autoconf to produce a configure script. |
1 | 1 | |
2 | 2 | AC_PREREQ(2.68) |
3 | AC_INIT([liblouisutdml], [2.9.0], [liblouis-liblouisxml@freelists.org], [liblouisutdml], [http://www.liblouis.org]) | |
3 | AC_INIT([liblouisutdml], [2.10.0], [liblouis-liblouisxml@freelists.org], [liblouisutdml], [http://www.liblouis.org]) | |
4 | 4 | AC_CONFIG_SRCDIR([liblouisutdml/semantics.c]) |
5 | 5 | AC_CONFIG_HEADER([liblouisutdml/config.h]) |
6 | 6 | |
7 | 7 | AC_CONFIG_AUX_DIR([build-aux]) |
8 | 8 | AC_CONFIG_MACRO_DIR([m4]) |
9 | AM_INIT_AUTOMAKE | |
9 | AM_INIT_AUTOMAKE([-Wall dist-zip]) | |
10 | 10 | |
11 | 11 | # increment if the interface has additions, changes, removals. |
12 | 12 | LIBLOUISUTDML_CURRENT=10 |
36 | 36 | AC_PROG_LN_S |
37 | 37 | AC_PROG_MAKE_SET |
38 | 38 | # AC_PROG_RANLIB |
39 | AC_ISC_POSIX | |
40 | AC_LIBTOOL_WIN32_DLL | |
39 | AM_PROG_AR | |
41 | 40 | AM_PROG_LIBTOOL |
41 | # see https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html | |
42 | LT_INIT([win32-dll]) | |
42 | 43 | |
43 | 44 | # GNU help2man creates man pages from --help output; in many cases, |
44 | 45 | # this is sufficient, and obviates the need to maintain man pages |
0 | liblouisutdml (2.9.0-2) UNRELEASED; urgency=medium | |
1 | ||
2 | [ Samuel Thibault ] | |
0 | liblouisutdml (2.10.0-2) UNRELEASED; urgency=medium | |
1 | ||
2 | [ Samuel Thibault ] | |
3 | * rules: Fix reproducibility by disabling javadoc translations. | |
4 | ||
5 | [ Debian Janitor ] | |
6 | * Remove constraints unnecessary since stretch: | |
7 | + Build-Depends: Drop versioned constraint on java-common. | |
8 | ||
9 | -- Samuel Thibault <sthibault@debian.org> Thu, 11 Mar 2021 09:58:11 +0100 | |
10 | ||
11 | liblouisutdml (2.10.0-1) experimental; urgency=medium | |
12 | ||
13 | * New upstream release. | |
3 | 14 | * not-installed: Note that we don't install .la files and the copyright |
4 | 15 | notice file. |
5 | 16 | * docs, info: Install files from installed places. |
6 | 17 | * control,rules: Disable java deps on kfreebsd-any a well. |
7 | ||
8 | [ Debian Janitor ] | |
9 | * Remove constraints unnecessary since stretch: | |
10 | + Build-Depends: Drop versioned constraint on java-common. | |
11 | 18 | |
12 | 19 | -- Samuel Thibault <sthibault@debian.org> Thu, 29 Oct 2020 00:45:59 +0100 |
13 | 20 |
28 | 28 | else |
29 | 29 | ( cd java ; ant -buildfile build.xml ) |
30 | 30 | mv java/jliblouisutdml.jar java/jliblouisutdml-$(DEB_VERSION_UPSTREAM).jar |
31 | ( cd java ; javadoc -notimestamp -d api src/org/liblouis/*.java ) | |
31 | ( cd java ; LC_ALL=C javadoc -notimestamp -d api src/org/liblouis/*.java ) | |
32 | 32 | endif |
33 | 33 | |
34 | 34 | override_dh_auto_install: |
355 | 355 | @option{-b}, @option{-r} and @option{-p} options discussed above |
356 | 356 | provide for other types of files and processing. Typical xml files are |
357 | 357 | those provided by @uref{www.bookshare.org} or those derived from a |
358 | word processor by saving in xml format. If a text file is used | |
358 | word processor by saving in xml format. If a text file is used, | |
359 | 359 | paragraphs and headings should be separated by blank lines. In such a |
360 | 360 | file there is no way to distinguish between paragraphs and headings, |
361 | 361 | so they will all be formatted as paragraphs, as specified by the |
362 | 362 | configuration file. However, if you want a blank line in the braille |
363 | transcription use two consecutive blank lines in the text file. | |
363 | transcription, use two consecutive blank lines in the text file. | |
364 | 364 | |
365 | 365 | @item outfile |
366 | 366 | This is the name of the output file. It will be transcribed as |
432 | 432 | discussed in this section. A third type of file, braille translation |
433 | 433 | tables, is discussed in the liblouis documentation (@pxref{Top, , |
434 | 434 | Overview, liblouis, Liblouis User's and Programmer's Manual}). |
435 | ||
435 | 436 | Another section of the present document which may be of interest is |
436 | 437 | Implementing Braille Mathematical Codes (@pxref{Implementing Braille |
437 | 438 | Mathematics Codes}). |
496 | 497 | Here, then, is an explanation of each section and setting in the |
497 | 498 | @file{preferences.cfg} file. When you look at this file you will see |
498 | 499 | that the section names start at the left margin, while the settings |
499 | are indented one tab stop. This is done for readability. it has no | |
500 | are indented one tab stop. This is done for readability, it has no | |
500 | 501 | effect on the meaning of the lines. You will also see lines beginning |
501 | 502 | with a number sign (@samp{#}), which are comments. Blank lines can |
502 | 503 | also be used anywhere in a configuration file. In general, a section |
642 | 643 | @setting{hyphenate, no} |
643 | 644 | If @samp{yes} is specified words will be hyphenated at the ends of |
644 | 645 | lines if a hyphenation table is available. In contracted English |
645 | Braille hyphenation is not generally used, but it can save | |
646 | Braille, hyphenation is not generally used, but it can save | |
646 | 647 | considerable space. The hyphenation table is specified as part of the |
647 | 648 | table list in the @code{literaryTextTable} setting of the translation |
648 | 649 | section. |
811 | 812 | @code{braillePageNumberFormat blank}. This will apply to all styles |
812 | 813 | nested within it. When the titlePage section ends, the frontMatter |
813 | 814 | setting @samp{roman} will be restored. The |
814 | @samp{braiblePageNumberFormat} setting is an example of a "persistent" | |
815 | @samp{braillePageNumberFormat} setting is an example of a "persistent" | |
815 | 816 | style setting. Most settings apply only to the style for which they are |
816 | 817 | declared. |
817 | 818 | |
825 | 826 | |
826 | 827 | This is a predefined style name. All settings have their default values. |
827 | 828 | The user must specify any other values. If a "persistent" style setting |
828 | is specified, it will apply to the whole ducument. | |
829 | is specified, it will apply to the whole document. | |
829 | 830 | |
830 | 831 | @table @code |
831 | 832 | |
1061 | 1062 | |
1062 | 1063 | @setting{topBoxline, .} |
1063 | 1064 | |
1064 | This should be set to the character you want used for the boxline | |
1065 | This should be set to the character you want to be used for the boxline | |
1065 | 1066 | which appears before the content. |
1066 | 1067 | |
1067 | 1068 | @setting{bottomBoxline, .} |
1068 | 1069 | |
1069 | This should be set to the character you want used for the boxline | |
1070 | This should be set to the character you want to be used for the boxline | |
1070 | 1071 | which appears after the content. |
1071 | 1072 | |
1072 | 1073 | @end table |
1088 | 1089 | When liblouisutdml (or @command{file2brl}) processes an xml document, it |
1089 | 1090 | needs to be told how to use the information in that document to |
1090 | 1091 | produce a properly translated and formatted braille document. These |
1091 | instructions are provided by a semantic-action file, so called because | |
1092 | instructions are provided by a semantic-action file, called so because | |
1092 | 1093 | it explains the meaning, or semantics, of the various specifications |
1093 | 1094 | in the xml document. To understand how this works, it is necessary to |
1094 | 1095 | have a basic knowledge of the organization of an xml document. |
1219 | 1220 | |
1220 | 1221 | This tells liblouisutdml that when it encounters the element @code{<h1>} |
1221 | 1222 | it is to format the text which follows as a first-level braille |
1222 | heading, that is, the text will be centered and preceeded and followed | |
1223 | heading, that is, the text will be centered and preceded and followed | |
1223 | 1224 | by blank lines. (You can change this by changing the definition of the |
1224 | 1225 | heading1 style). |
1225 | 1226 | |
1285 | 1286 | @example |
1286 | 1287 | heading1 title |
1287 | 1288 | @end example |
1288 | ||
1289 | 1289 | |
1290 | 1290 | this causes the title of the document to also be treated as a braille |
1291 | 1291 | level 1 heading. |
1445 | 1445 | is to be applied. If it is solely an element then the action is |
1446 | 1446 | applied if this element is encountered. If it is an element-attribute |
1447 | 1447 | pair then the action is applied if the given element also has the |
1448 | specified attribute. In the last case with a element-attribute-value | |
1448 | specified attribute. In the last case with an element-attribute-value | |
1449 | 1449 | triplet the action is only applied if the element has the specified |
1450 | 1450 | attribute and the value of this attribute is equal to the specified |
1451 | 1451 | value. |
1452 | 1452 | |
1453 | 1453 | @table @code |
1454 | 1454 | |
1455 | @semanticAction{contenss1, elementSpecifier} | |
1456 | ||
1457 | Note that the @code{contenss1}, etc. semantic actions are never | |
1455 | @semanticAction{contents1, elementSpecifier} | |
1456 | ||
1457 | Note that the @code{contents1}, etc. semantic actions are never | |
1458 | 1458 | assigned an |
1459 | 1459 | actual @code{elementSpecifier}. There used internally by the table of |
1460 | 1460 | contents generator. They should be assigned style settings, however. |
1461 | 1461 | |
1462 | ||
1463 | @semanticAction{contenss2, elementSpecifier} | |
1464 | ||
1465 | @semanticAction{contenss3, elementSpecifier} | |
1466 | ||
1467 | @semanticAction{contenss4, elementSpecifier} | |
1462 | @semanticAction{contents2, elementSpecifier} | |
1463 | ||
1464 | @semanticAction{contents3, elementSpecifier} | |
1465 | ||
1466 | @semanticAction{contents4, elementSpecifier} | |
1468 | 1467 | |
1469 | 1468 | @semanticAction{contentsheader, elementSpecifier} |
1470 | 1469 | |
1485 | 1484 | |
1486 | 1485 | @end table |
1487 | 1486 | |
1488 | The following table expbains each of the non-style semantic actions. In | |
1487 | The following table explains each of the non-style semantic actions. In | |
1489 | 1488 | general, each one performs a particular function. If a third column is |
1490 | 1489 | given, the subcolumns will be inserted in order before each branch of |
1491 | 1490 | any subtree starting from @code{elementSpecifier}. |
1512 | 1511 | |
1513 | 1512 | When a module to handle chemical notation is ready, this semantic action |
1514 | 1513 | will invoke it. The processing will be like that produced by the |
1515 | semantic | |
1516 | action @code{math}. | |
1514 | semantic action @code{math}. | |
1517 | 1515 | |
1518 | 1516 | @semanticAction{changetable, elementSpecifier} |
1519 | 1517 | |
1537 | 1535 | |
1538 | 1536 | The material between @code{elementSpecifier} and |
1539 | 1537 | @code{/elementSpecifier} is translated as computer braille, if the |
1540 | liblouis table in use phovides for it. Beginning and ending computer | |
1538 | liblouis table in use provides for it. Beginning and ending computer | |
1541 | 1539 | braille indicators are inserted if they are in the table. |
1542 | 1540 | |
1543 | 1541 | @semanticAction{configfile, elementSpecifier filename} |
1592 | 1590 | the bottom of each page. |
1593 | 1591 | |
1594 | 1592 | @example |
1595 | <elemntSpecifier>This is a footer</elementSpecifier> | |
1593 | <elementSpecifier>This is a footer</elementSpecifier> | |
1596 | 1594 | @end example |
1597 | 1595 | |
1598 | 1596 | @semanticAction{generic, elementSpecifier} |
1631 | 1629 | |
1632 | 1630 | @semanticAction{linespacing, elementSpecifier digit} |
1633 | 1631 | |
1634 | This semantic action specifies the numbr of blank lines to be left | |
1632 | This semantic action specifies the number of blank lines to be left | |
1635 | 1633 | between adjacent lines in the output. For example if the third column is |
1636 | 1634 | @samp{1}, lines will be double-spaced. @samp{0} specifies normal |
1637 | 1635 | spacing. The number cannot be greater than @samp{3}. @code{linespacing} |
1644 | 1642 | code might be needed for each of the MathML element tags. It turned out, |
1645 | 1643 | as noted elsewhere, that most of them could have been handled with the |
1646 | 1644 | @code{generic} semantic action. They are retained for backward |
1647 | compatibi2ity. Therefore, unless this is not the case or additional | |
1645 | compatibility. Therefore, unless this is not the case or additional | |
1648 | 1646 | information is needed, they are simlly listed. |
1649 | 1647 | |
1650 | 1648 | @semanticAction{maligngroup, elementSpecifier} |
1683 | 1681 | |
1684 | 1682 | @semanticAction{mo, elementSpecifier} |
1685 | 1683 | |
1686 | ||
1687 | 1684 | @semanticAction{mover, elementSpecifier} |
1688 | 1685 | |
1689 | 1686 | @semanticAction{mpadded, elementSpecifier} |
1798 | 1795 | |
1799 | 1796 | The branches of the subtree rooted at this node are reversed in order. |
1800 | 1797 | This is used in handling roots, where the arguments in the translation |
1801 | are in reverse order to those in MathML. the MathML elemnt @code{mroot} | |
1798 | are in reverse order to those in MathML. the MathML element @code{mroot} | |
1802 | 1799 | is declared with this semantic action |
1803 | 1800 | |
1804 | 1801 | @semanticAction{righthandpage, elementSpecifier} |
1827 | 1824 | @semanticAction{skip, elementSpecifier} |
1828 | 1825 | |
1829 | 1826 | Skip ahead until encountering the element @code{</elementSpecifier>}. |
1830 | Nothing | |
1831 | in between will have any effect on the braille output. | |
1827 | Nothing in between will have any effect on the braille output. | |
1832 | 1828 | |
1833 | 1829 | @semanticAction{softreturn, elementSpecifier} |
1834 | 1830 | Do a soft return, that is, start a new line without starting a new |
1900 | 1896 | @section Using XPath Expressions |
1901 | 1897 | @cindex XPath Expressions |
1902 | 1898 | |
1903 | The second column of a semantic action may contain a XPath expression | |
1899 | The second column of a semantic action may contain an XPath expression | |
1904 | 1900 | for matching nodes. When an XPath expression is to be used the second |
1905 | 1901 | column should be of the format: @samp{&xpath(<expression>)} where |
1906 | 1902 | @samp{<expression>} is the XPath expression to match nodes. |
1925 | 1921 | this would be @samp{xhtml:p}) |
1926 | 1922 | |
1927 | 1923 | @item |
1928 | You should be careful to not create XPath expressions which give | |
1924 | You should be careful not to create XPath expressions which give | |
1929 | 1925 | overlapping node set results. When liblouisutdml finds a match for a |
1930 | 1926 | node it assigns the semantic action to that node and this will not be |
1931 | 1927 | changed subsequently. Note that this is unlike XSLT, where for each |
1933 | 1929 | liblouisutdml it is unpredictable which rule will win. |
1934 | 1930 | |
1935 | 1931 | @item |
1936 | XPath expressions take precedence over ordinary semantic-fie entries. | |
1932 | XPath expressions take precedence over ordinary semantic-file entries. | |
1937 | 1933 | |
1938 | 1934 | @end itemize |
1939 | 1935 | |
2173 | 2169 | as MathML it will be translated according to the mathematics code |
2174 | 2170 | specified by the configuration. outfile should have the extension |
2175 | 2171 | @samp{.html}. It will actually be xhtml. The @code{-CformatFor=browser} |
2176 | part of the above example specifies a configuration setting, which of | |
2177 | course can also be specified in a configuration file. | |
2172 | part of the above example specifies a configuration setting, which, of | |
2173 | course, can also be specified in a configuration file. | |
2178 | 2174 | |
2179 | 2175 | @node CDATA Sections |
2180 | 2176 | @section @code{CDATA} Sections |
2551 | 2547 | style stanza |
2552 | 2548 | linesBefore 1 |
2553 | 2549 | linesAfter 1 |
2554 | ttyle line | |
2550 | style line | |
2555 | 2551 | leftMargin 2 |
2556 | 2552 | firstLineIndent -2 |
2557 | 2553 | @end example |
2561 | 2557 | |
2562 | 2558 | @example |
2563 | 2559 | <stanza> |
2564 | <lino>He holds him with his glittering eye</line> | |
2560 | <line>He holds him with his glittering eye</line> | |
2565 | 2561 | <line>The wedding guest stands still</line> |
2566 | 2562 | <line>And listens like a three-years' child.</line> |
2567 | 2563 | <line>He has no force nor will.</line> |
2591 | 2587 | |
2592 | 2588 | At this point you will probably have to edit the source xml file to |
2593 | 2589 | indicate the beginning and end of volumes. You can define a liblouisutdml |
2594 | style called @samp{volume} and assign appopriate xml tags to it in a | |
2590 | style called @samp{volume} and assign appropriate xml tags to it in a | |
2595 | 2591 | semantic-action file. Within the volume style you can nest a title page, |
2596 | 2592 | chapters, etc. A volume table of contents is still under development. |
2597 | 2593 | |
2696 | 2692 | children of this tag. The entry says to put an escape character (hex |
2697 | 2693 | 1b), plus the letter @samp{c}, after the very last of them. |
2698 | 2694 | |
2699 | ||
2700 | 2695 | As a final example consider: |
2701 | 2696 | |
2702 | 2697 | @example |
2938 | 2933 | liblouisutdml determines the paths on which it will search for files at |
2939 | 2934 | run time, as part of its initialization. First, if the first file in a |
2940 | 2935 | configuration file list includes a path, liblouisutdml will search first |
2941 | on this path. The path may be either absolune or relative. Only the | |
2936 | on this path. The path may be either absolute or relative. Only the | |
2942 | 2937 | first filename in a configuration file list may have a path. Next, in |
2943 | Windows liblouisutdml determines the path to itself. this is the second | |
2938 | Windows, liblouisutdml determines the path to itself. this is the second | |
2944 | 2939 | path on which it will look for files. The liblouis @file{tables} |
2945 | 2940 | directory and the liblouisutdml @file{lbu_files} directory are relative to |
2946 | 2941 | this path. In Unix systems, including the Mac,, these directories are |
35 | 35 | @command{file2brl} command). The essential feature of this file is that |
36 | 36 | it has the configuration setting @code{formatFor utd}. The result is a |
37 | 37 | file that contains the UTDML tags and Unicode braille encoded as UTF-8. |
38 | This is not very readable, so anotgher step was necessary. | |
38 | This is not very readable, so another step was necessary. | |
39 | 39 | @file{viewxml.cfg} was then applied to the result. |
40 | 40 | This file uses a |
41 | 41 | special liblouis table to produce readable text showing everything in |
107 | 107 | </dtbook> |
108 | 108 | @end example |
109 | 109 | |
110 | An analysiis of the example will show the main features of UTDML. | |
110 | An analysis of the example will show the main features of UTDML. | |
111 | 111 | |
112 | 112 | The @code{<?xml} processing instruction was added by liblouisutdml to |
113 | prooduce a well-formed xml document. it is not part of UTDML. | |
113 | produce a well-formed xml document. it is not part of UTDML. | |
114 | 114 | |
115 | 115 | In the first example the @code{<head>} element is empty. UTDML has added a |
116 | 116 | @code{<meta>} sub-element with @code{name="utd"} and @code{content} |
117 | attributes. The value of the latter id a list of confiburation settings | |
117 | attributes. The value of the latter is a list of configuration settings | |
118 | 118 | and their values. |
119 | 119 | |
120 | 120 | The tag @code{<book>} has been assigned the document style in |
121 | 121 | @file{dtbook.sem}. UTDML therefore adds the first @code{<brl>} node. It |
122 | 122 | has no @code{index} attribute, since it contains no braille to be |
123 | synchronized with the print text, but does congain braille formatting | |
123 | synchronized with the print text, but does contain braille formatting | |
124 | 124 | information. It contains a @code{<newpage>} node with the attribute |
125 | 125 | @code{number="1"}. A @code{<newpage>} node must precede the first |
126 | 126 | @code{<newline>} node on a page, of which more below. |
145 | 145 | line contains cells with dots 7 or 8 the next line is spaced 10 |
146 | 146 | half-dots. |
147 | 147 | |
148 | Following the @code<newline xy="20,10"/>} are a number of strings within | |
148 | Following the @code{<newline xy="20,10"/>} are a number of strings within | |
149 | 149 | single quotes which give the braille translation in US English Grade 2. |
150 | 150 | This is Unicode braille, which gives the dot patterns. In the UTDML file |
151 | 151 | it is encoded in UTF-8. It was rendered readable by using a special |
184 | 184 | |
185 | 185 | Usually @code{<brl>} nodes follow text nodes in the original document, |
186 | 186 | but they may occur in other places where braille formatting or |
187 | braill-only information is needed. In such cases they will not have an | |
187 | braille-only information is needed. In such cases they will not have an | |
188 | 188 | @code{index} attribute to give synchronization information with the |
189 | 189 | print text. |
190 | 190 | |
191 | 191 | An extra @code{<meta>} tag is added to the @code{<head>} element, giving |
192 | information about the braille poortions of the document. An xml file | |
192 | information about the braille portions of the document. An xml file | |
193 | 193 | that is to be augmented with UTDML must therefore have a @code{<head>} |
194 | 194 | element or equivalent, but it may be empty. |
195 | 195 |
2 | 2 | The multi-volume feature is triggered by the configuration setting |
3 | 3 | @code{volumeSem filename}. Filename is the name of a semantic file which |
4 | 4 | assigns semantic actions and styles to xml tags for the purpose of |
5 | interpreting the UTD protions of the document and using the structure of | |
5 | interpreting the UTD portions of the document and using the structure of | |
6 | 6 | the document to divide the output into volumes. This feature operates in |
7 | 7 | two passes. In the first, the UTD portion of the document is created. In |
8 | 8 | the second the book is actually divided into volumes and each volume is |
9 | 9 | output as a separate file. These files have the extensions .001 .002 |
10 | etc. added afgter the original filename given for output. If this | |
10 | etc. added after the original filename given for output. If this | |
11 | 11 | filename had an extension, the volume numbers are simply added onto the |
12 | 12 | end. |
13 | 13 |
7 | 7 | else |
8 | 8 | wget https://github.com/liblouis/liblouis/releases/download/v${LIBLOUIS_VERSION}/liblouis-${LIBLOUIS_VERSION}.tar.gz |
9 | 9 | tar -xf liblouis-*.tar.gz |
10 | ( cd liblouis-* && ./configure && make && sudo make install ) | |
10 | ( cd liblouis-${LIBLOUIS_VERSION} && ./configure && make && sudo make install ) | |
11 | 11 | fi |
12 | 12 | sudo ldconfig |
13 | 13 |