Skip to content

Commit

Permalink
[readme] added syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
dscape committed Sep 11, 2011
1 parent 05542d9 commit 6664ac3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -27,16 +27,21 @@ used in any XQuery processor


A quick example how to use mustache.xq: A quick example how to use mustache.xq:


``` xquery
import module namespace mustache = "mustache.xq" import module namespace mustache = "mustache.xq"
at "mustache.xqy"; at "mustache.xqy";
mustache:render( 'Hello {{text}}!', '{ "text": "world"}' ) mustache:render( 'Hello {{text}}!', '{ "text": "world"}' )
```


Returns Returns


``` xquery
<div>Hello world!</div> <div>Hello world!</div>
```


A slightly more complicated example A slightly more complicated example


``` xquery
mustache:render( mustache:render(
'<h1>{{header}}</h1> {{#bug}} {{/bug}} '<h1>{{header}}</h1> {{#bug}} {{/bug}}
{{#items}} {{#items}}
Expand All @@ -57,9 +62,11 @@ A slightly more complicated example
{"name": "blue", "link": true, "url": "#Blue"} {"name": "blue", "link": true, "url": "#Blue"}
], ],
"empty": false }') "empty": false }')
```


Outputs: Outputs:


``` xml
<div> <div>
<h1>Colors</h1> <h1>Colors</h1>
<li> <li>
Expand All @@ -72,6 +79,7 @@ Outputs:
<a href="#Blue">blue</a> <a href="#Blue">blue</a>
</li> </li>
</div> </div>
```


For more (fun) examples refer to test/tests.xml. If you are new to mustache you can use it to learn more about it. For more (fun) examples refer to test/tests.xml. If you are new to mustache you can use it to learn more about it.


Expand Down Expand Up @@ -114,11 +122,13 @@ This will help us be faster fixing the problem.


An example for a Hello World test would be: An example for a Hello World test would be:


``` xml
<test name="Hello World"> <test name="Hello World">
<template>{'Hello {{word}}!'}</template> <template>{'Hello {{word}}!'}</template>
<hash>{'{"word": "world"}'}</hash> <hash>{'{"word": "world"}'}</hash>
<output><div>Hello world !</div></output> <output><div>Hello world !</div></output>
</test> </test>
```


This is not the actual test that we run (you can see a list of those in test/index.xqy) but it's all the information we need for a bug report. This is not the actual test that we run (you can see a list of those in test/index.xqy) but it's all the information we need for a bug report.


Expand Down

0 comments on commit 6664ac3

Please sign in to comment.