Zig: Language reference index in a separate column

Created on 23 Oct 2019  路  4Comments  路  Source: ziglang/zig

I think putting the index in a separate column would be an improvement.
If people like it I'll make a pull request after I refine it.
zig-langref

docs proposal

Most helpful comment

I also prefer the side nav; but as you note: only on desktop. On mobile the TOC should just be at the top.

I've done this with a pure-CSS solution in the lua-http docs
I think https://github.com/daurnimator/lua-http/blob/47225d081318e65d5d832e2dd99ff0880d56b5c6/doc/site.css#L134-L148 is the relevant stuff.

All 4 comments

It used to be this way (see older versions) and I think status quo is better.

  • Mobile. Navigation between content and table of contents works the same as desktop. Click TOC heading to content, click content heading to TOC.

  • The side bar is useless without JavaScript (which remains a requirement - no js), because it will not scroll correctly when scrolling content nor when clicking links.

I appreciate your efforts but this may be a dead end.

I also prefer the side nav; but as you note: only on desktop. On mobile the TOC should just be at the top.

I've done this with a pure-CSS solution in the lua-http docs
I think https://github.com/daurnimator/lua-http/blob/47225d081318e65d5d832e2dd99ff0880d56b5c6/doc/site.css#L134-L148 is the relevant stuff.

I've done this with a pure-CSS solution in the lua-http docs

it doesn't work, headers are not clickable, and TOC is not observed scrolling with content and showing active header.

I used pure CSS (display: flex, overflow: auto).
The TOC scrolls when clicking links.
The TOC does not scroll with content automatically but I still think it is an improvement. It can be added with JS later (without breaking it for users without JS).

Mobile can be handled with media queries, which is still pure CSS. This is one of the refinements I was talking about.

I still need to test different browsers, but it shouldn't be a problem, since even IE supports display: flex.

I'll finish and push my changes so you can look at them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

S0urc3C0de picture S0urc3C0de  路  3Comments

andrewrk picture andrewrk  路  3Comments

andersfr picture andersfr  路  3Comments

andrewrk picture andrewrk  路  3Comments

bronze1man picture bronze1man  路  3Comments