Skip to content

Commit ef6b7b6

Browse files
committed
Adding sub links to doxygen_crawl file.
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 ```
1 parent 36adbf5 commit ef6b7b6

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

src/sitemap.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,59 @@ void Crawlmap::addContentsItem(bool, const QCString &, const QCString &,
164164
p->crawlLinks.insert(link);
165165
}
166166
}
167+
168+
static QCString makeFileName(const QCString & withoutExtension)
169+
{
170+
QCString result=withoutExtension;
171+
if (!result.isEmpty())
172+
{
173+
if (result.at(0)=='!') // relative URL -> strip marker
174+
{
175+
result=result.mid(1);
176+
}
177+
else // add specified HTML extension
178+
{
179+
addHtmlExtensionIfMissing(result);
180+
}
181+
}
182+
return result;
183+
}
184+
185+
static QCString makeRef(const QCString & withoutExtension, const QCString & anchor)
186+
{
187+
if (withoutExtension.isEmpty()) return QCString();
188+
QCString result = makeFileName(withoutExtension);
189+
if (anchor.isEmpty()) return result;
190+
return result+"#"+anchor;
191+
}
192+
void Crawlmap::addIndexItem(const Definition *context, const MemberDef *md,
193+
const QCString &sectionAnchor, const QCString &title)
194+
{
195+
if (md) // member
196+
{
197+
bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES);
198+
if (context==nullptr) // global member
199+
{
200+
if (md->getGroupDef())
201+
context = md->getGroupDef();
202+
else if (md->getFileDef())
203+
context = md->getFileDef();
204+
}
205+
if (context==nullptr) return; // should not happen
206+
QCString cfname = md->getOutputFileBase();
207+
//QCString argStr = md->argsString();
208+
QCString cfiname = context->getOutputFileBase();
209+
QCString contRef = separateMemberPages ? cfname : cfiname;
210+
QCString anchor = !sectionAnchor.isEmpty() ? sectionAnchor : md->anchor();
211+
QCString ref;
212+
213+
ref = makeRef(contRef, anchor);
214+
p->crawlLinks.insert(ref.str());
215+
}
216+
else if (context) // container
217+
{
218+
QCString contRef = context->getOutputFileBase();
219+
QCString ref = makeRef(contRef,sectionAnchor);
220+
p->crawlLinks.insert(ref.str());
221+
}
222+
}

src/sitemap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Crawlmap
6565
bool separateIndex,bool addToNavIndex,
6666
const Definition *def);
6767
void addIndexItem(const Definition *context, const MemberDef *md,
68-
const QCString &sectionAnchor, const QCString &title){}
68+
const QCString &sectionAnchor, const QCString &title);
6969
void addIndexFile(const QCString & name);
7070
void addImageFile(const QCString & name){}
7171
void addStyleSheetFile(const QCString & name){}

0 commit comments

Comments
 (0)