summaryrefslogtreecommitdiff
path: root/examples/plain.cpp
blob: d91fcde7a5b5c166db08063ee0188cdd5d5db858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdio.h>
#include <html.hpp>
#include <plain.hpp>
#include <lines.hpp>
#include <markdown.hpp>
#include <file.hpp>


void plain()
{
    fputs("  ----  Plain to Plain  ----\n\n", stdout);
    TexoExporterFile exporter(stdout);
    TexoProducerPlain producer(exporter);
    TexoImporterPlain importer(producer);
    FILE *file = fopen("plain.txt", "r");
    importer.Put(file);
    fclose(file);
}

void html()
{
    fputs("\n\n  ----  Plain to HTML  ----\n\n", stdout);
    TexoExporterFile exporter(stdout);
    TexoProducerHTML producer(exporter);
    TexoImporterPlain importer(producer);
    FILE *file = fopen("plain.txt", "r");
    importer.Put(file);
    fclose(file);
}

void markdown()
{
    fputs("\n\n  ----  Plain to Markdown  ----\n\n", stdout);
    TexoExporterFile exporter(stdout);
    TexoProducerMarkdown producer(exporter);
    TexoImporterPlain importer(producer);
    FILE *file = fopen("plain.txt", "r");
    importer.Put(file);
    fclose(file);
}

void lines()
{
    fputs("\n\n  ----  Plain to Lines  ----\n\n", stdout);
    TexoExporterFile exporter(stdout);
    TexoProducerLines producer(exporter);
    TexoImporterPlain importer(producer);
    FILE *file = fopen("plain.txt", "r");
    importer.Put(file);
    fclose(file);
}

int main()
{
    plain();
    html();
    markdown();
    lines();

    return 0;
}