| structural | DocBook | Markdown | Texinfo | troff | AsciiDoc | reStructuredText | LaTeX | |
|---|---|---|---|---|---|---|---|---|
| Metadata | Yes | Yes | No | No | No | No | No | No |
| Semantic Simplicity | Yes | No | Maybe [3] | No | No | No | No | No |
| Lightweight Syntax | Yes | No | Yes | Yes | Yes | Yes | Yes | Questionable |
| Specification | Yes | Yes | Informal | No | No | No | Informal | No |
| Portability | Yes | Yes | Maybe [4] | Yes | Maybe [5] | Yes | Yes | Yes |
| Modular Documents | Import | Import | No | Include | No | Include | No | Include |
$ mvn -C clean install
<!-- For the user-friendly frontend Java API --> <dependency> <groupId>com.io7m.kstructural</groupId> <artifactId>io7m-kstructural-frontend</artifactId> <version>0.1.0</version> </dependency>
Copyright © 2016 <code@io7m.com> http://io7m.com Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Usage: kstructural [options] [command] [command options]
$ java -jar io7m-kstructural-cmdline-0.3.1-main.jar
check Check document syntax and structure
Usage: check [options]
Options:
* -file
Input file
-verbose
Set the minimum logging verbosity level
Default: info
Possible Values: [trace, debug, info, warn, error]
$ java -jar kstructural.jar check -file valid.sd
$ echo $?
0
$ java -jar kstructural.jar check -file invalid.sd
ERROR com.io7m.kstructural.frontend.KSOpCheck: invalid.sd: 1:14: Expected an inline element.
Expected: [symbol:{image | include | link-ext | link | term | verbatim | footnote-ref | table | list-ordered | list-unordered} ... ]
Received: [invalid]
$ echo $?
1compile-xhtml Compile documents to XHTML
Usage: compile-xhtml [options]
Options:
-brand-bottom
Append the contents of the given XML file to each XHTML page's body
element
-brand-top
Prepend the contents of the given XML file to each XHTML page's
body element
-css-create-default
Create the default CSS files in the output directory
Default: true
-css-extra-styles
A comma-separated list of extra CSS styles (as URIs) that will be
used for each page
Default: []
-css-include-default
Include links to the default CSS files
Default: true
* -file
Input file
* -output-dir
The directory in which output files will be written
-pagination
The type of XHTML pagination that will be used
Default: multi
Possible Values: [single, multi]
-render-toc-document
Render a table of contents at the document level
Default: true
-render-toc-part
Render a table of contents at the part level
Default: true
-render-toc-section
Render a table of contents at the section level
Default: true
-verbose
Set the minimum logging verbosity level
Default: info
Possible Values: [trace, debug, info, warn, error]
$ java -jar kstructural.jar compile-xhtml -file valid.sd -output-dir /tmp $ echo $? 0 $ java -jar kstructural.jar compile-xhtml -pagination single -file valid.sd -output-dir /tmp $ echo $? 0 $ file /tmp/index-m.xhtml /tmp/index-m.xhtml: XML 1.0 document, ASCII text, with very long lines, with CRLF line terminators $ file /tmp/index.xhtml /tmp/index.xhtml: XML 1.0 document, ASCII text, with very long lines, with CRLF line terminators
compile-latex Compile documents to LaTeX
Usage: compile-latex [options]
Options:
* -file
Input file
* -output-dir
The directory in which output files will be written
-type-map
A file containing type name to LaTeX emphasis mappings
-verbose
Set the minimum logging verbosity level
Default: info
Possible Values: [trace, debug, info, warn, error]
mapping =
term_name , ':' , style ;
term_character =
p{isLetter} | p{isNumber}_ ;
term_name =
term_character , { term_character } ;
style =
"bold" | "mono" | "italic" ;
package : bold function : mono term : italic
$ java -jar kstructural.jar compile-latex -file valid.sd -output-dir /tmp $ echo $? 0 $ file /tmp/main.tex /tmp/main.tex: ASCII text, with very long lines
compile-plain Compile documents to plain text
Usage: compile-plain [options]
Options:
* -file
Input file
* -output-dir
The directory in which output files will be written
-verbose
Set the minimum logging verbosity level
Default: info
Possible Values: [trace, debug, info, warn, error]
$ java -jar kstructural.jar compile-plain -file valid.sd -output-dir /tmp $ echo $? 0 $ file /tmp/main.txt /tmp/main.tex: UTF-8 Unicode text
convert Convert documents between input formats
Usage: convert [options]
Options:
* -file
Input file
-format
The format that will be used for exported documents
Default: canonical
Possible Values: [canonical, imperative, xml]
-indent
The number of spaces that will be used to indent documents
Default: 2
-no-imports
Export as one large document that does not contain any imports
Default: false
* -output-dir
The directory in which output files will be written
-verbose
Set the minimum logging verbosity level
Default: info
Possible Values: [trace, debug, info, warn, error]
-width
The maximum width in characters that will be used when formatting
documents
Default: 80
$ cat valid.sd
[document
[title A document]
[section
[title A section]
[paragraph A paragraph]]]
$ java -jar kstructural.jar convert -file valid.sd -output-dir /tmp -format imperative
$ java -jar kstructural.jar convert -file valid.sd -output-dir /tmp -format xml
$ cat /tmp/main.xml
<?xml version="1.0" encoding="UTF-8"?>
<s:document s:title="A document" xmlns:s="http://schemas.io7m.com/structural/3.0.0">
<s:section s:title="A section">
<s:paragraph>A paragraph</s:paragraph>
</s:section>
</s:document>
$ cat /tmp/main.sdi
[document [title A document]]
[section [title A section]]
[paragraph]
A paragraph
<plugin>
<groupId>com.io7m.kstructural</groupId>
<artifactId>io7m-kstructural-maven-plugin</artifactId>
<version>0.3.1</version>
<executions>
<execution>
<id>exec-multi</id>
<goals>
<goal>compileXHTML</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<documentFile>src/main/resources/documentation/documentation.sd</documentFile>
<outputDirectory>target/documentation/</outputDirectory>
<pagination>XHTML_MULTI_PAGE</pagination>
<brandTopFile>src/main/resources/documentation/brand.xml</brandTopFile>
<renderTOCDocument>true</renderTOCDocument>
<renderTOCSection>true</renderTOCSection>
<renderTOCPart>true</renderTOCPart>
<cssIncludeDefault>true</cssIncludeDefault>
<cssCreateDefault>true</cssCreateDefault>
<cssExtraStyles>
<param>documentation.css</param>
</cssExtraStyles>
</configuration>
</execution>
</executions>
</plugin>| One | Two | Three |
|---|---|---|
| Top Left | Top Middle | Top Right |
| Middle Left | Middle Middle | Middle Right |
| Bottom Left | Bottom Middle | Bottom Right |
| Top Left | Top Middle | Top Right |
| Middle Left | Middle Middle | Middle Right |
| Bottom Left | Bottom Middle | Bottom Right |
| Top One | Top Two | |
| Middle One | Middle Two | Middle Three |
| Bottom One |
� � � � � � � � �
� �
� � � � � � � � � � � � � � � � � �
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ `
a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \end{verbatim}