3 <style|<tuple|article|fangle>>
7 <assign|par-first|0fn><assign|par-par-sep|0.5fn>
10 <doc-data|<doc-title|Literate Example>|<doc-author-data|<author-name|Sam
11 Liddicott>|<\author-address>
17 This is a simple example of how to use literate programming templates,
20 Hello-world is a famous <em|first program> with a visible side effect.
22 This example produces hello-world in multiple languages.
26 <\table-of-contents|toc>
31 The typical hello world program looks like this:
33 <\nf-chunk|hello-world>
34 <item>/* The traditional hello-world program in <nf-arg|language>\
36 <item> * generated using fangle literate programming macros
42 <item>#include stdio.c
48 <item> \ printf("<nf-arg|message>\\n");
51 </nf-chunk||<tuple|message|language>>
53 <subsection|In French>
57 We will derive the french hello-world program like this:
59 <\nf-chunk|./hello-world.fr.c>
60 <item><nf-ref|hello-world|<tuple|Bonjour tout le monde|french>>
63 <subsection|In German>
65 We will derive the german hello-world program like this:
67 <\nf-chunk|./hello-world.de.c>
68 <item><nf-ref|hello-world|<tuple|Hallo welt|german>>