Creating, editing and binding your documents with MarkupBinder >


Using MarkupBinder from the command line

You can use the text editor of your choice to create and edit binder documents (content) and then issue the various MarkupBinder commands from the command line. MarkupBinder is written in Java and the executable is called in all systems markup-binder.jar. While you can call this file directly with the command:
Java -jar directoryPath/markup-binder.jar [command line parameters]
it is more convenient to use a wrapper shell / batch file available for this purpose as follows:

Vinux

A markup-binder shell script is available globally; simply issue the command:
markup-binder [command line parameters]

Windows

In Windows, the Java executable and the accompanying batch files are placed by default in the folder:
C:\MarkupBinder

To use MarkupBinder issue the command:
C:\MarkupBinder\markup-binder.bat [command line parameters]

You can of course place the C:MarkupBinder folder in your system path to make usage simpler.

Command line parameters

MarkupBinder accepts the following command line parameters which can be summarized as follows:

[-all|-web|-clean|-version] [path]

or abbreviated flags made of the first character of each longer flag above:

[-a|-w|-c|-v] [path]

[path] (file or folder)

If the path is a file:
Build Document Page
Converts the specified Markdown file and generates a page.

If the path is a folder:
Build Folder
In the current folder and all its sub-folders, for files that have been changed, converts all individual Markdown files generating content pages together with their header and links to other parts of the binder and generates all required index files and style sheets.

[-all|-a] [path]

Build Binder
For the whole binder (starting from its root), for files that have been changed, converts all individual Markdown files generating content pages together with their header and links to other parts of the binder and generates all required index files and style sheets.

[-web|-w] [path]

Rebuild Web Binder
Copies the binder folder structure with the name of the binder suffixed with '-Web'. Renames all folders so that spaces are replaced by underlines '_'. Converts all individual Markdown files generating content pages together with their header and links to other parts of the binder. Replaces all file names with underline '_'. Generates all required index files and style sheets. This 'Web ready' binder folder structure should be ready for uploading to a web site.

Note that for the -all and -web argument flags above, the path can point to either a file or a folder within the binder.

[-clean|-c] [path]

Clean
Cleans the entire binder by deleting all non Markdown files including HTML files and the 'Web' folder.

[-version|-v]

Displays the version of MarkupBinder and copyright information.

-[from]2[to] [path]

Single File Conversion
A series of related flags for single file conversions; these flags act as a convenient wrapper for Pandoc. Note that these are pure single file conversions without the usual binder headers and footers for navigation.

MarkupBinder format abbreviations

[from] (input):

html = html
md = markdown
rst = reStructuredText
tex = latex

[to] (output):

ctx = ConTeXt
dbk = DocBook XML
epub = epub
html = HTML
man = groff man (Apple manual pages)
md = Markdown
mw = MediaWiki
odf = OpenDocument XML
odt = OpenOffice text document
rst = reStructuredText
rtf = rich text format
s5 = S5 (an HTML file that acts like powerpoint presentation)
tex = LaTeX
txt = plain text
txi = GNU Texinfo

Note that the abbreviations in the [to] formats above usually result in files with the same file extension but there are some exceptions: for example the S5 format uses a '.html' file extension.

There is an additional variation on the Markdown conversion 'mdp' which converts to a Pandoc variant of Markdown. More specifically this conversion ensures that a new line at the end of a line is identified with '\' and a code block is identified with '~~~' characters. This conversion is not part of Pandoc itself and it is experimental.

The following are example of flags and their actions:

-md2rtf
Converts Markdown to RTF

-html2md
Converts HTML to Markdown


[ Previous - Customizing your binder ]

[ Up - Creating, editing and binding your documents with MarkupBinder - Section ]

[ Up 2 - MarkupBinder Manual - Main Index ]