Skip to content

Commit

Permalink
command line utility
Browse files Browse the repository at this point in the history
  • Loading branch information
skanaar committed Apr 9, 2017
1 parent 9e3af0b commit ced79cd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Html usage with a Canvas rendering target:

An experimental (and not fully featured) SVG rendering mode is available as the `nomnoml.renderSvg` function.

## Command Line Interface

`dist/nomnoml-cli.js` exposes the SVG renderer with a command line interface. This mode also supports the `#import: <filename>` directive which allow you to separate complex diagrams into multiple files.

## Web application

The [nomnoml](http://www.nomnoml.com) web application is a simple editor with a live preview. It is purely client side and changes are saved to the browser's _localStorage_, so your diagram should be here the next time, (but no guarantees).
Expand Down Expand Up @@ -127,6 +131,10 @@ This is how the Decorator pattern looks like in nomnoml syntax:
#title: filename
#zoom: 1

Directives only available when using the command line interface

#import: my-common-styles.nomnoml

### Custom classifier styles

A directive that starts with "." define a classifier style.
Expand Down
14 changes: 8 additions & 6 deletions dist/nomnoml-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ var args = process.argv

if (args[2] == '--help' || args.length == 2){
console.log(`
Load source file and send rendered svg to stdout
Nomnoml command line utility for generating SVG diagrams.
nomnoml <source_file>
Load source file and send rendered svg to stdout:
Load source file and save rendered svg to <output_file>
> node nomnoml-cli.js <source_file>
Load source file and save rendered svg to <output_file>:
nomnoml <source_file> <output_file>
> node nomnoml-cli.js <source_file> <output_file>
Third parameter overrides the import depth limit
that protects us from recursive imports
that protects us from recursive imports:
nomnoml <source_file> <output_file> <max_import_chain_length>`)
> node nomnoml-cli.js <source_file> <output_file> <max_import_chain_length>`)
return
}

Expand Down
1 change: 1 addition & 0 deletions sample-style.nomnoml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#.box: fill=pink italic bold visual=rhomb
2 changes: 1 addition & 1 deletion sample.nomnoml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#direction: right
#.box: fill=pink italic bold visual=rhomb
#import: sample-style.nomnoml

[<frame>frame|[some class]]
[<package>package|[some class]]
Expand Down

0 comments on commit ced79cd

Please sign in to comment.