diff options
| author | Grégoire Duchêne <gduchene@fastmail.net> | 2011-09-08 11:09:39 +0200 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@fastmail.net> | 2011-09-08 16:32:49 +0200 |
| commit | ab24e62128d9cdb633f6457665451070053c7b6d (patch) | |
| tree | 64bbb7724c86cce33047e0f8073c4206eaa215ca /src/elements.h | |
| parent | 027031a505f9f0e5c8c5fafc94c4440667159e3c (diff) | |
Added heading support.
So far, the LaTeX generator will output unnumbered headings, but this
may change in the future.
Diffstat (limited to 'src/elements.h')
| -rw-r--r-- | src/elements.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/elements.h b/src/elements.h index 54bab97..de9ceb8 100644 --- a/src/elements.h +++ b/src/elements.h @@ -58,7 +58,23 @@ struct pstext_t { }; typedef std::vector<text_t> line_t; -typedef std::vector<line_t> paragraph_t; + +enum hattribute_t { + HEADING_1, + HEADING_2, + HEADING_3, + HEADING_4, + HEADING_5 +}; + +struct heading_t { + hattribute_t level; + line_t contents; +}; + +typedef boost::variant<heading_t, + std::vector<line_t> > paragraph_t; + typedef std::vector<paragraph_t> document_t; BOOST_FUSION_ADAPT_STRUCT (stext_t, @@ -71,4 +87,9 @@ BOOST_FUSION_ADAPT_STRUCT (pstext_t, (std::vector<text_t>, value) (std::wstring, parameter) ) + +BOOST_FUSION_ADAPT_STRUCT (heading_t, + (hattribute_t, level) + (line_t, contents) + ) #endif |
