#pubdate 2017-12-28 08:40:13 +0100 #title Offline tools #lang en #topics howto, doc #teaser Installation and explanation of the Text::Amuse tools Amusewiki stores its files in a plain text lightweight format called Emacs Muse (actually a dialect of it) and described in depth in the [[https://amusewiki.org/library/manual][manual]]. Such files are always listed in the infobox with the downloads and are labelled as “plain text source” and have a =.muse= extension. The same file is also bundled in the =.zip=, which also gives you the eventual attachments. The format is not couple with the web application, and you can produce PDF, EPUB, HTML files from Muse files locally. ** Installation The tools are written in Perl. Every GNU/Linux operating system comes with Perl installed. They are supposed to work on Mac and Windows too, but you have to find your way to get Perl installed (together with a way to install modules from CPAN, the repository of Perl code, usually the program called =App::cpanminus=, which is invoked with the command =cpanm=). Also, if you want (and you probably want) to produce PDF, you need the installation of a recent [[http://tug.org/texlive/][TeX Live distribution]]. *** Debian and Ubuntu The parser, the compiler and the preprocessor are packaged for Debian. So you could do: {{{ # add the key wget -O - https://packages.amusewiki.org/amusewiki.gpg.key | apt-key add - # add a source list entry echo 'deb http://packages.amusewiki.org/debian jessie main' > /etc/apt/sources.list.d/amusewiki.list # install the tools apt-get install libtext-amuse-perl libtext-amuse-preprocessor-perl libtext-amuse-compile-perl }}} TeX Live will be pulled in as dependency. *** Manually Install TeX Live following the instructions in the [[http://tug.org/texlive/][TeX Live homepage]]. Install the Perl modules from CPAN: {{{ cpanm Text::Amuse::Compile Text::Amuse::Preprocessor }}} ** Usage One way or another, you should have the executable files =muse-compile.pl= and =muse-preprocessor.pl= installed. {{{ which muse-preprocessor.pl │ # /usr/bin/muse-preprocessor.pl which muse-compile.pl # /usr/bin/muse-compile.pl }}} Typical usage: {{{ # download the manual to use as sample. Please note the .zip # extension, so we get the attachments as well. wget https://amusewiki.org/library/manual.zip unzip manual.zip cd manual muse-compile.pl --help --verbose muse-compile.pl --html --epub --pdf manual.muse }}} This command will produce HTML, EPUB and PDF files. See =muse-compile.pl --help --verbose= for the full list. The preprocessor is used if you need to cleanup your document. It has the same options present in the editing amusewiki page. {{{ muse-preprocessor.pl --help muse-preprocessor.pl --inplace --show-nbsp --typography \ --links --footnotes manual.muse }}} See also [[https://amusewiki.org/library/working-with-footnotes][Working with footnotes]] for an in-depth explanation of the =--footnotes= switch. The preprocessor can also convert HTML pages to muse. {{{ html-to-muse.pl https://packages.amusewiki.org/ }}} See also [[https://pandoc.org/][Pandoc]] for the same functionality. Additionally, with Pandoc you can import/export Muse files from and to a very wide range of formats.