This is a simple preprocessor using curly brackets.
Last updated 4 years ago by klorenz .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install curly-pp 
SYNC missed versions from official npm registry.


This is a simple preprocessor initially intended to preprocess markdown files.

Include files


This will include file


This will also include


This will include node_modules/package/

Indentation of the current line will be inserted before all lines of the include. Let content:

Some very

Then including it with:

some text

Will result in

some text
    Some very

Including it in a paragraph:

    embed {{file}} into this line

Results in

    embed Some very
    lines into this line


Set variable foo to bar

{{foo: bar}}

You can expand foo using {{:foo}}


  {{greet: Hello $1}}

Can be expanded using {{:greet world}}.

This way you can create macros:

{{ref: <a name="$1"></a>}}

And expand it {{:ref my-mark}}.

And then you can reference it [foo][my-mark].


You often need cross referencing in a document. Create a reference to bar in index (named bar):

{{@index: Some Term}}

You can dereference it with {{This is some text some-term@index}}

You can set an explicit name:

{{term@index: Some Term}}

This way you can create glossaries:

  ## Glossary

  {{term@glossary: My Term}}
     Description of My Term

  ... and later or before you can reference it:

  {{My Term <term@glossary>}}

If you do not have multiple index lists, you can use the empty one for ease:


  An you can {{reference it <ref@>}}

You can leave out the : and the < > in the forms, which are for explicit syntactic clarity. It is enough, to have the @-expression as first word or last word. If you have colon in your


A directive is something, which has some input, and is replaced by its output. General form is:


input will be dedented by indentation of first line.

A directive can be any command, assume you have graphviz installed:

  {{{ dot -Tsvg
  digraph G {
    A -> B

Note that all node_modules/.bin in directory subtrees starting from current working directory are included into path. So with npmjs install node-plantuml you can do

  {{{ puml generate | inline-img image/png
  Sally -> Harry : hello

inline-img is shipped with this preprocessor and creates an image from input data:

  <img src="data:image/png;base64,hEReIsTHEbaSE64enCoDedDAta">

You can also define Multiline macros:

  And here is text expanding $1
  and $2

You can also expand using the multiline version:

  {{{:macro first second third
  and fourth parameter
  which is the only
  multiline one.

Named parameters:

  {{{:macro name1=foo name2=bar name3=
  foo bar
  ${name1} and so on ${name2} and finally ${name3}
      {{{ puml generate | inline-img image/png
  A -> B hello


And for more readability you can define other filters. They will be applied before this filter after processing filter directives. Filter directives are applied when they are read for the rest of the file. The filtered code will be then also preprocessed.

{{| command to filter }}

Inline filter:

{{{| bash


{{{| perl -n

Example. For more ease of use of plantuml, you can inject the curly code of


around all code starting with @startuml and ending with @enduml.

{{{| perl -n m{^(\s*)@plantuml\s*$} && print "$1{{{plantuml:\n$"; m{^(\s*)@plantuml\s*$} && print "$$1}}}\n"; }}}

Commandline options

--inline-errors Display errors inline



If you want curlypp not to expand a curly-expression you can proceed it with "".


Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © |