add container doc comments to generated docs
parent
e509d21f39
commit
977b613881
|
@ -484,7 +484,7 @@
|
|||
doc comments.
|
||||
</p>
|
||||
</div>
|
||||
<div id="fnDocs" class="hidden"></div>
|
||||
<div id="tldDocs" class="hidden"></div>
|
||||
<div id="sectFnErrors" class="hidden">
|
||||
<h2>Errors</h2>
|
||||
<div id="fnErrorsAnyError">
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
var domListValues = document.getElementById("listValues");
|
||||
var domFnProto = document.getElementById("fnProto");
|
||||
var domFnProtoCode = document.getElementById("fnProtoCode");
|
||||
var domFnDocs = document.getElementById("fnDocs");
|
||||
var domTldDocs = document.getElementById("tldDocs");
|
||||
var domSectFnErrors = document.getElementById("sectFnErrors");
|
||||
var domListFnErrors = document.getElementById("listFnErrors");
|
||||
var domTableFnErrors = document.getElementById("tableFnErrors");
|
||||
|
@ -34,7 +34,6 @@
|
|||
var domListSearchResults = document.getElementById("listSearchResults");
|
||||
var domSectSearchNoResults = document.getElementById("sectSearchNoResults");
|
||||
var domSectInfo = document.getElementById("sectInfo");
|
||||
var domListInfo = document.getElementById("listInfo");
|
||||
var domTdTarget = document.getElementById("tdTarget");
|
||||
var domTdZigVer = document.getElementById("tdZigVer");
|
||||
var domHdrName = document.getElementById("hdrName");
|
||||
|
@ -102,7 +101,7 @@
|
|||
function render() {
|
||||
domStatus.classList.add("hidden");
|
||||
domFnProto.classList.add("hidden");
|
||||
domFnDocs.classList.add("hidden");
|
||||
domTldDocs.classList.add("hidden");
|
||||
domSectPkgs.classList.add("hidden");
|
||||
domSectTypes.classList.add("hidden");
|
||||
domSectNamespaces.classList.add("hidden");
|
||||
|
@ -190,11 +189,11 @@
|
|||
|
||||
var docs = zigAnalysis.astNodes[decl.src].docs;
|
||||
if (docs != null) {
|
||||
domFnDocs.innerHTML = markdown(docs);
|
||||
domTldDocs.innerHTML = markdown(docs);
|
||||
} else {
|
||||
domFnDocs.innerHTML = '<p>There are no doc comments for this declaration.</p>';
|
||||
domTldDocs.innerHTML = '<p>There are no doc comments for this declaration.</p>';
|
||||
}
|
||||
domFnDocs.classList.remove("hidden");
|
||||
domTldDocs.classList.remove("hidden");
|
||||
}
|
||||
|
||||
function typeIsErrSet(typeIndex) {
|
||||
|
@ -274,8 +273,8 @@
|
|||
docsSource = protoSrcNode.docs;
|
||||
}
|
||||
if (docsSource != null) {
|
||||
domFnDocs.innerHTML = markdown(docsSource);
|
||||
domFnDocs.classList.remove("hidden");
|
||||
domTldDocs.innerHTML = markdown(docsSource);
|
||||
domTldDocs.classList.remove("hidden");
|
||||
}
|
||||
domFnProto.classList.remove("hidden");
|
||||
}
|
||||
|
@ -893,8 +892,8 @@
|
|||
|
||||
var docs = zigAnalysis.astNodes[decl.src].docs;
|
||||
if (docs != null) {
|
||||
domFnDocs.innerHTML = markdown(docs);
|
||||
domFnDocs.classList.remove("hidden");
|
||||
domTldDocs.innerHTML = markdown(docs);
|
||||
domTldDocs.classList.remove("hidden");
|
||||
}
|
||||
|
||||
domFnProto.classList.remove("hidden");
|
||||
|
@ -906,8 +905,8 @@
|
|||
|
||||
var docs = zigAnalysis.astNodes[decl.src].docs;
|
||||
if (docs != null) {
|
||||
domFnDocs.innerHTML = markdown(docs);
|
||||
domFnDocs.classList.remove("hidden");
|
||||
domTldDocs.innerHTML = markdown(docs);
|
||||
domTldDocs.classList.remove("hidden");
|
||||
}
|
||||
|
||||
domFnProto.classList.remove("hidden");
|
||||
|
@ -957,6 +956,14 @@
|
|||
varsList.sort(byNameProperty);
|
||||
valsList.sort(byNameProperty);
|
||||
|
||||
if (container.src != null) {
|
||||
var docs = zigAnalysis.astNodes[container.src].docs;
|
||||
if (docs != null) {
|
||||
domTldDocs.innerHTML = markdown(docs);
|
||||
domTldDocs.classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
if (typesList.length !== 0) {
|
||||
resizeDomList(domListTypes, typesList.length, '<li><a href="#"></a></li>');
|
||||
for (var i = 0; i < typesList.length; i += 1) {
|
||||
|
|
|
@ -2253,7 +2253,6 @@ pub const Node = struct {
|
|||
test "iterate" {
|
||||
var root = Node.Root{
|
||||
.base = Node{ .id = Node.Id.Root },
|
||||
.doc_comments = null,
|
||||
.decls = Node.Root.DeclList.init(std.debug.global_allocator),
|
||||
.eof_token = 0,
|
||||
};
|
||||
|
|
|
@ -1088,6 +1088,7 @@ static void anal_dump_node(AnalDumpCtx *ctx, const AstNode *node) {
|
|||
break;
|
||||
case NodeTypeContainerDecl:
|
||||
field_nodes = &node->data.container_decl.fields;
|
||||
doc_comments_buf = &node->data.container_decl.doc_comments;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -493,7 +493,9 @@ static AstNode *ast_parse_root(ParseContext *pc) {
|
|||
node->data.container_decl.layout = ContainerLayoutAuto;
|
||||
node->data.container_decl.kind = ContainerKindStruct;
|
||||
node->data.container_decl.is_root = true;
|
||||
node->data.container_decl.doc_comments = members.doc_comments;
|
||||
if (buf_len(&members.doc_comments) != 0) {
|
||||
node->data.container_decl.doc_comments = members.doc_comments;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
@ -2817,7 +2819,9 @@ static AstNode *ast_parse_container_decl_auto(ParseContext *pc) {
|
|||
|
||||
res->data.container_decl.fields = members.fields;
|
||||
res->data.container_decl.decls = members.decls;
|
||||
res->data.container_decl.doc_comments = members.doc_comments;
|
||||
if (buf_len(&members.doc_comments) != 0) {
|
||||
res->data.container_decl.doc_comments = members.doc_comments;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue