diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-06-15 17:25:46 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-06-16 19:30:41 (GMT) |
commit | e922facbb92cda058eae33f58f7640be8d1fb5b8 (patch) | |
tree | ae45b9db9d6ed339b28ba22199e75bcf16993318 /src/pagedef.cpp | |
parent | 3040df2f0aa29a4207de5b37da1d20e3d27340bb (diff) | |
download | Doxygen-e922facbb92cda058eae33f58f7640be8d1fb5b8.zip Doxygen-e922facbb92cda058eae33f58f7640be8d1fb5b8.tar.gz Doxygen-e922facbb92cda058eae33f58f7640be8d1fb5b8.tar.bz2 |
Refactor: modernize markdown and make it thread-safe
Diffstat (limited to 'src/pagedef.cpp')
-rw-r--r-- | src/pagedef.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 011b647..823e87d 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -3,8 +3,8 @@ * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -102,18 +102,18 @@ void PageDefImpl::findSectionsInDocumentation() docFindSections(documentation(),this,docFile()); } -GroupDef *PageDefImpl::getGroupDef() const -{ +GroupDef *PageDefImpl::getGroupDef() const +{ GroupList *groups = partOfGroups(); - return groups!=0 ? groups->getFirst() : 0; + return groups!=0 ? groups->getFirst() : 0; } -QCString PageDefImpl::getOutputFileBase() const -{ - if (getGroupDef()) +QCString PageDefImpl::getOutputFileBase() const +{ + if (getGroupDef()) return getGroupDef()->getOutputFileBase(); - else - return m_fileName; + else + return m_fileName; } void PageDefImpl::setFileName(const char *name) @@ -142,7 +142,7 @@ void PageDefImpl::addInnerCompound(const Definition *const_def) bool PageDefImpl::hasParentPage() const { - return getOuterScope() && + return getOuterScope() && getOuterScope()->definitionType()==Definition::TypePage; } @@ -180,9 +180,9 @@ void PageDefImpl::writeDocumentation(OutputList &ol) //printf("PageDefImpl::writeDocumentation: %s\n",getOutputFileBase().data()); ol.pushGeneratorState(); - //1.{ + //1.{ - if (m_nestingLevel>0 + if (m_nestingLevel>0 //&& // a sub page //(Doxygen::mainPage==0 || getOuterScope()!=Doxygen::mainPage) // and not a subpage of the mainpage ) @@ -195,14 +195,14 @@ void PageDefImpl::writeDocumentation(OutputList &ol) } ol.pushGeneratorState(); - //2.{ + //2.{ ol.disableAllBut(OutputGenerator::Man); startFile(ol,getOutputFileBase(),manPageName,title(),HLI_Pages,!generateTreeView); ol.enableAll(); ol.disable(OutputGenerator::Man); startFile(ol,getOutputFileBase(),pageName,title(),HLI_Pages,!generateTreeView); ol.popGeneratorState(); - //2.} + //2.} if (!generateTreeView) { @@ -229,7 +229,8 @@ void PageDefImpl::writeDocumentation(OutputList &ol) if (si->title() != manPageName) { - ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE,0,TRUE,FALSE); + ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE, + 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); ol.endSection(si->label(),si->type()); } } @@ -248,7 +249,8 @@ void PageDefImpl::writeDocumentation(OutputList &ol) ol.startPageDoc(si->title()); //ol.startSection(si->label,si->title,si->type); startTitle(ol,getOutputFileBase(),this); - ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE,0,TRUE,FALSE); + ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE, + 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); //stringToSearchIndex(getOutputFileBase(), // theTranslator->trPage(TRUE,TRUE)+" "+si->title, // si->title); @@ -288,11 +290,11 @@ void PageDefImpl::writeDocumentation(OutputList &ol) void PageDefImpl::writePageDocumentation(OutputList &ol) { - bool markdownEnabled = Doxygen::markdownSupport; - if (getLanguage()==SrcLangExt_Markdown) - { - Doxygen::markdownSupport = TRUE; - } + //bool markdownEnabled = Doxygen::markdownSupport; + //if (getLanguage()==SrcLangExt_Markdown) + //{ + // Doxygen::markdownSupport = TRUE; + //} ol.startTextBlock(); QCString docStr = documentation()+inbodyDocumentation(); @@ -310,11 +312,15 @@ void PageDefImpl::writePageDocumentation(OutputList &ol) 0, // memberdef docStr, // docStr TRUE, // index words - FALSE // not an example + FALSE, // not an example + 0, // exampleName + FALSE, // singleLine + FALSE, // linkFromIndex + TRUE // markdown support ); ol.endTextBlock(); - Doxygen::markdownSupport = markdownEnabled; + //Doxygen::markdownSupport = markdownEnabled; if (hasSubPages()) { @@ -357,16 +363,16 @@ bool PageDefImpl::visibleInIndex() const { static bool externalPages = Config_getBool(EXTERNAL_PAGES); return // not part of a group - !getGroupDef() && + !getGroupDef() && // not an externally defined page - (!isReference() || externalPages) + (!isReference() || externalPages) ; } bool PageDefImpl::documentedPage() const { return // not part of a group - !getGroupDef() && + !getGroupDef() && // not an externally defined page !isReference(); } |