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.
Oh dear, the automatic definition/proposition numbering system is again broken. Check out any nLab page (e.g. this one). Whenever there is a referencing back to prop. number such and such, the numbers have nothing to do with each other.
This is done via CSS, right? So I suppose some people here might know how to fix this (while Adeel is still busy with his thesis work)?
Yes, I think this has been true since the change to environment numbering, as mentioned here. No one at the time seemed able or inclined to fix it.
Thanks, I see. I had missed that all along.
Okay, I’ll try to make Adeel undo the change that causes the problem, until he finds time to implement it properly. Because this situation is untenable.
I can try to take a look later today. Let me know if Adeel works on it, as then I’ll leave it to him.
I had emailed Adeel, but I have no response yet. I suppose if you could do it, he wouldn’t mind, to say the least.
I have been taking a look. Every time I take a look at the instiki source code, I am put off by how awfully it is structured. It is very difficult to work out what is going on. This may partially be an artefact of Ruby on Rails, but not completely I think.
There is next to no documentation, the unit tests are very far from comprehensive, and it is an absolute lottery trying to find out where anything is coded.
To try to find out where the references are coded, I had to resort to grep-ing the git log history, and then doing a diff. To spare anybody else the pain, they were configured in vendor/plugins/maruku/lib/maruku/ext/math, in the parsing.rb and to_html.rb files… but these files have now disappeared! Maruku now seems to have been separated out from instiki: the relevant code is here (search for \ref) and here (search for to_html_divref).
Looking at this, the crucial point seems to be that \ref{#Whatever} is converted to “a> class=’maruku-ref’ href=’#Whatever’>number</a” (where I have removed tags so that it is not converted to a link here as well!), where ’number’ is taken from the ’num’ parameter/attribute/whatever it’s called in the theorem div. Now, the change that Adeel made does not change the num parameter, it only changes the string that is displayed when the theorem with its number is itself displayed. Hence why the references have not been changed.
I believe that one could change Adeel’s javascript to alter the num parameter itself, which would fix this. I’ve not written much javascript, and it seems that Adeel has, so he can probably fix this quicker than me. If he really cannot do it, I’m sure I can figure it out.
Thanks. Short of adjusting the num-parameter to our new numbering (which eventually we should do), would you know how to revert the new numbering to the old numbering, such that at least we have sensible pages for the time being?
Probably the best way is just to revert Adeel’s last two commits in the git repository. I don’t have the rights to do that, but Mike will certainly know how to do it if he has the rights.
With regard to changing the num parameter, it may be that my original suggestion, using pure css rather than javascript, would also work, for the per environment numbering at least.I’m not completely sure, though.
Where is the relevant git repository?
Here.
If you’re asking that question, I guess that you do not have the rights to make changes to the master branch. In any case, the changes would need to be deployed to the server that the nLab is running on. If no-one has the rights to do that except Aqeel, then the only thing we can do is wait for him in any case :-). If someone has access to the server but not the nLab git repository, they could revert the changes locally, and deploy the local version to the server.
Hi, I’ll look into it now.
Ok, should be fixed now. As usual the cache has been reset so pages will load a bit slower than normal. Let me know it still doesn’t work.
Excellent. Thanks!
Awesome!
Nice one!
It seems to me that referencing across pages, which was also requested once, could be straightforwardly implemented in a similar way, using something which can look up HTML elements across pages, instead of just on the same page. One would need to check whether this would impact performance, but my guess is that it can be done without much performance impact. If it is reasonably trivial, perhaps it is something you could look into when you have the opportunity, Adeel?
I tried to look into the code, but also didn’t manage to figure out how things actually work. Morally, I think the code to do the numbering should be done in the Ruby layer when generating the page, rather than adding them ad hoc in the browser after the page is produced. Doing it server-side will probably make it much easier to do cross-reference. However, my impression is that the page generation is handled by an external library, which makes it more difficult to work with…
(also, the page Introduction to Stable homotopy theory – P struggles to load on my browser)
@Dexter
(also, the page Introduction to Stable homotopy theory – P struggles to load on my browser)
Yes, MathJax struggles on those large pages. What’s it like in Firefox, if you’re not using it already?
It was on firefox. It was most likely caused by the script trying to run the references. More precisely, firefox killed the script when it reached this line due to it overloading the machine.
Morally, I think the code to do the numbering should be done in the Ruby layer when generating the page, rather than adding them ad hoc in the browser after the page is produced.
I agree completely.
One can imagine a proper backend for Instiki in which builds up a WikiEntry type/object/whatever from constituent types/objects, including ’Theorem’ types/objects. It would then be trivial to implement referencing. My impression is that Instiki doesn’t have anything like this, but I could be missing something.
Perhaps it would be good to create an issue for discussion on the instiki github page. This has been successful before.
I just pushed a slight optimization of the script, and also moved it out to an external file. That was enough to make the link in #17 start working for me at least (on Firefox).
It is certainly true that all this should be implemented on the server-side, but this requires some non-trivial work and modifications to Maruku. Same with cross-page referencing (re; #16).
Thanks! It seems much better now.
Thanks for all your good work, Adeel. Were the changes supposed to apply all across ncatlab, including for example private webs? On one of my pages, I have environments labelled 0.1 – 0.19, even though there are separate sections and a {:toc}.
Strange, I don’t know why it wouldn’t be working on the other webs. Maybe it’s because I had only cleared the main nLab cache; I’ve just now cleared all the caches, maybe that helps? Looking at some pages on Urs’s web, it appears to be working there at least.
Still the same. Let’s talk about this in email (I can give you my passwd).
Actually, come to think of it Adeel, the page I was referring to is on my public web, here.
Fixed now. Apparently the HTML syntax of published pages of private webs differs in a small way which was relevant for the script.
Wonderful! Thanks so much!
It happens to me that I give a section the same anchor name as some proposition. As in
## Topological spaces
{#TopologicalSpaces}
+-- {: .num_defn #TopologicalSpaces}
###### Definition
I try to avoid this, but it keeps happening. Also copy-and-pasting from other entries sometimes leads to duplication in anchor names.
The problem is that if an anchor name of some definition/theorem environment gets duplicated at some point in the page, even in another context (headline), then the automatic numbering of references to that environment and many other environments breaks.
The way it break is curious: instead of some correct number of the form “2.5” what instead appears in these cases now is something like “23”, apparently falling back to the linear counting.
Anyway, what is troubling about this is that for long pages it is really really tedious to find the anchor name that is duplicated. This is because not only one environment-reference labeling breaks, but many, and usually not in any conceivable linear order, so that it is hard to see which one is the culprit.
This here is maybe more a warning to others than a bug report: Best to make sure to use different anchor naming conventions for sections than for environments. (For instance I do one in plural, one in singular. I just have to remember each time which of the two possible conventions I am sticking to…)
But if there were any way to make the parser be more robust against these kinds of code hickups, of course that would be great, too.
One possibility for a naming convention would be to prefix one or both of them, like SecTopologicalSpaces
and DefTopologicalSpaces
. This should be a familiar issue to TeX users; you can’t use the same label name for a section and a definition in TeX either.
1 to 32 of 32