#include "html.hpp" TexoProducerHTML::TexoProducerHTML(TexoExporter & exporter): TexoProducerStrict(exporter) {} bool TexoProducerHTML::TruePut(char c) { switch (c) { case '<': return exporter.Put("<"); break; case '>': return exporter.Put(">"); break; case '&': return exporter.Put("&"); break; default: return exporter.Put(c); } } bool TexoProducerHTML::StartCode() { return exporter.Put("\n
\n");
}
bool TexoProducerHTML::StartHeader(int level)
{
if (level <= 1) {
return exporter.Put("\n\n");
} else if (level == 2) {
return exporter.Put("\n\n");
} else if (level == 3) {
return exporter.Put("\n\n");
} else if (level == 4) {
return exporter.Put("\n\n");
} else if (level == 5) {
return exporter.Put("\n\n");
} else {
return exporter.Put("\n\n");
}
}
bool TexoProducerHTML::StartParagraph()
{
return exporter.Put("\n
\n");
}
bool TexoProducerHTML::StartQuote()
{
return exporter.Put("\n
\n");
}
bool TexoProducerHTML::CloseCode()
{
return exporter.Put("\n
\n");
}
bool TexoProducerHTML::CloseHeader(int level)
{
if (level <= 1) {
return exporter.Put("\n\n");
} else if (level == 2) {
return exporter.Put("\n\n");
} else if (level == 3) {
return exporter.Put("\n\n");
} else if (level == 4) {
return exporter.Put("\n\n");
} else if (level == 5) {
return exporter.Put("\n\n");
} else {
return exporter.Put("\n\n");
}
}
bool TexoProducerHTML::CloseParagraph()
{
return exporter.Put("\n\n");
}
bool TexoProducerHTML::CloseQuote()
{
return exporter.Put("\n\n");
}
bool TexoProducerHTML::StartBold()
{
return exporter.Put("");
}
bool TexoProducerHTML::StartItalic()
{
return exporter.Put("");
}
bool TexoProducerHTML::StartMono()
{
return exporter.Put("");
}
bool TexoProducerHTML::StartStrike()
{
return exporter.Put("");
}
bool TexoProducerHTML::StartUnderline()
{
return exporter.Put("");
}
bool TexoProducerHTML::CloseBold()
{
return exporter.Put("");
}
bool TexoProducerHTML::CloseItalic()
{
return exporter.Put("");
}
bool TexoProducerHTML::CloseMono()
{
return exporter.Put("");
}
bool TexoProducerHTML::CloseStrike()
{
return exporter.Put("");
}
bool TexoProducerHTML::CloseUnderline()
{
return exporter.Put("");
}
bool TexoProducerHTML::StartLink(
const ScriptVariable & link, const ScriptVariable & title)
{
bool ok = true;
if (link != "") {
ok = ok && exporter.Put("");
}
return ok;
}
bool TexoProducerHTML::CloseLink(
const ScriptVariable & link, const ScriptVariable & title)
{
if (link != "") {
return exporter.Put("");
} else {
return true;
}
}
bool TexoProducerHTML::TruePutImage(const ScriptVariable & src,
const ScriptVariable & alt, const ScriptVariable & title)
{
bool ok = true;
if (src != "") {
ok = ok && exporter.Put("