Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
Most of the time I read the nLab (or any web content for that matter) these days is via my smartphone. I doubt I’m alone.
As such, and even when not on a smartphone, long TOCs can be distracting.
On many nLab pages, there is now a nice sidebar containing references to various “Contexts” that are only visible when you hover over them. I like this feature a lot.
Is there some clever way to include not only “Contexts” in the sidebar, but also the toc “Contents”?
I experimented a little in the Sandbox. I tried to put a {.toc} in the sidebar. It almost does what I wanted. It creates a toc in the sidebar and the toc even contains a link to one header, but not all the headers.
As a separate proof of concept, I manually transcribed the automatically generated toc from geometry of physics to geometryofphysicscontents and included it in the sidebar of geometry of physics to get an idea of what it would look like. The proof of concept does not yet contain anchored links, but those could be added if this turns out to be the best way to go.
Is it the best way to go? I would be surprised.
Off the top of my head, I can think of two much better approaches:
Figure out how to automatically generate and include a toc in the sidebar. There is some encouraging evidence this should be possible.
Figure out how to automatically generate on one page a toc based on headers from another page, e.g. have the toc for geometry of physics actually generated on geometryofphysicscontents. Then include this page in the sidebar for geometry of physics
Are either of these two options possible with current technology?
Hi,
I like the thought of experimenting with this, but let’s not experiment on a page-in-operation. I have rolled back the page “geometry of physics” to the status where it has a hyperlinked table of contents. (Being a long entry already, without a hyperlinked TOC nobody will find anything in this page. There is a smaller toc in the section “Scope and perspective”.)
Maybe we could do some CSS or something to make the TOC collapsible below a certain level, so it takes up less space.
Most of the time I read the nLab these days is via my smartphone.
Also, don’t take this the wrong way, but: why on earth?
I really do want to know: this is one of the great mysteries of modern life for me. Why do people voluntarily subject themselves to a miniscule screen and a crippled tiny virtual keyboard for their web browsing? I can understand that occasionally one is, say, out on an errand and urgently needs to know what the best brand of toilet paper to buy is, or what one’s friends are saying right now on facebook, but is the definition of a cohesive topos really something that is primarily needed in an on-the-go, unwired context?
Please forgive my snarky phrasing – I don’t have the energy to go back and make it more polite right now. (-:
On the other hand, I must also ask: what OS and browser are you using on your smartphone, and have you found a way to make it display the lab’s mathematics? In firefox on my Android tablet (whose screen and keyboard I find just barely large enough to be worthwhile), lots of characters on the nLab display as gray boxes.
Hi Mike,
If you take the schedule of an intense and driven scientist and throw a wife and 2 kids on top of it, you’ll start to get a picture of my schedule. Reading the nLab is a pure luxury for me. Luxury generally does not happen for me at work or at home. For me, nLab really is mostly an “on-the-go” experience.
I’m using Safari on an iPhone 4 and refusing to “upgrade” to iOS 6 :)
By the way, the CSS hiding does not work for me on my iPhone, but I don’t care because I’m not a fan of long TOCs or Contexts anyway.
In terms of figures, the last log file (covering a period of about 36hrs) has:
My tests were on crude matching of the user agent string reported by the browser. There’s probably a more refined test to be done. If someone wants to dig it out I’ll run it on the logs to get a clearer picture.
One answer to #4 might be: in a lot of work environments, internet activities are monitored, and in fact many sites are blocked. So if for some strange reason my wife wanted to read something on the nLab when she’s at work, she probably would have to do it on something like a smartphone. Between that and home (where home and family matters take priority at least until the kids are in bed, and at that point one is often tired), I can see why it could become tricky finding opportunities to use a proper screen.
In either case: if the table of contents of an entry is too large to be read on some device, then the entry itself is all the more too large. After all the TOC is like a zoomed-out version of the entry. So I don’t quite see why we should want to move tocs out of sight.
What I do think would be useful is to have TOCs of adjustabled depth:
for a long entry it is useful to
first have a TOC that lists only the subsections up to depth with or , usually,
then have some introductory text
then have the full toc.
That’s how textbooks work, too.
Currently at geometry of physics I am implementing this by hand. Therefore a feature that I can imagine being useful is if the “shallow TOC”could be produced automatically.
But I don’t want to see TOCs moved out of the way entirely.
Interesting proposal.
I just tried out some CSS trickery and discovered that I can hide the entries of the TOC according to depth. If I add:
.maruku_toc ul ul ul {
display: none;
}
to the CSS then everything from the third level down is hidden. Obvious modifications for other levels. Of course, if this were implemented it would be by putting a new class in place so that ordinary TOCs didn’t have this feature and you’d have to select it to enable it.
An advantage of this approach is that it is very easy to implement: it’s all in the CSS. A disadvantage is that the full table of contents is there no matter how much is hidden. I’m also wary of introducing yet more ways to “hide” something on a page (but then as we have one already maybe more isn’t problematic). It could have the same click-to-view feature of the sidebars, I suppose. That would negate the necessity of having it appear twice.
The more complicated solution, of only generating the TOC up to a certain level, would need changing the formatter (maruku) to stop after some specified level. After a quick look at the code I don’t think that that would be overly difficult, but I don’t know how it would go down as a general feature request.
Eric, Todd, thanks for your answers! I guess I tend to forget that this is not the “day job” of everyone around here…. (-:O
I think it would be preferable to have the longer TOC displayed by clicking-to-expand on a shorter one, rather than having a shorter TOC and then later on the page a longer TOC.
While we’re talking about mobile devices, let me mention that in my experience, one thing that tends to make web sites unusable on a touchscreen device, worse than almost anything else, is relying on mouseovers. Unless I’m missing something, there is no way to do a mouseover on a touchscreen without clicking, and so web sites that rely on your mouseovering a menu name before they display a drop-down submenu become basically un-navigable.
Unless I’m missing something, there is no way to do a mouseover on a touchscreen without clicking, and so web sites that rely on your mouseovering a menu name before they display a drop-down submenu become basically un-navigable.
As far as I know you aren’t missing anything. Just checking on my iPad … it would appear that even the “click to reveal” mechanism of the sidebars doesn’t work for touchscreen devices. Ooops. And that was such a neat solution, too.
One solution that could potentially make everyone happy, including smartphone/tablet users, would be to make the TOC expandable upon clicking a little “+” to the left of it. For example, it starts at n=0 where you just see “+ Contents”. If you click “+”, it expands to n=1. Each expandable level 1 entry also has a “+” next to it. Etc.
Is that possible?
PS: Putting this in the sidebar would be an added bonus :)
@Todd #8
Hi Todd,
That is also an important factor for me. The nLab is not blocked at work, but everything is monitored. Any personal browsing done during the day is on my iPhone. If my company were to ever get subpoenaed (it happens) all my records could be dragged into court.
Eric, yes. Sites that are outright blocked at my wife’s workplace include Facebook and Youtube. Almost certainly not nLab, but the situation is just as you describe, and that’s probably very common.
What is it about moving the TOC out of the way? I don’t understand. The TOC is the door to a long entry. The first thing I want to see is the anchors that allow me to jump right to the place inside an entry that I need. Why would you rather want to see the screen filled always with the first paragraphs of the introduction, with no indication of what is to follow?
If I go to a page geometry of physics, I expect to see some content about the geometry of physics. I’d be inclined to read it from beginning to end. Once I’ve read it and I know what content is there, if I ever need to find it again for reference, I don’t need a TOC to tell me where to look. Control-F (or even Google) works just fine. The TOC adds very little value to me.
I’d be inclined to read it from beginning to end
Most certainly you won’t. Have you actually tried?
Nobody should try to read math books first page to last page, in general. It just doesn’t work.
I’m 41 years old. If I don’t know how I read articles by now, that would be scary. Yes. When I find a moment, I intend to read geometry of physics from beginning to end (as I would with any article/text) and I don’t think the plan is particularly outlandish.
It’s been a long time since I read a math book from beginning to end, but I read shorter things like papers and blog posts and wiki pages from beginning to end all the time, and when I write such things I have in mind that my readers will do likewise. The table of contents of a book is, I think, more analogous to the subject TOCs on the nLab that direct you to the appropriate pages, than to the TOCs within a particular page — although even a book is generally much more linear and intended to be read in order (especially a textbook) than any collection of wiki pages.
Let’s imagine the two scenarios. You get to an nlab page with a large TOC on it. Either it is automatically hidden by default or not. Suppose not. Then either you want to look at it or not. To look at it, you have nothing to do. To skip past it then you click on the first link in the TOC. That gets you straight to the first bit of real content. Let’s take the other branch: suppose that it is hidden by default. To look at it, you have to click on something. To skip past it then you do nothing.
So far, so symmetrical: numerically we have that both presentations require either no action (if you like it) or one click (if you don’t). At this point what to do by default should be done by vote.
But it isn’t quite symmetrical due to implementation. The sidebars are a bit tricksy: they are only visible if the div containing them has either focus or “mouse over” (depending on whether you click or hover to activate them). For a start, this (as I’ve just discovered) doesn’t work in mobile environments (I can’t check the mobile version of FireFox). For second, it means that if you click to reveal the TOC, then move down, and then click elsewhere, your whole page will reflow to adjust for the suddenly disappearing TOC.
I’d’ve thought that clicking on a tiny +
symbol would be more annoying than clicking on the first entry in the TOC to skip past it. I find navigating anything on my phone difficult simply because clicking links is so hard to do. Even on my iPad then the number of times I click the link next to the one I want is annoyingly high.
I can see the case for a summarised TOC; I also think that the real solution there would be a modification to maruku to only generate it to a certain level.
Re reading mathematics: there have been rare occasions where I’ve read a book linearly from beginning to end (I think Milnor’s Morse Theory is an example). I don’t know whether I’d read Cats Work linearly; I think it was pretty linearly (this is when I was much younger and knew I wanted a thorough grounding in the categorical basics). Journal articles I’m more likely to read linearly (especially if short), but far from always. Blog articles I’m likely to read linearly, and things like nLab articles, if not too long, I often read (and don’t mind reading) linearly.
Much of this is dependent on reader background of course. With most of the literature, there is a certain amount of rigmarole that is included for completeness, to fill in logic, or to accommodate different readers, etc., that often one can skip past to get down to the real nub.
Readers use the literature in many different ways. Sometimes one just opens a book for consultation purposes. Other times, especially when trying to absorb new material or a new point of view, one has to read more slowly and patiently and with readerly attention (and there, it is helpful to feel that one is being told a certain story). Some people will scan an article and go directly for the nub, and then go through a process of back-filling. There is really no telling in advance the order in which people will use things.
All of us know all of this, of course, but I say this just to recall that there’s no one right way to read, and there are many contingent factors that influence how to read.
Hi Andrew,
Despite the title of this thread, I am now less interested in placing the TOC in the sidebar. I think that would be cool, but now I’m more focused on just learning about the possibility of making the standard TOC expandable.
I can’t quite agree with your symmetry argument though. Now that you mention it, I feel silly for not thinking to just click the first entry to skip the TOC. Instead, I swipe my iphone 5 times to get past the TOC. I don’t think I’m the only person who wouldn’t think of clicking the first entry to skip the TOC, so the two options are not symmetric if the reader defaults to scrolling to get past the TOC (like I did).
Thinking out loud, another possibility might be to take advantage of a “View”. At the bottom of each page, there is a choice of views:
Views: Print | TeX | Source
How difficult would it be to add a view? For example, something that lets you toggle between having TOCs and not having TOCs.
Views: Print | TeX | Source | TOC
which changes to
Views: Print | TeX | Source | No TOC
when you click TOC and vice versa.
My preference would remain to have an expandable TOC (starting at Level 0) if that were possible without too much hassle.
Best regards
PS: Just before hitting “Add your comments”, I thought of another idea that may be even better. Could there be some kind of account setting that lets you choose whether you want to display TOCs? It could default to “Show TOCs” so no one would be affected until they actively deactivate TOCs.
Hi Eric,
Accounts are definitely the hard way to do this. Instiki has no notion of account so adding one in just to fix this would be overkill! An alternative would be to apply CSS on the client side - can you do something like that on your phone? Sort of like a greasemonkey script. After all, one of the values of using webpages instead of PDFs is that the user has some control over the layout.
As I said above, it’s not hard to design some CSS to hide all but a particular level. It would be simple to figure this out in javascript (though I’m not a javascript expert). Easiest then is to install it via something like greasemonkey. An alternative would be to use a CSS test for a mobile platform which hid tocs (maybe beyond the first level). But again, that feels like we’re imposing on everyone who uses a phone to browse the nLab.
I’m not sure what value there would be in adding a view. After all, you have to scroll to the bottom to activate/deactivate it if you end up on the wrong one by mistake (or by clicking a link from, say, the nForum).
I don’t think I’m the only person who wouldn’t think of clicking the first entry to skip the TOC
I never did. (-:
FWIW, the sidebars seem to work in firefox on my android tablet. I touch the hidden sidebar and it expands, allowing me to scroll down and click on the links it contains.
I like Eric’s expandable TOC with plus signs. Although I imagine its being horrible on my phone. (I use my phone to access the Lab only if I’m waiting somewhere bored. Editing on my phone requires a multi-stage process with an external editor app, cut and paste, and going back a few steps when things crash.)
Instiki has no notion of account so adding one in just to fix this would be overkill!
True, but we should add a notion of account for other reasons.
From the little research I’ve done, it seems that implementing an expandable TOC in CSS is doable, but not very natural, i.e. it is not built-in functionality. However, this is apparently very easy to do in JavaScript.
1 to 27 of 27