Table of Contents


This module documents the builtin texinfo language and parser.


Hop.js extends the genuine texinfo syntax by supporting embedded Hop.js expressions. As JavaScript template strings, expression starting with the prefix ${ are evaluated and the result of this evaluation is added as is in the parsed HTML tree.


texinfo.loadDocument( file )

Parse a texinfo file and return an return it as an HTML document.

Parse a texinfo file. On success, returns an object with the following

texinfo.load( file )

Parse a texinfo file. On success, returns an object with the following properties:

The evaluation environment of the embedded expressions contains the following global variables:

texinfo.eval( string )

Parse a texinfo string. On success the result is an object with the following properties:


<texinfo.TEXINFO src charset fontifier>

A wrapper to the texinfo.eval function that let's texinfo documents be directly inserted into HTML containers.


This example shows how to embed markdown elements into HTML.

The example uses a service that returns an HTML document whose sole element is a markdown text. Before being delivered to the client, the markdown text is parsed and automatically compiled into HTML.


var md = require( hop.markdown );

service mdtag( o ) {
   var name = o && "name" in o ? : "bar";
   return <html>
toto n'est pas content

  * toto
  * tutu ${name}
  * titi
tutu non plus.

console.log( "Go to \"http://%s:%d/hop/mtag\"", hop.hostname, hop.port );