diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-09 01:14:09 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-09 01:14:09 +0100 |
commit | e44fb038ec4404f2c38b698ec95c80d051b8d0cf (patch) | |
tree | 95ae8fe8728ddd9fb8456973a095f4b44ceaee70 /src/plugins/html/DemoOutput.hpp | |
parent | 0605eed698443dc18c48340084507c90e97a9333 (diff) | |
parent | 4ec16559eba87553241e2e20a9e31a62b7aed08a (diff) |
Merge branch 'master' of somweyr.de:ousia
Conflicts:
application/src/core/model/Document.cpp
application/src/core/model/Domain.cpp
Diffstat (limited to 'src/plugins/html/DemoOutput.hpp')
-rw-r--r-- | src/plugins/html/DemoOutput.hpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/plugins/html/DemoOutput.hpp b/src/plugins/html/DemoOutput.hpp index 70a5daa..e08ec2b 100644 --- a/src/plugins/html/DemoOutput.hpp +++ b/src/plugins/html/DemoOutput.hpp @@ -30,6 +30,7 @@ #ifndef _OUSIA_HTML_DEMO_OUTPUT_HPP_ #define _OUSIA_HTML_DEMO_OUTPUT_HPP_ +#include <map> #include <ostream> #include <core/model/Document.hpp> @@ -38,22 +39,31 @@ namespace ousia { namespace html { +typedef std::map<std::string, Rooted<model::AnnotationEntity>> AnnoMap; + class DemoHTMLTransformer { private: /** - * These methods are called recursively to transform a document to an XML - * tree. + * This transforms a section-like entity, namely book, section + * and subsection, to an XHTML element, including its header. For the + * children of the default field the respective transform function is + * called recursively. */ - Rooted<xml::Element> transformSection(Handle<model::StructuredEntity> sec); - Rooted<xml::Element> transformParagraph(Handle<model::StructuredEntity> par); + Rooted<xml::Element> transformSection(Handle<model::StructuredEntity> sec, + AnnoMap& startMap, AnnoMap& endMap); /** - * This method is to be called recursively to write a list to HTML. - * TODO: Implement + * This transforms a list entity, namely ul and ol to an XHTML element. + * For each item, the transformParagraph function is called. */ -// void writeList(Handle<StructuredEntity> sec, std::ostream& out, -// int tabdepth); - - //TODO: Implement emphasis. + Rooted<xml::Element> transformList(Handle<model::StructuredEntity> list, + AnnoMap& startMap, AnnoMap& endMap); + /** + * This transforms a paragraph-like entity, namely heading, item and + * paragraph, to an XHTML element including the text and the anchors + * contained. For anchor handling we require the AnnoMaps. + */ + Rooted<xml::Element> transformParagraph(Handle<model::StructuredEntity> par, + AnnoMap& startMap, AnnoMap& endMap); public: /** @@ -74,7 +84,7 @@ public: * and lists domains but no other. * @param out is the output stream the data shall be written to. */ - void writeHTML(Handle<model::Document> doc, std::ostream& out); + void writeHTML(Handle<model::Document> doc, std::ostream &out); }; } } |