void HtmlDocVisitor::visit(DocFormula *f) { if (m_hide) return; bool bDisplay = !f->isInline(); if (bDisplay) { forceEndParagraph(f); m_t << "<p class=\"formulaDsp\">" << endl; } if (Config_getBool("USE_MATHJAX")) { QCString text = f->text(); bool closeInline = FALSE; if (!bDisplay && !text.isEmpty() && text.at(0)=='$' && text.at(text.length()-1)=='$') { closeInline=TRUE; text = text.mid(1,text.length()-2); m_t << "\\("; } m_t << convertToHtml(text); if (closeInline) { m_t << "\\)"; } } else { m_t << "<img class=\"formula" << (bDisplay ? "Dsp" : "Inl"); m_t << "\" alt=\""; filterQuotedCdataAttr(f->text()); m_t << "\""; /// @todo cache image dimensions on formula generation and give height/width /// for faster preloading and better rendering of the page m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>"; } if (bDisplay) { m_t << endl << "</p>" << endl; forceStartParagraph(f); } }
void HtmlDocVisitor::visitPost(DocSimpleSect *s) { if (m_hide) return; m_t << "</dd></dl>\n"; forceStartParagraph(s); }
void HtmlDocVisitor::visit(DocInclude *inc) { if (m_hide) return; switch(inc->type()) { case DocInclude::Include: forceEndParagraph(inc); m_t << PREFRAG_START; Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, inc->context(), inc->text(), inc->isExample(), inc->exampleFile(), 0, // fd -1, // startLine -1, // endLine TRUE // inlineFragment ); m_t << PREFRAG_END; forceStartParagraph(inc); break; case DocInclude::IncWithLines: { forceEndParagraph(inc); m_t << PREFRAG_START; QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, inc->context(), inc->text(), inc->isExample(), inc->exampleFile(), &fd); m_t << PREFRAG_END; forceStartParagraph(inc); } break; case DocInclude::DontInclude: break; case DocInclude::HtmlInclude: m_t << inc->text(); break; case DocInclude::VerbInclude: forceEndParagraph(inc); m_t << PREFRAG_START; filter(inc->text()); m_t << PREFRAG_END; forceStartParagraph(inc); break; case DocInclude::Snippet: { forceEndParagraph(inc); m_t << PREFRAG_START; Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, inc->context(), extractBlock(inc->text(),inc->blockId()), inc->isExample(), inc->exampleFile(), 0, -1, // startLine -1, // endLine TRUE // inlineFragment ); m_t << PREFRAG_END; forceStartParagraph(inc); } break; } }
void HtmlDocVisitor::visit(DocVerbatim *s) { if (m_hide) return; switch(s->type()) { case DocVerbatim::Code: forceEndParagraph(s); m_t << PREFRAG_START; Doxygen::parserManager->getParser(m_langExt) ->parseCode(m_ci,s->context(),s->text(), s->isExample(),s->exampleFile()); m_t << PREFRAG_END; forceStartParagraph(s); break; case DocVerbatim::Verbatim: forceEndParagraph(s); m_t << PREFRAG_START; filter(s->text()); m_t << PREFRAG_END; forceStartParagraph(s); break; case DocVerbatim::HtmlOnly: m_t << s->text(); break; case DocVerbatim::ManOnly: case DocVerbatim::LatexOnly: case DocVerbatim::XmlOnly: /* nothing */ break; case DocVerbatim::Dot: { static int dotindex = 1; QCString fileName(4096); fileName.sprintf("%s%d%s", (Config_getString("HTML_OUTPUT")+"/inline_dotgraph_").data(), dotindex++, ".dot" ); QFile file(fileName); if (!file.open(IO_WriteOnly)) { err("Could not open file %s for writing\n",fileName.data()); } file.writeBlock( s->text(), s->text().length() ); file.close(); forceEndParagraph(s); m_t << "<div align=\"center\">" << endl; writeDotFile(fileName,s->relPath(),s->context()); m_t << "</div>" << endl; forceStartParagraph(s); if (Config_getBool("DOT_CLEANUP")) file.remove(); } break; case DocVerbatim::Msc: { static int mscindex = 1; QCString baseName(4096); baseName.sprintf("%s%d", (Config_getString("HTML_OUTPUT")+"/inline_mscgraph_").data(), mscindex++ ); QFile file(baseName+".msc"); if (!file.open(IO_WriteOnly)) { err("Could not open file %s.msc for writing\n",baseName.data()); } QCString text = "msc {"; text+=s->text(); text+="}"; file.writeBlock( text, text.length() ); file.close(); forceEndParagraph(s); m_t << "<div align=\"center\">" << endl; writeMscFile(baseName+".msc",s->relPath(),s->context()); m_t << "</div>" << endl; forceStartParagraph(s); if (Config_getBool("DOT_CLEANUP")) file.remove(); } break; } }
void HtmlDocVisitor::visit(DocStyleChange *s) { if (m_hide) return; switch (s->style()) { case DocStyleChange::Bold: if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</b>"; break; case DocStyleChange::Italic: if (s->enable()) m_t << "<em" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</em>"; break; case DocStyleChange::Code: if (s->enable()) m_t << "<code" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</code>"; break; case DocStyleChange::Subscript: if (s->enable()) m_t << "<sub" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sub>"; break; case DocStyleChange::Superscript: if (s->enable()) m_t << "<sup" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sup>"; break; case DocStyleChange::Center: if (s->enable()) { forceEndParagraph(s); m_t << "<center" << htmlAttribsToString(s->attribs()) << ">"; } else { m_t << "</center>"; forceStartParagraph(s); } break; case DocStyleChange::Small: if (s->enable()) m_t << "<small" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</small>"; break; case DocStyleChange::Preformatted: if (s->enable()) { forceEndParagraph(s); m_t << "<pre" << htmlAttribsToString(s->attribs()) << ">"; m_insidePre=TRUE; } else { m_insidePre=FALSE; m_t << "</pre>"; forceStartParagraph(s); } break; case DocStyleChange::Div: if (s->enable()) { forceEndParagraph(s); m_t << "<div" << htmlAttribsToString(s->attribs()) << ">"; } else { m_t << "</div>"; forceStartParagraph(s); } break; case DocStyleChange::Span: if (s->enable()) m_t << "<span" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</span>"; break; } }
void HtmlDocVisitor::visitPost(DocXRefItem *x) { if (m_hide) return; m_t << "</dd></dl>" << endl; forceStartParagraph(x); }
void HtmlDocVisitor::visitPost(DocHtmlHeader *header) { if (m_hide) return; m_t << "</h" << header->level() << ">\n"; forceStartParagraph(header); }
void HtmlDocVisitor::visitPost(DocHtmlTable *t) { if (m_hide) return; m_t << "</table>\n"; forceStartParagraph(t); }
void HtmlDocVisitor::visitPost(DocHtmlDescList *dl) { if (m_hide) return; m_t << "</dl>\n"; forceStartParagraph(dl); }
void HtmlDocVisitor::visitPost(DocSection *s) { forceStartParagraph(s); }
void HtmlDocVisitor::visitPost(DocHtmlBlockQuote *b) { if (m_hide) return; m_t << "</blockquote>" << endl; forceStartParagraph(b); }