summaryrefslogtreecommitdiff
path: root/examples/markdown.cpp
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-10-29 19:50:18 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-10-29 19:50:18 +0300
commit3b13f7ac20875df55e02d5e407c4c3cbab3f159c (patch)
treee4c1010278ada9b64b9f785b37aa7a9b3859110e /examples/markdown.cpp
parent1de3a9aae84ec71c4fd83604ea9c45204efb9baf (diff)
downloadtexo-3b13f7ac20875df55e02d5e407c4c3cbab3f159c.tar
texo-3b13f7ac20875df55e02d5e407c4c3cbab3f159c.tar.xz
texo-3b13f7ac20875df55e02d5e407c4c3cbab3f159c.zip
.
Diffstat (limited to 'examples/markdown.cpp')
-rw-r--r--examples/markdown.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/markdown.cpp b/examples/markdown.cpp
new file mode 100644
index 0000000..2fbe37f
--- /dev/null
+++ b/examples/markdown.cpp
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <html.hpp>
+#include <plain.hpp>
+#include <lines.hpp>
+#include <markdown.hpp>
+#include <file.hpp>
+
+
+void plain()
+{
+ fputs(" ---- Markdown to Plain ----\n\n", stdout);
+ TexoExporterFile exporter(stdout);
+ TexoProducerPlain producer(exporter);
+ TexoImporterMarkdown importer(producer);
+ FILE *file = fopen("markdown.md", "r");
+ importer.Put(file);
+ fclose(file);
+}
+
+void html()
+{
+ fputs("\n\n ---- Markdown to HTML ----\n\n", stdout);
+ TexoExporterFile exporter(stdout);
+ TexoProducerHTML producer(exporter);
+ TexoImporterMarkdown importer(producer);
+ FILE *file = fopen("markdown.md", "r");
+ importer.Put(file);
+ fclose(file);
+}
+
+void markdown()
+{
+ fputs("\n\n ---- Markdown to Markdown ----\n\n", stdout);
+ TexoExporterFile exporter(stdout);
+ TexoProducerMarkdown producer(exporter);
+ TexoImporterMarkdown importer(producer);
+ FILE *file = fopen("markdown.md", "r");
+ importer.Put(file);
+ fclose(file);
+}
+
+void lines()
+{
+ fputs("\n\n ---- Markdown to Lines ----\n\n", stdout);
+ TexoExporterFile exporter(stdout);
+ TexoProducerLines producer(exporter);
+ TexoImporterMarkdown importer(producer);
+ FILE *file = fopen("markdown.md", "r");
+ importer.Put(file);
+ fclose(file);
+}
+
+int main()
+{
+ plain();
+ html();
+ markdown();
+ lines();
+
+ return 0;
+}