summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/makefile24
-rw-r--r--example/plain_to_html.cpp23
2 files changed, 47 insertions, 0 deletions
diff --git a/example/makefile b/example/makefile
new file mode 100644
index 0000000..5255f5b
--- /dev/null
+++ b/example/makefile
@@ -0,0 +1,24 @@
+# Uncomment following to enable debug mode:
+# DEBUG = yes
+
+CC = g++
+EXAMPLES = plain_to_html
+
+CFLAGS = -Wall
+ifeq '$(DEBUG)' 'yes'
+CFLAGS += -g -O0
+else
+CFLAGS += -O3
+endif
+
+INCLUDE = -I ../src
+LFLAGS = -L.. -ltexo
+
+
+default: $(EXAMPLES)
+
+%: %.cpp
+ $(CC) $(CFLAGS) $(INCLUDE) $< $(LFLAGS) -o $@
+
+clean:
+ rm -f $(EXAMPLES)
diff --git a/example/plain_to_html.cpp b/example/plain_to_html.cpp
new file mode 100644
index 0000000..86171a6
--- /dev/null
+++ b/example/plain_to_html.cpp
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <html.hpp>
+#include <plain.hpp>
+#include <file.hpp>
+
+
+int main()
+{
+ TexoFileExporter exporter(stdout);
+ TexoHTMLProducer producer(exporter);
+ TexoPlainImporter importer(producer);
+ importer.PutStr(
+ "I am a little cute line. \n"
+ "I am another and that's fine. \n"
+ "But I am as long as a pine,\n"
+ "so lets drink a glass of wine.\n\n"
+ "Second paragraph was started here. \n"
+ "Take your bananas and go home, seer.\n"
+ );
+ return 0;
+}