ditype command line

DiType comes with a command line tool called ditype. It accepts a number of options and a list of source files to format as parameters. As a result of its invocation the files are formatted by DiType, and log messages printed on stderr.

ditype can be found in DiType installation directory in Framework/Commands/ under Windows and MacOSX, and in bin/ under Linux/Unix.

ditype is just a shell/batch script that invokes diclick.py, which is again a Python application talking to DiType. This explains the URL of this page.

The syntax of ditype invocation is as following:

$ ditype
Usage: diclick.py options args
  where options are zero or more of:
  -h host       host name (default: localhost),
  -p port       port number (default 19790),
  -i format     input format, default "auto"
  -d            turn on debugging,
  -f format     set output format (default is ps),
  -q            suppress logging;
  -a            output filename: append extension, rather than replace it
  args is a list of one or more XSL FO files.
$

The next line shows the usage of ditype to format a bunch of files to PDF on a DiType server running on a computer at 192.168.0.54 at TCP:19790, storing PDF files as ~'input.fo.pdf', and making DiType server recognize the format of each input file:

$ ls *.xml *.fo *.dbx *.wml | xargs ditype -f pdf -a -h 192.168.0.54 -p 19790

The output filename may not be specified because of the syntax accepting arbitrary long list of input files. There is (will be) another command line application called 'xep', that would simulate the behavior of 'xep' script in XEP4 and allow easy switching to DiType for users with simple integration scripts ontop of 'xep'.

A pair of (xml, xsl) may not be passed to ditype either, for the same reason. Instead, users are encouraged to add xml-stylesheet PIs to their source files right after the XML declaration, like this:

<?xml-stylesheet type="text/xsl" href="stylesheets/mystylesheet.xsl"?>

pending: add more info on each option, describe URI resolution

diclick (last edited 2008-04-28 13:26:56 by TigranAghababyan)