redtext mirror tools
These are the tools used to create and maintain a red texts mirror.
To create an archive, run:
git clone https://github.com/redtexts/mirror-tools cd mirror-tools ./mirror.sh
This will guide you through the configuration process, and warn you if
you don't have the right software installed. Your configuration will by
default be stored in a file called
mirror.sh doesn't expect
you to edit this by hand, hence only do so if you are absolutely certain
of what you are doing.
The script will only generate output, if something goes wrong or pandoc
generates warning (eg.
<standard input>:6882: a special character is not allowed in a name) - one doesn't have to worry about the latter.
If you have a multiprocessor system, you can add options like
let the underlying
make system know that it can use up to four
threads. Generally speaking, every option given to
mirror.sh will be
passed on to
mirror.sh also supports automatic synchronisation, if
Make sure that you have a directory named
./txt/ in the root directory
of this repository. This directory must contain all the markdown
files, which are to be processed. If no files are found, naturally,
nothing can be done.
This directory also serves as the "build directory". All
To properly build everything, the following tools will have to be installed, besides a standard *NIX userland:
- make: for coordinating the building of the necessary documents
- pandoc (version 2.0 or greater): to convert from markdown
- Calibre, or specifically
ebook-convert: to convert from
- XeTeX/XeLaTeX: for proper, quality pdf generation or Groff: for quick and lightweight pdf generation
- AWK: for generating
keywords.htmland extracting metadata from the markdown files.
At the very least
make, pandoc and AWK are required. This will let you
To customize your specific mirror, edit the
res/footer.txt files to respectivly add HTML markup above and below
the generated text table. If these are not found, no text is inserted
and no error is reported.
If you wish to have a different layout on your mirror, all you have to
do is customise the
style.css file in the root directory of this
In case want to change your
mirror.sh config, either delete the
.auto file in your working directory, in case you told
automatically use your configuration.