diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-10 09:51:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-10 09:51:48 -0700 |
| commit | 80c18515df8376efe97e4c93492e0f6c4cc44af7 (patch) | |
| tree | 3dc746d1d9c61b9071cc644e07d814da614ab00a /source | |
| parent | a7c5df67110c6e3471850a72b5b3268acc984a2b (diff) | |
Fix links in stdlib reference category landing page. (#5250)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-doc-markdown-writer.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/slang/slang-doc-markdown-writer.cpp b/source/slang/slang-doc-markdown-writer.cpp index 86cdb6d29..2d38703c7 100644 --- a/source/slang/slang-doc-markdown-writer.cpp +++ b/source/slang/slang-doc-markdown-writer.cpp @@ -1738,7 +1738,7 @@ void DocMarkdownWriter::writeAggType(DocumentPage* page, const ASTMarkup::Entry& for (AssocTypeDecl* assocTypeDecl : assocTypeDecls) { - out << "* _" << assocTypeDecl->getName()->text << "_ "; + out << "#### _" << escapeMarkdownText(assocTypeDecl->getName()->text) << "\n\n"; // Look up markup ASTMarkup::Entry* assocTypeDeclEntry = m_markup->getEntry(assocTypeDecl); @@ -1746,19 +1746,23 @@ void DocMarkdownWriter::writeAggType(DocumentPage* page, const ASTMarkup::Entry& { _appendAsSingleLine(assocTypeDeclEntry->m_markup.getUnownedSlice(), out); } - out << toSlice("\n"); List<TypeConstraintDecl*> inheritanceDecls; _getDecls<TypeConstraintDecl>(assocTypeDecl, inheritanceDecls); if (inheritanceDecls.getCount()) { - out << " "; - _appendCommaList(_getAsStringList(inheritanceDecls), '`'); - out << toSlice("\n"); + out << toSlice("\n\nConstraints:\n\n"); + for (auto inheritanceDecl : inheritanceDecls) + { + out << " - "; + out << escapeMarkdownText(getSub(m_astBuilder, inheritanceDecl)->toString()); + out << " : "; + out << escapeMarkdownText(getSup(m_astBuilder, inheritanceDecl)->toString()); + out << toSlice("\n"); + } } } - out << toSlice("\n\n"); } } @@ -2637,7 +2641,7 @@ void writeTOCChildren(StringBuilder& sb, DocMarkdownWriter* writer, Documentatio for (auto child : categories[cat]) { landingPage->contentSB << "#### [" << writer->escapeMarkdownText(child->title) << "](" << - child->path << ")\n\n"; + getDocPath(config, child->path) << ")\n\n"; } page->children.add(landingPage); } |
