Skip to content

Commit 170b579

Browse files
committed
feat(ux): add one extra level of outline headings
This makes the sidebar table of contents more useful imo (for us and, soon, in user-defined profiles).
1 parent 38dc552 commit 170b579

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

_format/1.1/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ other and with `type` and `id`. In other words, a resource can not have an
234234
attribute and relationship with the same name, nor can it have an attribute
235235
or relationship named `type` or `id`.
236236

237-
#### <a href="#document-resource-object-attributes" id="document-resource-object-attributes" class="headerlink"></a> Attributes
237+
##### <a href="#document-resource-object-attributes" id="document-resource-object-attributes" class="headerlink"></a> Attributes
238238

239239
The value of the `attributes` key **MUST** be an object (an "attributes
240240
object"). Members of the attributes object ("attributes") represent information
@@ -253,7 +253,7 @@ alongside other information to be represented in a resource object, these keys
253253

254254
> Note: See [fields] and [member names] for more restrictions on this container.
255255
256-
#### <a href="#document-resource-object-relationships" id="document-resource-object-relationships" class="headerlink"></a> Relationships
256+
##### <a href="#document-resource-object-relationships" id="document-resource-object-relationships" class="headerlink"></a> Relationships
257257

258258
The value of the `relationships` key **MUST** be an object (a "relationships
259259
object"). Members of the relationships object ("relationships") represent
@@ -285,7 +285,7 @@ data, not the related resources.
285285

286286
> Note: See [fields] and [member names] for more restrictions on this container.
287287
288-
#### <a href="#document-resource-object-related-resource-links" id="document-resource-object-related-resource-links" class="headerlink"></a> Related Resource Links
288+
##### <a href="#document-resource-object-related-resource-links" id="document-resource-object-related-resource-links" class="headerlink"></a> Related Resource Links
289289

290290
A "related resource link" provides access to [resource objects][resource objects] [linked][links]
291291
in a [relationship][relationships]. When fetched, the related resource object(s)
@@ -300,7 +300,7 @@ relationship isn't currently associated with any target resources. Additionally,
300300
a related resource link **MUST NOT** change because its relationship's content
301301
changes.
302302

303-
#### <a href="#document-resource-object-linkage" id="document-resource-object-linkage" class="headerlink"></a> Resource Linkage
303+
##### <a href="#document-resource-object-linkage" id="document-resource-object-linkage" class="headerlink"></a> Resource Linkage
304304

305305
Resource linkage in a [compound document] allows a client to link together all
306306
of the included [resource objects] without having to `GET` any URLs via [links].

javascripts/all.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ $(document).ready(function() {
1212

1313
// Sidebar scroll affix
1414
fixElement($(".sidebar"), $("footer"), 52);
15-
1615
activateVersionPicker();
1716
});
1817

@@ -89,6 +88,14 @@ function createOutlineFromElement(element) {
8988
children: []
9089
};
9190

91+
$(this).nextUntil('h3', 'h4').each(function() {
92+
childItem.children.push({
93+
title: $(this).not('a').text(),
94+
href: $(this).find('a').attr('href') || "#",
95+
children: []
96+
});
97+
});
98+
9299
item.children.push(childItem);
93100
});
94101

@@ -98,10 +105,6 @@ function createOutlineFromElement(element) {
98105
return outline;
99106
}
100107

101-
/**
102-
* Creates a nested list from an array in the form returned by `createOutlineFromElement`.
103-
*/
104-
105108
/**
106109
* Creates a nested list from an array in the form returned by `createOutlineFromElement`.
107110
*

stylesheets/all.css

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stylesheets/all.sass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/** Config */
77

88
$page-width: 955px
9-
$sidebar-width: 220px
9+
$sidebar-width: 235px
1010
$page-padding: 20px
1111

1212
$mobile-breakpoint: 800px
@@ -307,7 +307,7 @@ footer
307307
overflow-y: auto
308308

309309
#version-picker-wrapper
310-
width: $sidebar-width
310+
width: 200px
311311
margin-bottom: 20px
312312
display: flex
313313
flex-direction: row
@@ -347,7 +347,7 @@ footer
347347
// just jump to its final size at the next media query.
348348
@media screen and (min-width: $page-width + ($page-padding * 2) - 109px)
349349
.sidebar + .content
350-
margin-left: $sidebar-width + 15px
350+
margin-left: $sidebar-width + 10px
351351
padding-left: calc(100vw - #{$page-width + ($page-padding * 2) - 109px})
352352

353353
@media screen and (min-width: $page-width + ($page-padding * 2) - 94px)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy