DocOnce by hplgit (original) (raw)

A lightweight markup language - document once, include anywhere

Download .zip Download .tar.gz View on GitHub

Users are strongly encouraged to use the most recent software in the GitHub repository and not the tarballs!


Document once, include anywhere

DocOnce is a modestly tagged (Markdown-like) markup language targeting scientific reports, software documentation, books, blog posts, and slides involving much math and code in the text. From DocOnce source you can generate LaTeX, Sphinx, HTML, IPython notebooks, Markdown, MediaWiki, and other formats. This means that you get the most up-to-date publishing technologies for paper, tablets, and phones.

Highlights

Demo

A short scientific reportdemonstrates the many formats that DocOnce can generate and how mathematics and computer code look like. (Note that at the bottom of the page there is a link to another version of the demo with complete DocOnce commands for producing the different versions.)

Another demo shows how DocOnce can be used to create slides in various formats (HTML5 reveal.js, deck.js, etc., as well as LaTeX Beamer).

DocOnce has support for responsive HTML documents with design and functionality based on Bootstrap styles. A demoillustrates the many possibilities for colors and layouts.

DocOnce also has support for exercises in quiz format. Pure quiz files can be automatically uploaded to Kahoot! online quiz games operated through smart phones (with the aid of quiztools for DocOnce to Kahoot! translation).

A complete book(900 pages) has been written entirely in DocOnce. The primary format is a publisher-specific LaTeX style, but HTML or Sphinx formats can easily be generated, such as this chapter in the popular Bootstrap styleor the solarized color styleas many prefer. Slides can quickly be generated from the raw text in the book. Here are examples in the reveal.js(HTML5) style, or the more traditional LaTeX Beamerstyle, and even the modern IPython notebooktool, which allows for interactive experimentation and annotation.

Documentation

Warning.

These documents are under development...

Installation

DocOnce is a pure Python package and can be installed with pip.

Terminal> sudo pip install --upgrade git+https://github.com/doconce/preprocess Terminal> sudo pip install --upgrade .

However, DocOnce has a lot of dependencies, depending on what type of formats you want to work with and how advanced constructiosn that are used in the text.

With Anaconda it is trivial to install DocOnce and all dependencies by

Terminal> conda config --add channels conda-forge Terminal> conda install doconce

Warning.

As of March 2017, a few dependencies have yet to be added to the conda-forge channel, but most formats should work fine.

On Debian/Ubuntu it is fairly straightforward to get the packages you need. Basically, you can run a Bash script or an equivalent Python script. Such a script installs a very comprehensive bundle of software. You can read theInstallation Guide to get a more detailed description of what is needed of software for various purposes.

Install from GitHub repo, not from Debian.

Although DocOnce is in Debian, do not run sudo apt-get install python-doconceas this gives a very old version of DocOnce that is out of sync with the documentation. Instead, clone the DocOnce GitHub repo as shown above and run pip install or use conda install.