Codebase list liblouisutdml / 7a517de
Merge branch 'debian-experimental' Samuel Thibault 2 years ago
17 changed file(s) with 361 addition(s) and 117 deletion(s). Raw diff Collapse all Expand all
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
2222 config.status
2323 configure
2424
25 build-aux/ar-lib
2526 build-aux/compile
2627 build-aux/config.guess
2728 build-aux/config.sub
5960 liblouisutdml/stamp-h1
6061
6162 liblouisutdml-*.tar.gz
63 liblouisutdml-*.zip
6264
6365 libtool
6466
+0
-31
.travis.yml less more
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
11
22 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:
44
55 https://github.com/liblouis/liblouisutdml/releases
66
1616 Noteworthy changes in this release
1717 ==================================
1818
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.
2122
2223 For a detailed list of all the changes refer to the list of closed
2324 issues [2]_.
2526 New features
2627 ------------
2728
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
3730
3831 Other
3932 -----
4033
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
4336
4437 Share and Enjoy!
4538
5245 https://github.com/liblouis/liblouis
5346
5447 .. [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 *
55 pkgconfig_DATA = liblouisutdml.pc
66
77 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
00 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
118
219 * Noteworthy changes in release 2.9.0 (2020-08-31)
320
00
11 # Introduction
22
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)
44
55 Liblouisutdml is an open-source library providing complete braille
66 transcription services for xml, html and text documents. It translates
8787
8888 # Docker for cross-compiling
8989
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:
9192
9293 ``` 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
94105 ```
95106
96107 [liblouis]: http://www.liblouis.org/
00 # Process this file with autoconf to produce a configure script.
11
22 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])
44 AC_CONFIG_SRCDIR([liblouisutdml/semantics.c])
55 AC_CONFIG_HEADER([liblouisutdml/config.h])
66
77 AC_CONFIG_AUX_DIR([build-aux])
88 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE
9 AM_INIT_AUTOMAKE([-Wall dist-zip])
1010
1111 # increment if the interface has additions, changes, removals.
1212 LIBLOUISUTDML_CURRENT=10
3636 AC_PROG_LN_S
3737 AC_PROG_MAKE_SET
3838 # AC_PROG_RANLIB
39 AC_ISC_POSIX
40 AC_LIBTOOL_WIN32_DLL
39 AM_PROG_AR
4140 AM_PROG_LIBTOOL
41 # see https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
42 LT_INIT([win32-dll])
4243
4344 # GNU help2man creates man pages from --help output; in many cases,
4445 # 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.
314 * not-installed: Note that we don't install .la files and the copyright
415 notice file.
516 * docs, info: Install files from installed places.
617 * 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.
1118
1219 -- Samuel Thibault <sthibault@debian.org> Thu, 29 Oct 2020 00:45:59 +0100
1320
2828 else
2929 ( cd java ; ant -buildfile build.xml )
3030 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 )
3232 endif
3333
3434 override_dh_auto_install:
355355 @option{-b}, @option{-r} and @option{-p} options discussed above
356356 provide for other types of files and processing. Typical xml files are
357357 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,
359359 paragraphs and headings should be separated by blank lines. In such a
360360 file there is no way to distinguish between paragraphs and headings,
361361 so they will all be formatted as paragraphs, as specified by the
362362 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.
364364
365365 @item outfile
366366 This is the name of the output file. It will be transcribed as
432432 discussed in this section. A third type of file, braille translation
433433 tables, is discussed in the liblouis documentation (@pxref{Top, ,
434434 Overview, liblouis, Liblouis User's and Programmer's Manual}).
435
435436 Another section of the present document which may be of interest is
436437 Implementing Braille Mathematical Codes (@pxref{Implementing Braille
437438 Mathematics Codes}).
496497 Here, then, is an explanation of each section and setting in the
497498 @file{preferences.cfg} file. When you look at this file you will see
498499 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
500501 effect on the meaning of the lines. You will also see lines beginning
501502 with a number sign (@samp{#}), which are comments. Blank lines can
502503 also be used anywhere in a configuration file. In general, a section
642643 @setting{hyphenate, no}
643644 If @samp{yes} is specified words will be hyphenated at the ends of
644645 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
646647 considerable space. The hyphenation table is specified as part of the
647648 table list in the @code{literaryTextTable} setting of the translation
648649 section.
811812 @code{braillePageNumberFormat blank}. This will apply to all styles
812813 nested within it. When the titlePage section ends, the frontMatter
813814 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"
815816 style setting. Most settings apply only to the style for which they are
816817 declared.
817818
825826
826827 This is a predefined style name. All settings have their default values.
827828 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.
829830
830831 @table @code
831832
10611062
10621063 @setting{topBoxline, .}
10631064
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
10651066 which appears before the content.
10661067
10671068 @setting{bottomBoxline, .}
10681069
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
10701071 which appears after the content.
10711072
10721073 @end table
10881089 When liblouisutdml (or @command{file2brl}) processes an xml document, it
10891090 needs to be told how to use the information in that document to
10901091 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
10921093 it explains the meaning, or semantics, of the various specifications
10931094 in the xml document. To understand how this works, it is necessary to
10941095 have a basic knowledge of the organization of an xml document.
12191220
12201221 This tells liblouisutdml that when it encounters the element @code{<h1>}
12211222 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
12231224 by blank lines. (You can change this by changing the definition of the
12241225 heading1 style).
12251226
12851286 @example
12861287 heading1 title
12871288 @end example
1288
12891289
12901290 this causes the title of the document to also be treated as a braille
12911291 level 1 heading.
14451445 is to be applied. If it is solely an element then the action is
14461446 applied if this element is encountered. If it is an element-attribute
14471447 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
14491449 triplet the action is only applied if the element has the specified
14501450 attribute and the value of this attribute is equal to the specified
14511451 value.
14521452
14531453 @table @code
14541454
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
14581458 assigned an
14591459 actual @code{elementSpecifier}. There used internally by the table of
14601460 contents generator. They should be assigned style settings, however.
14611461
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}
14681467
14691468 @semanticAction{contentsheader, elementSpecifier}
14701469
14851484
14861485 @end table
14871486
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
14891488 general, each one performs a particular function. If a third column is
14901489 given, the subcolumns will be inserted in order before each branch of
14911490 any subtree starting from @code{elementSpecifier}.
15121511
15131512 When a module to handle chemical notation is ready, this semantic action
15141513 will invoke it. The processing will be like that produced by the
1515 semantic
1516 action @code{math}.
1514 semantic action @code{math}.
15171515
15181516 @semanticAction{changetable, elementSpecifier}
15191517
15371535
15381536 The material between @code{elementSpecifier} and
15391537 @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
15411539 braille indicators are inserted if they are in the table.
15421540
15431541 @semanticAction{configfile, elementSpecifier filename}
15921590 the bottom of each page.
15931591
15941592 @example
1595 <elemntSpecifier>This is a footer</elementSpecifier>
1593 <elementSpecifier>This is a footer</elementSpecifier>
15961594 @end example
15971595
15981596 @semanticAction{generic, elementSpecifier}
16311629
16321630 @semanticAction{linespacing, elementSpecifier digit}
16331631
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
16351633 between adjacent lines in the output. For example if the third column is
16361634 @samp{1}, lines will be double-spaced. @samp{0} specifies normal
16371635 spacing. The number cannot be greater than @samp{3}. @code{linespacing}
16441642 code might be needed for each of the MathML element tags. It turned out,
16451643 as noted elsewhere, that most of them could have been handled with the
16461644 @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
16481646 information is needed, they are simlly listed.
16491647
16501648 @semanticAction{maligngroup, elementSpecifier}
16831681
16841682 @semanticAction{mo, elementSpecifier}
16851683
1686
16871684 @semanticAction{mover, elementSpecifier}
16881685
16891686 @semanticAction{mpadded, elementSpecifier}
17981795
17991796 The branches of the subtree rooted at this node are reversed in order.
18001797 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}
18021799 is declared with this semantic action
18031800
18041801 @semanticAction{righthandpage, elementSpecifier}
18271824 @semanticAction{skip, elementSpecifier}
18281825
18291826 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.
18321828
18331829 @semanticAction{softreturn, elementSpecifier}
18341830 Do a soft return, that is, start a new line without starting a new
19001896 @section Using XPath Expressions
19011897 @cindex XPath Expressions
19021898
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
19041900 for matching nodes. When an XPath expression is to be used the second
19051901 column should be of the format: @samp{&xpath(<expression>)} where
19061902 @samp{<expression>} is the XPath expression to match nodes.
19251921 this would be @samp{xhtml:p})
19261922
19271923 @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
19291925 overlapping node set results. When liblouisutdml finds a match for a
19301926 node it assigns the semantic action to that node and this will not be
19311927 changed subsequently. Note that this is unlike XSLT, where for each
19331929 liblouisutdml it is unpredictable which rule will win.
19341930
19351931 @item
1936 XPath expressions take precedence over ordinary semantic-fie entries.
1932 XPath expressions take precedence over ordinary semantic-file entries.
19371933
19381934 @end itemize
19391935
21732169 as MathML it will be translated according to the mathematics code
21742170 specified by the configuration. outfile should have the extension
21752171 @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.
21782174
21792175 @node CDATA Sections
21802176 @section @code{CDATA} Sections
25512547 style stanza
25522548 linesBefore 1
25532549 linesAfter 1
2554 ttyle line
2550 style line
25552551 leftMargin 2
25562552 firstLineIndent -2
25572553 @end example
25612557
25622558 @example
25632559 <stanza>
2564 <lino>He holds him with his glittering eye</line>
2560 <line>He holds him with his glittering eye</line>
25652561 <line>The wedding guest stands still</line>
25662562 <line>And listens like a three-years' child.</line>
25672563 <line>He has no force nor will.</line>
25912587
25922588 At this point you will probably have to edit the source xml file to
25932589 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
25952591 semantic-action file. Within the volume style you can nest a title page,
25962592 chapters, etc. A volume table of contents is still under development.
25972593
26962692 children of this tag. The entry says to put an escape character (hex
26972693 1b), plus the letter @samp{c}, after the very last of them.
26982694
2699
27002695 As a final example consider:
27012696
27022697 @example
29382933 liblouisutdml determines the paths on which it will search for files at
29392934 run time, as part of its initialization. First, if the first file in a
29402935 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
29422937 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
29442939 path on which it will look for files. The liblouis @file{tables}
29452940 directory and the liblouisutdml @file{lbu_files} directory are relative to
29462941 this path. In Unix systems, including the Mac,, these directories are
3535 @command{file2brl} command). The essential feature of this file is that
3636 it has the configuration setting @code{formatFor utd}. The result is a
3737 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.
3939 @file{viewxml.cfg} was then applied to the result.
4040 This file uses a
4141 special liblouis table to produce readable text showing everything in
107107 </dtbook>
108108 @end example
109109
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.
111111
112112 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.
114114
115115 In the first example the @code{<head>} element is empty. UTDML has added a
116116 @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
118118 and their values.
119119
120120 The tag @code{<book>} has been assigned the document style in
121121 @file{dtbook.sem}. UTDML therefore adds the first @code{<brl>} node. It
122122 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
124124 information. It contains a @code{<newpage>} node with the attribute
125125 @code{number="1"}. A @code{<newpage>} node must precede the first
126126 @code{<newline>} node on a page, of which more below.
145145 line contains cells with dots 7 or 8 the next line is spaced 10
146146 half-dots.
147147
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
149149 single quotes which give the braille translation in US English Grade 2.
150150 This is Unicode braille, which gives the dot patterns. In the UTDML file
151151 it is encoded in UTF-8. It was rendered readable by using a special
184184
185185 Usually @code{<brl>} nodes follow text nodes in the original document,
186186 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
188188 @code{index} attribute to give synchronization information with the
189189 print text.
190190
191191 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
193193 that is to be augmented with UTDML must therefore have a @code{<head>}
194194 element or equivalent, but it may be empty.
195195
22 The multi-volume feature is triggered by the configuration setting
33 @code{volumeSem filename}. Filename is the name of a semantic file which
44 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
66 the document to divide the output into volumes. This feature operates in
77 two passes. In the first, the UTD portion of the document is created. In
88 the second the book is actually divided into volumes and each volume is
99 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
1111 filename had an extension, the volume numbers are simply added onto the
1212 end.
1313
77 else
88 wget https://github.com/liblouis/liblouis/releases/download/v${LIBLOUIS_VERSION}/liblouis-${LIBLOUIS_VERSION}.tar.gz
99 tar -xf liblouis-*.tar.gz
10 ( cd liblouis-* && ./configure && make && sudo make install )
10 ( cd liblouis-${LIBLOUIS_VERSION} && ./configure && make && sudo make install )
1111 fi
1212 sudo ldconfig
1313
33 input.xml \
44 liblouisutdml.ini \
55 nabcc.dis \
6 output.txt \
76 pagenum.cti \
87 README \
98 semantics.sem \