Skip to content

Commit

Permalink
Adding sub links to doxygen_crawl file.
Browse files Browse the repository at this point in the history
Adding [possibility to do some more link checking as there is also a problem with the links from addIndexItem:
```
file:///.../html/namespaceito33_1_1finance.html
 Lines: 13, 39, 42
  Code: 200 (no message)
 To do: Some of the links to this resource point to broken URI fragments
        (such as index.html#fragment).
The following fragments need to be fixed:
        a522cd9d32a68eabce080861331e10259a8ba18c9e30fe35e3f041b6ee1453d413      Line: 42
```
  • Loading branch information
albert-github committed Mar 30, 2024
1 parent 36adbf5 commit ef6b7b6
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions src/sitemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,59 @@ void Crawlmap::addContentsItem(bool, const QCString &, const QCString &,
p->crawlLinks.insert(link);
}
}

static QCString makeFileName(const QCString & withoutExtension)
{
QCString result=withoutExtension;
if (!result.isEmpty())
{
if (result.at(0)=='!') // relative URL -> strip marker
{
result=result.mid(1);
}
else // add specified HTML extension
{
addHtmlExtensionIfMissing(result);
}
}
return result;
}

static QCString makeRef(const QCString & withoutExtension, const QCString & anchor)
{
if (withoutExtension.isEmpty()) return QCString();
QCString result = makeFileName(withoutExtension);
if (anchor.isEmpty()) return result;
return result+"#"+anchor;
}
void Crawlmap::addIndexItem(const Definition *context, const MemberDef *md,
const QCString &sectionAnchor, const QCString &title)
{
if (md) // member
{
bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES);
if (context==nullptr) // global member
{
if (md->getGroupDef())
context = md->getGroupDef();
else if (md->getFileDef())
context = md->getFileDef();
}
if (context==nullptr) return; // should not happen
QCString cfname = md->getOutputFileBase();
//QCString argStr = md->argsString();
QCString cfiname = context->getOutputFileBase();
QCString contRef = separateMemberPages ? cfname : cfiname;
QCString anchor = !sectionAnchor.isEmpty() ? sectionAnchor : md->anchor();
QCString ref;

ref = makeRef(contRef, anchor);
p->crawlLinks.insert(ref.str());
}
else if (context) // container
{
QCString contRef = context->getOutputFileBase();
QCString ref = makeRef(contRef,sectionAnchor);
p->crawlLinks.insert(ref.str());
}
}
2 changes: 1 addition & 1 deletion src/sitemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Crawlmap
bool separateIndex,bool addToNavIndex,
const Definition *def);
void addIndexItem(const Definition *context, const MemberDef *md,
const QCString &sectionAnchor, const QCString &title){}
const QCString &sectionAnchor, const QCString &title);
void addIndexFile(const QCString & name);
void addImageFile(const QCString & name){}
void addStyleSheetFile(const QCString & name){}
Expand Down

0 comments on commit ef6b7b6

Please sign in to comment.