Zerodoc Documentation

Similar documents
LECTURE 26. Documenting Python

The RestructuredText Book Documentation

Recommonmark Documentation

Introduction to Python Documentation

Flask-Misaka Documentation

CuteFlow-V4 Documentation

This is a paragraph. It's quite short.

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

xmljson Documentation

SphinxTutorial Documentation

Pulp Python Support Documentation

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program

tappy Documentation Release 2.5 Matt Layman and contributors

ndeftool documentation

docs-python2readthedocs Documentation

EL2310 Scientific Programming

HTML. Based mostly on

odpdown - markdown to slides

Who needs Pandoc when you have Sphinx? An exploration of the parsers and builders of the Sphinx documentation tool FOSDEM

Written & Oral Presentation: Computer Tools

pydocstyle Documentation

Documenting Code. Plain Old Documentation (POD) markup language

Simple libtorrent streaming module Documentation

Moving ROOT Documentation from Docbook to Markdown

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

Bitdock. Release 0.1.0

Comp151 Lab Documentation using Doxygen

USER GUIDE. MADCAP FLARE 2017 r3. Import

doconv Documentation Release Jacob Mourelos

- c list The list specifies character positions.

Python Project Documentation

EL2310 Scientific Programming

Chapter 2 Author Notes

Making Your Word Documents Accessible

Emacs manual:

Socrates Documentation

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5.

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next.

Python simple arp table reader Documentation

Application documentation Documentation

Introduction to C++ Programming Pearson Education, Inc. All rights reserved.

CREATING ANNOUNCEMENTS. A guide to submitting announcements in the UAFS Content Management System

CSS - Cascading Style Sheets

Center for Faculty Development and Support Making Documents Accessible

yaml4rst Documentation

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead.

Pymixup Documentation

Be sure to read ENCODING if your Pod contains non-ascii characters.

CSE 11 Style Guidelines

Objective % Select and utilize tools to design and develop websites.

Reproducible research and knitr

The mat2doc documentation system

Package markdown. February 15, 2013

Behat Drupal Integration Documentation

How to Edit Your Website

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

Doxygen A source documentation tool.

LibSerial Documentation

Full file at C How to Program, 6/e Multiple Choice Test Bank

Intermediate Programming, Spring Misha Kazhdan

1. After you have uploaded a file in the CE Import option, you will receive a notice asking if you want to open or save the results file.

Understanding the Web Design Environment. Principles of Web Design, Third Edition

Creating Web Pages with SeaMonkey Composer

Day One Export Documentation

htmlmin Documentation

Intro to HPC Exercise

Sphinx JS HowTo Documentation

4. Structure of a C++ program

google-search Documentation

Django-CSP Documentation

Dreamweaver CS 5.5. University Information Technology Services. Training, Outreach, Learning Technologies, and Video Production

First Midterm Exam CS164, Fall 2007 Oct 2, 2007

Additional Support and Disability Advice Centre

Creating Accessible Word Documents

ZeroVM Package Manager Documentation

Project 1: Implementing a Shell

RAGE WebDesign Quick Start 1 of 18. Welcome To RAGE WebDesign

Quark XML Author October 2017 Update with Business Documents

g-pypi Documentation Release 0.3 Domen Kožar

FSASIM: A Simulator for Finite-State Automata

How to Edit Your Website

Quark XML Author for FileNet 2.5 with BusDocs Guide

Review of Fundamentals

Quick.JS Documentation

Languages and Compilers

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang

Django QR Code Documentation

Tcl/Tk for XSPECT a Michael Flynn

Hotmail Documentation Style Guide

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

KOFAX TO LASERFICHE RELEASE SCRIPTS

Raspberry Pi Class Ed 299. Mike Davis Truman College 5/26/2015

CHAPTER 2. Troubleshooting CGI Scripts

It is possible to create webpages without knowing anything about the HTML source behind the page.

python-hl7 Documentation

Java Style Guide. 1.0 General. 2.0 Visual Layout. Dr Caffeine

Libra Client Documentation

Project 1. Java Control Structures 1/17/2014. Project 1 and Java Intro. Project 1 (2) To familiarize with

Transcription:

Zerodoc Documentation Release 0.2.0 Pablo Martin Medrano <pablo@odkq.com> August 17, 2014

Contents 1 Zerodoc 3 1.1 1. The zerodoc format.......................................... 3 1.2 2. Installing zerodoc........................................... 10 1.3 3. Using the command line converter.................................. 11 2 Indices and tables 13 i

ii

Contents: Contents 1

2 Contents

CHAPTER 1 Zerodoc Version 0.2.0 Last updated 2014-08-17 pablo@odkq.com Zerodoc is a plain text format in the spirit of asciidoc, POD, restructuredtext or markdown, with an emphasis on simplicity and extensibility. Very few formatting options are avaliable, both to keep the parser simple and to make it easy to write new generators for the whole format. Included are a Python library can be used to translate an input file or buffer into a tree that for wich generators can be easily written, and a command line tool to call existing generators for HTML, restructuredtext (that can then be converted or integrated with other tools like Sphinx) and a JSON intermediate representation. 1.1 1. The zerodoc format 1.1.1 1.1 Paragraphs and lines Zerodoc files are simple text files organized in paragraphs. A paragraph is a group of text lines separated from other paragraphs by blank lines. Lists and source code copied verbatim can be defined. An unintrusive format for links is used, based on a references system. Lines are limited to 72 characters for regular (not code or diagrams) text. If you need to put something more into a line (for example, a long URL), divide it in two and put a backslash () with no spaces at the end. Example: This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f11 Renders into: This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredirection.com/redirecti 1.1.2 1.2 Lists Lists are defined as paragrahps prefixed with a dash, and can be nested. Example - The first element in a list - A nested element into the first consisting of two lines that are joined on output - Another nested element - The third element in a list 3

Renders into: The first element in a list A nested element into the first consisting of two lines that are joined on output Another nested element The third element in a list Backslash joining also occur inside list elements: - The first element in a list. as it have two lines with no backslash, an space is inserted between lines and with - To join the two lines without adding a space a back\ slash is used. Note that the two spaces formatting the listline are removed renders into: The first element in a list. as it have two lines with no backslash, an space is inserted between lines and with To join the two lines without adding a space a backslash is used. Note that the two spaces formatting the listline are removed after the backslash NOTE: There are no numbered lists. In the phylosophy of zerodoc, numbers can not be omited from the original text nor computed because that will make the text less readable than it s processed output. 1.1.3 1.3 Formatting attributes Some attributes for the text inherited from other common formats and email conventions are supported: - This is an *emphasis* - This is an _underline_ (cursive on certain displays or formats, as in manual pages) - This is a cursive Renders into: This is an emphasis This is an _underline_ (cursive on certain displays or formats, as in manual pages) This is a cursive 1.1.4 1.4 Links Links can be included directly in the text along with their destination, or referenced first in the text and then resolved in another line. Source of a link: This link :http://www.google.com will redirect to google Will render as: This link will redirect to google Referenced links are resolved in lists of links. This lists of links will be removed from output directly. If the list is contained in a section alone, the section is also removed from output. See the References section at the end of the source code of this document for an example. An autocontained example could be: 4 Chapter 1. Zerodoc

This line contains two referenced links: firstlink and secondlink - firstlink :http://www.google.com - secondlink :http://www.google.com Wich renders into: This line contains two referenced links: firstlink and secondlink 1.1.5 1.5 Source code Source code is text that will be included verbatim in the output. In source code, newlines are meaningful and no limits on line-length are imposed. An example: #include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("hello, world!\n"); } } Source code is identified by one space before the content of the first line and one or more spaces in the rest. No tabs can be used, so either transform tabs-only source code before pasting or use a tool like expand(1) to do it for you. Blank lines are also included verbatim, up to the one delimiting the next regular paragraph (one that contains text and starts on the first column) To illustrate source code, i am going to paste the source code (yo dawg) of the example above, along with the regular paragraph-lines sorrounding it: source code, newlines are meaningful and no limits on line-length are imposed. An example: #include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("hello, world!\n"); } } Source code is identified by one space before the content of the first line and one or more spaces in the rest. No tabs can When pygmentize is used, the default language for syntax highlighting can be specified in options. 1.1.6 1.6 Diagrams and images Diagrams can be either included directly in the output, just as source code, or optionally converted to images (when this is possible, for example in a manual page it does not make sense to include images). Diagrams are converted using ditaa, aafigure, ascii2svg or tikz depending on the options parsed to the renderer. Refer to the aafigure manual page or to the ditaa website for help on this formats. 1.1. 1. The zerodoc format 5

Diagrams are recognized by using TWO or more spaces before the first line of them. Anything up to the next regular paragraph is considered part of the diagram. Source-code paragraphs and diagrams can not be adjacent; they need a regular text paragraph (starting on the first column) between them. This makes sense since no diagram can follow source code or viceversa without at least an introduction of what the reader is seeing. 1.6.1 ASCIIToSVG ascii-art diagrams The default for ascii art diagrams is asciitosvg. As it name implies, it converts text to SVG wich is quite convenient. It is written in php. Example diagram: (asciitosvg) 1.6.2 aafigure ascii-art diagrams Another format to convert ascii art diagrams to graphics is aafigure. it is written in Python and have quite convenient idioms for things like sequence diagrams: 1.6.3 ditaa ascii-art diagrams Another common format for ascii art diagrams is ditaa. It does not support svg output. This is the source code of the following paragraph (diagram taken from the ditaa website : Example diagram: (ditaa) +--------+ +-------+ +-------+ --+ ditaa +--> Text +-------+ diagram Document!magic! {d} +---+----+ +-------+ +-------+ 6 Chapter 1. Zerodoc

: ^ Lots of work +-------------------------+ This is the source code of the following paragraph (diagram taken from the ditaa website Note that there are two spaces before the first + 1.6.4 TikZ diagrams A Tikz diagram (from the Tikz examples) 1.1. 1. The zerodoc format 7

LaTeX source code for that Tikz chunk: \begin{tikzpicture}[auto,node distance=3cm, thick,main node/.style={circle,fill=blue!20,draw, font=\sffamily\large\bfseries}] \node[main node] (1) {1}; \node[main node] (2) [below left of=1] {2}; \node[main node] (3) [below right of=2] {3}; \node[main node] (4) [below right of=1] {4}; \path[every node/.style={font=\sffamily\small}] (1) edge node [left] {0.6} (4) edge [bend right] node[left] {0.3} (2) edge [loop above] node {0.1} (1) (2) edge node [right] {0.4} (1) edge node {0.3} (4) edge [loop left] node {0.4} (2) edge [bend right] node[left] {0.1} (3) (3) edge node [right] {0.8} (2) edge [bend right] node[right] {0.2} (4) (4) edge node [left] {0.2} (3) edge [loop right] node {0.6} (4) edge [bend right] node[right] {0.2} (1); \end{tikzpicture} 8 Chapter 1. Zerodoc

1.6.6 Diagram tagging and autodetection As with source code, the type of diagram is autodetected for Tikz and gnuplot diagrams. This detection can be overriden by specifing it in the first line of the diagram, between parenthesis. 1.1.7 1.7 Definition lists A definition list is a list of terms and corresponding definitions. It usually renders (in HTML, man pages, ReST) in the text of the definition indented with respect to the title. It is useful for documenting functions and command line parameters. Following is an example: man ls Display the manual page for the item (program) ls. man -a intro Display, in succession, all of the available intro manual pages contained within the manual. It is possible to quit between successive displays or skip any of them. that renders into: man ls Display the manual page for the item (program) ls. man -a intro Display, in succession, all of the available intro manual pages contained within the manual. It is possible to quit between successive displays or skip any of them. 1.1.8 1.8 The default zerodoc structure 1.8.1 Header The header in a zerodoc document contains the title, an optional abstract and a table of contents. The table of contents needs to be updated by hand (this is different from other well known text formats but allow zerodoc to have free-form titles (no nor ~~~ nor any other form of markup is needed): This is the title, that can spawn several lines This are one or several paragraphs of abstract 1. Title 1 2. Title 2 1.8.1.1 Title The title can spawn several lines (a whole paragraph) that will be joined together on output The table of contents can be prefixed by a Table of conents line that will be recognized automatically as the TOC title. If that line is not present, it will also be ommited on the transformed output. 1.8.1.2 Abstract The abstract is a group of paragraphs that appear before the Table of content. 1.1. 1. The zerodoc format 9

1.8.1.3 Table of contents The table of contents is a list of the titles of the different sections, for example - 1. Section one - 2. Section two - 3. Third section Will define the table of contents of a document, if found in the header (after the abstract). If a title listed here is not found in the document, an error is yielded. 1.8.2 Body The body is formed by several paragraphs. Paragraphs are divided into sections by lines with titles. The lines with titles should appear in the TOC and should have the same content as the TOC. Optionally they can be in uppercase for clarity. As the transformed document usually will have better ways to emphasize the title, the lowercase format used in the TOC will be used regardless of uppercase being used. For example, the next section of this document starts with 2. INSTALLING ZERODOC 2.1 Prerrequisites And in the TOC the pertinent lines appear as: -- toc fragment -- - 1.7.1.3 Table of contents - 1.7.2 Body - 2. Installing zerodoc - 2.1 Prerrequisites As you can see on the start of the next section, the title appears in lowercase (as in the TOC above) 1.2 2. Installing zerodoc 1.2.1 2.1 Prerrequisites Zerodoc needs Python (2.6 or newer) the Python PLY lex and yacc utilities (2.5 or newer) and distutils for installation. Aditionally when generating diagrams, the programs to parse them need to be installed as well. As an example, in a GNU/Linux Debian 6.0 Squeeze system, the requirements can be installed using: # apt-get install python-ply python-aafigure ditaa To generate diagrams with gnuplot or tikz, install the pertinent packages # apt-get install gnuplot # apt-get install texlive-picture 1.2.2 2.2 Installing the library and interpreter 2.2.1 Using a git snapshot Clone the github repository using 10 Chapter 1. Zerodoc

$ git clone git://github.com/odkq/zerodoc.git Change to the zerodoc dir and call setup.py as root $ cd zerodoc/ $ sudo./setup.py install 2.2.2 Using pypi 1.3 3. Using the command line converter zerodoc - converts a zerodoc text file to HTML and many other formats 1.3.1 3.1 SYNOPSIS Usage: zerodoc [options] Options: -h, help show this help message and exit -f FORMAT, format=format Output format. If ommited, html -o OPTIONS, options=options Options for format renderer -i FILE, input=file Use <filename> as input file. If ommited, use stdin. -O FILE, output=file Use <filename> as output file. If ommited,use stdout. 1.3.2 3.2 HTML output options ditaa Use ditaa to format diagrams. When this option is used, you can specify the path of the ditaa.jar file with jarpath:<path>. If jarpath is ommited, ditta will be called (you can install a command-line ditta wraper in Debian and others with apt-get install ditaa) jarpath:<path> Location of the.jar path (there is no default, java must be in the $PATH) aafigure Use aafigure to format diagrams svg Prefer svg in output when applicable (when the converter outputs it and when the rendered format allows for scalable graphics) datauri Do not generate image files, embbed the images directly in the HTML using DataURIscheme 1.3.3 3.3 restructuredtext output options notoc Usually restructuredtext processors attach their own index in the side (sphinx-doc, for example). In that case, you better do not output the toc (it is still used to get section titles) 1.3.4 3.4 JSON output options Json output has no options. It s output is the json render of the parsed tree with no interpretation whatsoever 1.3. 3. Using the command line converter 11

1.3.5 3.5 Confluence output options ditaa, jarpath, aafigure, datauri With the same meaning as in the HTML output options You can specify an output file, and paste it by hand into the confluence edition formulary, or you can make zerodoc client upload it directly with this options: folder:<folder> Folder (path) for the uploaded document user:<user> User to use passwd:<passd> Password host:<host> Host 12 Chapter 1. Zerodoc

CHAPTER 2 Indices and tables genindex modindex search 13