From 3b13f7ac20875df55e02d5e407c4c3cbab3f159c Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 29 Oct 2019 19:50:18 +0300 Subject: . --- examples/markdown.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ examples/markdown.md | 28 +++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 examples/markdown.cpp create mode 100644 examples/markdown.md (limited to 'examples') 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 +#include +#include +#include +#include +#include + + +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; +} diff --git a/examples/markdown.md b/examples/markdown.md new file mode 100644 index 0000000..d1413fd --- /dev/null +++ b/examples/markdown.md @@ -0,0 +1,28 @@ +# Huge header +###### Tiny header + +Some text: +blah-blah-blah... + +New paragraph. *Italic*. **Bold**. _alternative_ __style__. +++Underlined++. ~~Striked~~. `Mono`. + +---- + +This was horizontal rule. + +> This is +> *quote*. + +``` +bool Block::is_code() +{ + return this->should_be(); +} +``` + +![Awesome alt](../awseome.jpg "Awesome Title") + +[Awesome link](example.com "Awesome title of link") + +[![Magic alt](../magic.png "Ignored")](example.com "Magic title of linked pic") -- cgit v1.2.3