Skip to content

Commit d554290

Browse files
committed
revise anchor
1 parent 09d3437 commit d554290

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

docs/make.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using QuanEstimation
22
using Documenter
33
using DocumenterMarkdown
4+
import Documenter.Writers.MarkdownWriter: render, renderdoc
45

56
DocMeta.setdocmeta!(
67
QuanEstimation,
@@ -9,6 +10,24 @@ DocMeta.setdocmeta!(
910
recursive = true,
1011
)
1112

13+
# function render(io::IO, mime::MIME"text/plain", anchor::Documenter.Anchors.Anchor, page, doc)
14+
# println(io, "\n", lstrip(Documenter.Anchors.fragment(anchor), '#', " "))
15+
# if anchor.nth == 1 # add legacy id
16+
# legacy = lstrip(Documenter.Anchors.fragment(anchor), '#', " ") * "-1"
17+
# println(io, "\n", legacy)
18+
# end
19+
# render(io, mime, anchor.object, page, doc)
20+
# end
21+
22+
function render(io::IO, mime::MIME"text/plain", node::Documenter.Documents.DocsNode, page, doc)
23+
# Docstring header based on the name of the binding and it's category.
24+
anchor = "## "
25+
header = "**`$(node.object.binding)`** — *$(Documenter.Utilities.doccat(node.object))*."
26+
println(io, anchor, " ", header, "\n\n")
27+
# Body. May contain several concatenated docstrings.
28+
renderdoc(io, mime, node.docstr, page, doc)
29+
end
30+
1231
makedocs(;
1332
format = Markdown(),
1433
root = ".",

docs/src/api.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
CurrentModule = QuanEstimation
33
```
44

5-
# QuanEstimation
6-
7-
```@index
8-
```
9-
105
```@autodocs
116
Modules = [QuanEstimation]
127
```

0 commit comments

Comments
 (0)