diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-08 16:17:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-08 16:17:55 (GMT) |
commit | e2bfb392959acd0d397daa4ca2ab08930add4719 (patch) | |
tree | a0e5babd2bdf94a9fb4f4dd7d081d341b8b6fe5d | |
parent | abd887af5cb3e70f801848adb87c70642e6fb1dc (diff) | |
parent | 137328681e7dcbd07a5ec0e4b068aea96ec41b4a (diff) | |
download | Doxygen-e2bfb392959acd0d397daa4ca2ab08930add4719.zip Doxygen-e2bfb392959acd0d397daa4ca2ab08930add4719.tar.gz Doxygen-e2bfb392959acd0d397daa4ca2ab08930add4719.tar.bz2 |
Merge branch 'master' into vhdl-fixed-bug-7432
-rw-r--r-- | src/commentcnv.l | 12 | ||||
-rw-r--r-- | src/docbookvisitor.cpp | 95 | ||||
-rw-r--r-- | src/docparser.cpp | 2 | ||||
-rw-r--r-- | src/util.cpp | 24 | ||||
-rw-r--r-- | src/vhdldocgen.cpp | 18 | ||||
-rw-r--r-- | src/xmldocvisitor.cpp | 40 | ||||
-rw-r--r-- | templates/html/doxygen.css | 41 | ||||
-rw-r--r-- | templates/xml/compound.xsd | 13 |
8 files changed, 112 insertions, 133 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index f3367a4..ba2e5ec 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -546,7 +546,7 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z } } <CComment>\n { /* new line in comment */ - copyToOutput(yyscanner,yytext,(int)yyleng); + copyToOutput(yyscanner,yytext,(int)yyleng); /* in case of Fortran always end of comment */ if (yyextra->lang==SrcLangExt_Fortran) { @@ -554,16 +554,20 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z } } <CComment>"/"+"*" { /* nested C comment */ - if ((yyextra->lang==SrcLangExt_Python) || (yyextra->lang==SrcLangExt_Tcl)) + if (yyextra->lang==SrcLangExt_Python || + yyextra->lang==SrcLangExt_Tcl || + yyextra->lang==SrcLangExt_Markdown) { REJECT; } yyextra->nestingCount++; yyextra->commentStack.push(new CommentCtx(yyextra->lineNr)); - copyToOutput(yyscanner,yytext,(int)yyleng); + copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment>"*"+"/" { /* end of C comment */ - if ((yyextra->lang==SrcLangExt_Python) || (yyextra->lang==SrcLangExt_Tcl)) + if (yyextra->lang==SrcLangExt_Python || + yyextra->lang==SrcLangExt_Tcl || + yyextra->lang==SrcLangExt_Markdown) { REJECT; } diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index e6d0014..16afd7b 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -69,6 +69,23 @@ static QCString filterId(const char *s) return growBuf.get(); } +static bool supportedHtmlAttribute(const QCString &name) +{ + return (name=="align" || + name=="bgcolor" || + name=="border" || + name=="cellpadding" || + name=="cellspacing" || + name=="class" || + name=="frame" || + name=="label" || + name=="style" || + name=="width" || + name=="tabstyle" || + name=="title"); +} + + void DocbookDocVisitor::visitCaption(const QList<DocNode> &children) { QListIterator<DocNode> cli(children); @@ -1034,25 +1051,10 @@ DB_VIS_C HtmlAttrib *opt; for (li.toFirst();(opt=li.current());++li) { - if (opt->name=="class") - { - // just skip it - } - else if (opt->name=="style") - { - // just skip it - } - else if (opt->name=="height") - { - // just skip it - } - else if (opt->name=="filter") - { - // just skip it - } - else + if (supportedHtmlAttribute(opt->name)) { - m_t << " " << opt->name << "='" << opt->value << "'"; + // process supported attributes only + m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'"; } } m_t << ">\n"; @@ -1095,50 +1097,31 @@ DB_VIS_C } else if (opt->name=="class") { - if (opt->value == "markdownTableBodyRight") - { - m_t << " align='right'"; - } - else if (opt->value == "markdownTableBodyLeftt") - { - m_t << " align='left'"; - } - else if (opt->value == "markdownTableBodyCenter") - { - m_t << " align='center'"; - } - else if (opt->value == "markdownTableHeadRight") + if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes { - m_t << " align='right'"; - } - else if (opt->value == "markdownTableHeadLeftt") - { - m_t << " align='left'"; + if (opt->value.right(5)=="Right") + { + m_t << " align='right'"; + } + else if (opt->value.right(4)=="Left") + { + m_t << " align='left'"; + } + else if (opt->value.right(6)=="Center") + { + m_t << " align='center'"; + } + // skip 'markdownTable*' value ending with "None" } - else if (opt->value == "markdownTableHeadCenter") + else { - m_t << " align='center'"; + m_t << " class='" << convertToDocBook(opt->value) << "'"; } } - else if (opt->name=="style") - { - // just skip it - } - else if (opt->name=="width") - { - // just skip it - } - else if (opt->name=="height") - { - // just skip it - } - else if (opt->name=="nowrap" && opt->value.isEmpty()) - { - m_t << " " << opt->name << "='nowrap'"; - } - else + else if (supportedHtmlAttribute(opt->name)) { - m_t << " " << opt->name << "='" << opt->value << "'"; + // process supported attributes only + m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'"; } } m_t << ">"; diff --git a/src/docparser.cpp b/src/docparser.cpp index 2d27ff9..889a014 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -5402,7 +5402,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok) { case CMD_UNKNOWN: m_children.append(new DocWord(this,TK_COMMAND_CHAR(tok) + cmdName)); - warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command '\\%s'",qPrint(cmdName)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command '%c%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName)); break; case CMD_EMPHASIS: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,TRUE)); diff --git a/src/util.cpp b/src/util.cpp index 260ee01..9309b63 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6340,7 +6340,7 @@ QCString substituteTemplateArgumentsInString( // name.data(),argListToString(formalArgs).data(),argListToString(actualArgs).data()); if (formalArgs.empty()) return name; QCString result; - static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*"); + static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9:\\x80-\\xFF]*"); int p=0,l,i; // for each identifier in the base class name (e.g. B<T> -> B and T) while ((i=re.match(name,p,&l))!=-1) @@ -6378,8 +6378,8 @@ QCString substituteTemplateArgumentsInString( { //printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s'\n", // n.data(),formArg->type.data(),formArg->name.data(),formArg->defval.data()); - //printf(">> formArg->name='%s' actArg->type='%s' actArg->name='%s'\n", - // formArg->name.data(),actArg ? actArg->type.data() : "",actArg ? actArg->name.data() : "" + //printf(">> n='%s' formArg->name='%s' actArg->type='%s' actArg->name='%s'\n", + // n.data(),formArg.name.data(),actIt!=actualArgs.end() ? actIt->type.data() : "",actIt!=actualArgs.end() ? actIt->name.data() : "" // ); if (formArg.name==n && actIt!=actualArgs.end() && !actArg.type.isEmpty()) // base class is a template argument { @@ -6441,24 +6441,6 @@ QCString substituteTemplateArgumentsInString( return result.stripWhiteSpace(); } -#if 0 -/*! Makes a deep copy of the list of argument lists \a srcLists. - * Will allocate memory, that is owned by the caller. - */ -QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists) -{ - ASSERT(srcLists!=0); - QList<ArgumentList> *dstLists = new QList<ArgumentList>; - dstLists->setAutoDelete(TRUE); - QListIterator<ArgumentList> sli(*srcLists); - ArgumentList *sl; - for (;(sl=sli.current());++sli) - { - dstLists->append(sl->deepCopy()); - } - return dstLists; -} -#endif /*! Strips template specifiers from scope \a fullName, except those * that make up specialized classes. The switch \a parentOnly diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index e12052d..c54bf78 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -200,7 +200,7 @@ void VhdlDocGen::writeOverview() if (!f.open(IO_WriteOnly)) { - fprintf(stderr,"Warning: Cannot open file %s for writing\n",fileName.data()); + err("Warning: Cannot open file %s for writing\n",fileName.data()); return; } @@ -2906,14 +2906,14 @@ ferr: md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine); FileDef *fd=ar->getFileDef(); md->setBodyDef(fd); - QCString info="Info: Elaborating entity "+n1; - fd=ar->getFileDef(); - info+=" for hierarchy "; - QRegExp epr("[|]"); - QCString label=cur->type+":"+cur->write+":"+cur->name; - label.replace(epr,":"); - info+=label; - fprintf(stderr,"\n[%s:%d:%s]\n",fd->fileName().data(),cur->startLine,info.data()); + //QCString info="Info: Elaborating entity "+n1; + //fd=ar->getFileDef(); + //info+=" for hierarchy "; + //QRegExp epr("[|]"); + //QCString label=cur->type+":"+cur->write+":"+cur->name; + //label.replace(epr,":"); + //info+=label; + //fprintf(stderr,"\n[%s:%d:%s]\n",fd->fileName().data(),cur->startLine,info.data()); ar->insertMember(md); } diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 0aafd47..21fa77e 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -806,7 +806,45 @@ void XmlDocVisitor::visitPost(DocHtmlRow *) void XmlDocVisitor::visitPre(DocHtmlCell *c) { if (m_hide) return; - if (c->isHeading()) m_t << "<entry thead=\"yes\">"; else m_t << "<entry thead=\"no\">"; + if (c->isHeading()) m_t << "<entry thead=\"yes\""; else m_t << "<entry thead=\"no\""; + HtmlAttribListIterator li(c->attribs()); + HtmlAttrib *opt; + for (li.toFirst();(opt=li.current());++li) + { + if (opt->name=="colspan" || opt->name=="rowspan") + { + m_t << " " << opt->name << "=\"" << opt->value.toInt() << "\""; + } + else if (opt->name=="align" && + (opt->value=="right" || opt->value=="left" || opt->value=="center")) + { + m_t << " align=\"" << opt->value << "\""; + } + else if (opt->name=="class") // handle markdown generated attributes + { + if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes + { + if (opt->value.right(5)=="Right") + { + m_t << " align='right'"; + } + else if (opt->value.right(4)=="Left") + { + m_t << " align='left'"; + } + else if (opt->value.right(6)=="Center") + { + m_t << " align='center'"; + } + // skip 'markdownTable*' value ending with "None" + } + else if (!opt->value.isEmpty()) + { + m_t << " class=\"" << convertToXML(opt->value) << "\""; + } + } + } + m_t << ">"; } void XmlDocVisitor::visitPost(DocHtmlCell *) diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css index 2c9dfd5..8f2c213 100644 --- a/templates/html/doxygen.css +++ b/templates/html/doxygen.css @@ -1661,47 +1661,6 @@ tr.heading h2 { /* @group Markdown */ -/* -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid ##37; - padding: 3px 7px 2px; -} - -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid ##37; - padding: 3px 7px 2px; -} - -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: ##47; - color: ##ff; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft { - text-align: left -} - -th.markdownTableHeadRight { - text-align: right -} - -th.markdownTableHeadCenter { - text-align: center -} -*/ - table.markdownTable { border-collapse:collapse; margin-top: 4px; diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index 67d7843..c7d872a 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -570,6 +570,11 @@ <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> <xsd:attribute name="thead" type="DoxBool" /> + <xsd:attribute name="colspan" type="xsd:integer" /> + <xsd:attribute name="rowspan" type="xsd:integer" /> + <xsd:attribute name="align" type="DoxAlign" /> + <xsd:attribute name="class" type="xsd:string" /> + <xsd:anyAttribute processContents="skip"/> </xsd:complexType> <xsd:complexType name="docCaptionType" mixed="true"> @@ -936,5 +941,13 @@ </xsd:restriction> </xsd:simpleType> + <xsd:simpleType name="DoxAlign"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="left"/> + <xsd:enumeration value="right"/> + <xsd:enumeration value="center"/> + </xsd:restriction> + </xsd:simpleType> + </xsd:schema> |