diff --git a/lib/docs/commonmark.js b/lib/docs/commonmark.js index c1b33d7571..8a3762ea80 100644 --- a/lib/docs/commonmark.js +++ b/lib/docs/commonmark.js @@ -7831,6 +7831,16 @@ } else { node._literal = contents; } + const doc = this.options.autoDoc; + if (doc) { + const decl_hash = doc.detectDeclPath(contents); + if (decl_hash) { + var l = new Node("link"); + l.destination = decl_hash; + l.appendChild(node); + node = l; + } + } block.appendChild(node); return true; } @@ -9702,6 +9712,7 @@ this.buffer = ""; this.lastOut = "\n"; + this.heading_count = 0; while ((event = walker.next())) { type = event.node.type; @@ -9883,6 +9894,10 @@ var tagname = "h" + node.level, attrs = this.attrs(node); if (entering) { + if (node.level != 1) { + attrs.push(["id", ":" + this.heading_count]); + this.heading_count += 1; + } this.cr(); this.tag(tagname, attrs); } else { diff --git a/lib/docs/index.html b/lib/docs/index.html index 6930eeb068..808b235825 100644 --- a/lib/docs/index.html +++ b/lib/docs/index.html @@ -40,15 +40,20 @@ text-decoration: underline; } + a[href^="src/"] { + border-bottom: 2px dotted var(--tx-color); + } + .hidden { - display: none; + display: none !important; } /* layout */ .canvas { + display:flex; + flex-direction: column; width: 100vw; height: 100vh; - overflow: hidden; margin: 0; padding: 0; font-family: var(--ui); @@ -58,13 +63,23 @@ .flex-main { display: flex; - width: 100%; - height: 100%; + flex-direction: column; justify-content: center; + margin: 0 1rem; + + height: 100%; + overflow: hidden; + z-index: 100; } + .flex-horizontal { + display: flex; + flex-direction: row; + align-items: center; + } + .flex-filler { flex-grow: 1; flex-shrink: 1; @@ -104,23 +119,27 @@ z-index: 400; } - /* sidebar */ + .understated { + color: var(--search-other-results-color); + } + .sidebar { - font-size: 1rem; background-color: var(--bg-color); box-shadow: 0 0 1rem var(--sidebar-sh-color); + clip-path: inset(0px -15px 0px 0px); } - .sidebar .logo { - padding: 1rem 0.35rem 0.35rem 0.35rem; + .logo { + width: 168px; + margin-right: 1rem; } - .sidebar .logo > svg { + .logo > svg { display: block; overflow: visible; } - .sidebar ul.guides-api-switch { + ul.guides-api-switch { display: flex; flex-direction: row; justify-content: center; @@ -130,7 +149,7 @@ padding: 0; } - .sidebar .guides-api-switch a { + .guides-api-switch a { display: block; padding: 0.5rem 1rem; color: var(--sidebar-modlnk-tx-color); @@ -157,11 +176,24 @@ background-color: var(--sidebar-modlnk-bg-color-hover); } - .sidebar .guides-api-switch .active { + .guides-api-switch .active { color: var(--sidebar-modlnk-tx-color-active); background-color: var(--sidebar-modlnk-bg-color-active); } + #guidesMenu { + height: 100%; + overflow: hidden; + width: 30%; + margin-right: 2rem; + } + + #activeGuide { + overflow-y: scroll; + height: 100%; + width: 70%; + padding-right: 1rem; + } .sidebar h2 { margin: 0.5rem; padding: 0; @@ -202,8 +234,16 @@ font-family: var(--mono); } + #guideTocList { + padding: 0 1rem; + } + + #guideTocList ul { + padding-left: 1rem; + margin: 0; + } + #guides { - padding: 0rem 0.7rem 2.4rem 1.4rem; box-sizing: border-box; font-size: 1rem; background-color: var(--bg-color); @@ -212,15 +252,35 @@ /* docs section */ .docs { + flex-grow: 2; padding: 0rem 0.7rem 2.4rem 1.4rem; font-size: 1rem; background-color: var(--bg-color); overflow-wrap: break-word; + height: 100%; + overflow-y: scroll; } - .docs .search { + #noDocsNamespaces { + margin: 1rem; + border: 1px solid var(--search-other-results-color); + padding: 0.5rem 1rem; + background-color: var(--help-bg-color); + } + + .column { + flex-basis: 0; + flex-grow: 1; + min-width: 24rem; + } + + + .search-container { + flex-grow: 2; + } + + .search { width: 100%; - margin-bottom: 0.8rem; padding: 0.5rem; font-family: var(--ui); font-size: 1rem; @@ -238,7 +298,7 @@ -webkit-appearance: none; } - .docs .search:focus { + .search:focus { background-color: var(--search-bg-color-focus); border-bottom-color: #ffbb4d; box-shadow: 0 0.3em 1em 0.125em var(--search-sh-color); @@ -286,7 +346,6 @@ #sectSearchResults { box-sizing: border-box; - max-width: 960px; } #searchHelp summary { @@ -335,15 +394,15 @@ } - .docs a { + a { color: var(--link-color); } - .docs p { + p { margin: 0.8rem 0; } - .docs pre { + pre { font-family: var(--mono); font-size: 1em; background-color: #F5F5F5; @@ -351,53 +410,55 @@ overflow-x: auto; } - .docs pre.inline { + pre.inline { background-color: var(--bg-color); padding: 0; display: inline; } - .docs code { + code { font-family: var(--mono); font-size: 1em; } - .docs h1 { + h1 { font-size: 1.4em; margin: 0.8em 0; padding: 0; border-bottom: 0.0625rem dashed; } - .docs h2 { + h2 { font-size: 1.3em; margin: 0.5em 0; padding: 0; border-bottom: 0.0625rem solid; } - #listNav { + .listNav { list-style-type: none; margin: 0; padding: 0; overflow: hidden; - background-color: #f1f1f1; + boackground-color: #f1f1f1; + display: flex; + flex-direction: row; } - #listNav li { - float:left; + .listNav li { + } - #listNav li a { + .listNav li a { display: block; color: #000; text-align: center; padding: .5em .8em; text-decoration: none; } - #listNav li a:hover { + .listNav li a:hover { background-color: #555; color: #fff; } - #listNav li a.active { + .listNav li a.active { background-color: #FFBB4D; color: #000; } @@ -595,7 +656,7 @@ --tx-color: #bbb; --bg-color: #111; --link-color: #88f; - --sidebar-sh-color: rgba(128, 128, 128, 0.09); + --sidebar-sh-color: rgba(128, 128, 128, 0.5); --sidebar-mod-bg-color: #333; --sidebar-modlnk-tx-color: #fff; --sidebar-modlnk-tx-color-hover: #fff; @@ -612,23 +673,23 @@ --warning-popover-bg-color: #600000; } - .docs pre { + pre { background-color:#2A2A2A; } .fieldDocs { border-color:#2A2A2A; } - #listNav { + .listNav { background-color: #333; } - #listNav li a { + .listNav li a { color: #fff; } - #listNav li a:hover { + .listNav li a:hover { background-color: #555; color: #fff; } - #listNav li a.active { + .listNav li a.active { background-color: #FFBB4D; color: #000; } @@ -872,9 +933,8 @@ Learn more about stdlib source code.
-
- -
-
-
-
+
+
Use spaces instead of dots. See $resource for more info.
-
+
    + +
    +
    +
    -