Skip to content

Commit

Permalink
Updated everything, which led to various knock-on changes. Most are
Browse files Browse the repository at this point in the history
quite minor.  No significant content changes (a few word definitions
got updated from jbovlaste).

- updated Prince version
- build supports podman as well as docker
- non-container builds no longer officially supported
- jbovlaste.xml is now stored in the github tree so we don't get
  surprise word definition changes we didn't want
- diffs now support vimdiff mode
- much easier addition of new versions to official/ using
  scripts/update_official
- fixed an issue where "table > tr" was working in the CSS only
  because of a Prince bug; it turns out that HTML inserts an
  invisble "tbody" in between the two
- fixed an issue where the namespace for MathML was no longer
  correct for the new Prince version
- updated gems, including dealing with the rename of Trollop to
  Optimist
  • Loading branch information
rlpowell committed Dec 15, 2019
1 parent 85bde61 commit bee6c7f
Show file tree
Hide file tree
Showing 23 changed files with 263,701 additions and 310 deletions.
33 changes: 23 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
FROM rlpowell/fedora_base
FROM fedora:30

# Initial Setup, Basic Package Installs
RUN dnf -y update
RUN dnf -y remove vim-minimal
RUN dnf -y reinstall shadow-utils # needed for man pages, dunno why
RUN dnf -y install vim sudo tmux zsh moreutils make moreutils sudo \
dos2unix strace git the_silver_searcher procps-ng openssh-server \
initscripts openssh man-db ncurses-compat-libs wget curl \
libcurl-devel pcre-devel bzip2-devel rsync zlib-devel \
pkgconfig w3m openssl-devel gcc rubygem-rake fpaste \
zip unzip psmisc lsof python yum-plugin-ovl

# Specifically needed packages, with versions where the package is
# important.
RUN dnf -y install xmlto-0.0.28 ruby-devel libxml2-devel libxslt-devel redhat-rpm-config tidy \
dejavu-fonts-common-2.35 dejavu-serif-fonts-2.35 linux-libertine-biolinum-fonts-5.3.0 \
linux-libertine-fonts-5.3.0 linux-libertine-fonts-common-5.3.0 unifont-9.0.06 \
unifont-fonts-9.0.06 dejavu-sans-mono-fonts.noarch java-1.8.0-openjdk-headless.x86_64
RUN dnf -y install xmlto-0.0.28 ruby-devel libxml2-devel \
libxslt-devel redhat-rpm-config tidy dejavu-fonts-common \
dejavu-serif-fonts linux-libertine-biolinum-fonts \
linux-libertine-fonts linux-libertine-fonts-common unifont \
unifont-fonts dejavu-sans-mono-fonts.noarch \
java-1.8.0-openjdk-headless.x86_64

# Language issues
RUN /bin/echo 'LANG=en_US.UTF-8' >/etc/locale.conf
Expand All @@ -24,10 +37,10 @@ RUN bundle config build.nokogiri --use-system-libraries
RUN bundle install

# Prince XML Setup
RUN cd /usr/src ; wget https://www.princexml.com/download/prince-10r7-1.centos7.x86_64.rpm
RUN dnf -y install /usr/src/prince-10r7-1.centos7.x86_64.rpm
RUN cd /usr/src ; wget https://www.princexml.com/download/prince-12.5-1.centos7.x86_64.rpm
RUN dnf -y install /usr/src/prince-12.5-1.centos7.x86_64.rpm

# Stuff to do on "boot"
COPY docker_init.sh /tmp/docker_init.sh
RUN sudo dos2unix /tmp/docker_init.sh
RUN sudo chmod 755 /tmp/docker_init.sh
COPY container_init.sh /tmp/container_init.sh
RUN sudo dos2unix /tmp/container_init.sh
RUN sudo chmod 755 /tmp/container_init.sh
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ source "https://rubygems.org"

raise 'Ruby >=2.0.0 required' unless RUBY_VERSION.to_f >= 2.0

gem 'trollop', '~> 2.1'
gem 'nokogiri', '~> 1.8'
gem 'optimist', '~> 3.0'
gem 'nokogiri', '~> 1.10'
gem 'htmlentities', '~> 4.3'
17 changes: 10 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ GEM
remote: https://rubygems.org/
specs:
htmlentities (4.3.4)
mini_portile2 (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
trollop (2.1.2)
mini_portile2 (2.4.0)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
optimist (3.0.0)

PLATFORMS
ruby

DEPENDENCIES
htmlentities (~> 4.3)
nokogiri (~> 1.8)
trollop (~> 2.1)
htmlentities
nokogiri
optimist

BUNDLED WITH
2.0.2
87 changes: 16 additions & 71 deletions README
Original file line number Diff line number Diff line change
@@ -1,99 +1,44 @@
TO USE DOCKER:

Instead of ./cll_build below, use the same commands with:

./run_docker.sh

Note that it expects to need sudo to run docker commands; if that
causes a problem for you let me (rlpowell) know and we'll figure out
a fix, but needing sudo for docker is pretty common.

You don't *need* to use docker, but if you don't you'll have to put
together all the requirements yourself, and they'll need to match
versions, and so on. I really strongly suggest using the Docker
version.

- ---

To make all the versions do:

./cll_build
./run_container.sh

The final results will end up under the build/ directory, scattered
about in various places. If you would like the final outputs only
to be copied to another directory, you can use the -a option, so for example:
to be copied to another directory, i.e. for web display, you can use
the -a option, so for example:

./cll_build -a output/
./run_container.sh -a output/

would put all the outputs in the output/ directory, whereas

./cll_build -a ~/public_html/cll_build/
./run_container.sh -a ~/public_html/cll_build/

would put them in your personal webspace.

Running a complete build takes quite a while (like probably at least
an hour). To do it for just one chapter for faster testing:

./cll_build -t chapters/05.xml
./run_container.sh -t chapters/05.xml

This does the whole book but is also much faster:

./cll_build -t
./run_container.sh -t

There are many possible sub-targets as well, which are specified
with -T, such as:

./cll_build -t -T pdf
./run_container.sh -t -T pdf

You can get a complete list of targets via:

./cll_build -h

Requirements
------------

Getting this all working is actually a pretty huge undertaking;
you're almost certainly better off asking Robin Lee Powell for an
account on the appropriate server.

General/HTML
------------

xsltproc

xmlto

Normal linux tools probably like tar. You definitely need wget,
in particular.

The actual docbook packages (i.e. the docbook 5.0 XSLT stuff)

Ruby

All the Ruby gems mentioned in Gemfile; in fact the normal way to
do this sort of thing is:

$ gem install bundler
$ bundle install

and that should get all the dependencies for you (although I
(rlpowell) don't do it that way myself, so this is untested by me
and you might have to do "bundle exec ..." with your build
commands or something; regardless, there's only like 3 gem
dependencies).

PDF Generation
--------------

prince ( http://www.princexml.com/ )

./run_container.sh -h

MOBI / EPUB
-----------
Container/sudo Notes
--------------------

ebook-convert (from calibre, but the yum package doesn't really
work; use the binary install at
https://calibre-ebook.com/download_linux )
The builds will run in a podman (preferred) or docker container,
depending on what you have available.

Xvfb and xvfb-run (fake X for calibre) or a running X server
session -- MAYBE NOT ACTUALLY NEEDED
All container commands are run with sudo. This is a pretty standard
requirement for container use; if it causes you problems let me
(rlpowell) know and we'll try to figure something out.
16 changes: 16 additions & 0 deletions README-tags
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ Example: <math>(1000 * L) - (500 * A) + (100 * H) - (10 * R) - V</math>
Used to wrap math that appears as its own paragrah; just shorthand
for docbook's <informalequation><mathphrase>

mmlmath / mmlinlinemath
-----------------------

Example:

<mmlinlinemath>
<mrow>
<mn>3</mn>
<mo>&InvisibleTimes;</mo>
<mi>x</mi>
</mrow>
</mmlinlinemath>

Gets turned (eventually) into MathML <math> tags, with
<inlineequation> or <informalequation> as appropriate.

grammar-template
----------------

Expand Down
Loading

0 comments on commit bee6c7f

Please sign in to comment.