diff options
| author | Aleksey Veresov <aleksey@veresov.pro> | 2019-10-16 19:34:47 +0300 | 
|---|---|---|
| committer | Aleksey Veresov <aleksey@veresov.pro> | 2019-10-16 19:34:47 +0300 | 
| commit | 7b09f265c1deb12c9e6778c4d92473d66fc5406b (patch) | |
| tree | d8103c5ed176899524913697aa0356d93a107d38 /examples | |
| parent | 77f503bd6db90bd882e389ea977f02a2773e14f2 (diff) | |
| download | texo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.tar texo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.tar.xz texo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.zip | |
[texo] Starting rewriting...
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/Makefile | 29 | ||||
| -rw-r--r-- | examples/plain_to_html.cpp | 21 | 
2 files changed, 50 insertions, 0 deletions
| diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..be725ae --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,29 @@ +# Uncomment following to enable debug mode: +# DEBUG    = yes + +CC        = g++ +EXAMPLES  = plain_to_html + +CPPFLAGS  = -Wall -ansi +ifeq '$(DEBUG)' 'yes' +CPPFLAGS += -g -O0 +else +CPPFLAGS += -O3 +endif + +INCLUDE   = -I../src +LFLAGS    = -L.. -ltexo + +TEXO      = ../libtexo.a + + +default: $(EXAMPLES) + +$(TEXO): +	cd ..; $(MAKE) + +%: %.cpp $(TEXO) +	$(CC) $(CPPFLAGS) $(INCLUDE) $< $(LFLAGS) -o $@ + +clean: +	rm -f $(EXAMPLES) diff --git a/examples/plain_to_html.cpp b/examples/plain_to_html.cpp new file mode 100644 index 0000000..9a81652 --- /dev/null +++ b/examples/plain_to_html.cpp @@ -0,0 +1,21 @@ +#include <stdio.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; +} | 
