I'm not at all familiar with the magic words handling stuff; I have a desire to be able to hide lower level headings absolutely (toclimit-3 for example) so I can use level 5 or 6 headings for a particular UI purpose without them showing up in the TOC.
According to a response on https://secure.wikimedia.org/wikipedia/en/wiki/Template_talk:TOClimit#What_a... the effect is actually relative (i.e., a level 6 header directly under a level 1 header counts as "2 deep" not 6) rather than absolute. Wanting to see what's under the hood I downloaded 1.15.1 and started wandering around trying to figure out the magic words parsing and am immediately confused.
I know PHP acceptably well but this particular set of stuff is not giving me a good place to start figuring out the TOC formatting. I looked in ImagePage.php and at MediaWiki:Common.css and am not seeing where to start particularly - just grepping for "TOC" in * and following stuff down from there didn't help much so far.
Where do I need to start looking to understand how the TOC is actually produced?
* George Herbert george.herbert@gmail.com [Fri, 4 Sep 2009 20:03:03 -0700]:
I'm not at all familiar with the magic words handling stuff; I have a desire to be able to hide lower level headings absolutely (toclimit-3 for example) so I can use level 5 or 6 headings for a particular UI purpose without them showing up in the TOC.
According to a response on
https://secure.wikimedia.org/wikipedia/en/wiki/Template_talk:TOClimit#What_a...
the effect is actually relative (i.e., a level 6 header directly under a level 1 header counts as "2 deep" not 6) rather than absolute. Wanting to see what's under the hood I downloaded 1.15.1 and started wandering around trying to figure out the magic words parsing and am immediately confused.
I know PHP acceptably well but this particular set of stuff is not giving me a good place to start figuring out the TOC formatting. I looked in ImagePage.php and at MediaWiki:Common.css and am not seeing where to start particularly - just grepping for "TOC" in * and following stuff down from there didn't help much so far.
Where do I need to start looking to understand how the TOC is actually produced?
I remember that when I've been parsed the page, some javascript was insterted into it to generate the TOC. Perhaps that code would help: skins/common/prefs.js // generate toc from prefs form, fold sections // XXX: needs testing on IE/Mac and safari // more comments to follow function tabbedprefs() { ...
this is taken from 1.14.1
Dmitriy
Thanks. I took a quick look, that seems to be a good place to start understanding it.
On Fri, Sep 4, 2009 at 11:33 PM, Dmitriy Sintsovquestpc@rambler.ru wrote:
- George Herbert george.herbert@gmail.com [Fri, 4 Sep 2009 20:03:03
-0700]:
I'm not at all familiar with the magic words handling stuff; I have a desire to be able to hide lower level headings absolutely (toclimit-3 for example) so I can use level 5 or 6 headings for a particular UI purpose without them showing up in the TOC.
According to a response on
https://secure.wikimedia.org/wikipedia/en/wiki/Template_talk:TOClimit#What_a...
the effect is actually relative (i.e., a level 6 header directly under a level 1 header counts as "2 deep" not 6) rather than absolute. Wanting to see what's under the hood I downloaded 1.15.1 and started wandering around trying to figure out the magic words parsing and am immediately confused.
I know PHP acceptably well but this particular set of stuff is not giving me a good place to start figuring out the TOC formatting. I looked in ImagePage.php and at MediaWiki:Common.css and am not seeing where to start particularly - just grepping for "TOC" in * and following stuff down from there didn't help much so far.
Where do I need to start looking to understand how the TOC is actually produced?
I remember that when I've been parsed the page, some javascript was insterted into it to generate the TOC. Perhaps that code would help: skins/common/prefs.js // generate toc from prefs form, fold sections // XXX: needs testing on IE/Mac and safari // more comments to follow function tabbedprefs() { ...
this is taken from 1.14.1
Dmitriy
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Dmitriy Sintsov wrote:
I remember that when I've been parsed the page, some javascript was insterted into it to generate the TOC. Perhaps that code would help: skins/common/prefs.js // generate toc from prefs form, fold sections // XXX: needs testing on IE/Mac and safari // more comments to follow function tabbedprefs() { ...
this is taken from 1.14.1
Dmitriy
Javascript is only used for collapsation. The TOC is generated by PHP, as you can test by browsing the page with javascript disabled.
The main TOC handling is at includes/parser/parser.php on function formatHeadings
On Sat, Sep 5, 2009 at 7:46 AM, Platonides Platonides@gmail.com wrote:
Javascript is only used for collapsation. The TOC is generated by PHP, as you can test by browsing the page with javascript disabled.
The main TOC handling is at includes/parser/parser.php on function formatHeadings
This is correct. Although it's includes/parser/Parser.php (not all of us use Windows or Mac! :P).
On Sun, Sep 6, 2009 at 12:05 PM, Aryeh Gregor <Simetrical+wikilist@gmail.comSimetrical%2Bwikilist@gmail.com
wrote:
This is correct. Although it's includes/parser/Parser.php (not all of us use Windows or Mac! :P).
AFAIR Mac OS X's Partition Manager allows you to set up a HFS partition as case sensitive :p Marco
On Sun, Sep 6, 2009 at 9:27 AM, Marco Schuster marco@harddisk.is-a-geek.org wrote:
AFAIR Mac OS X's Partition Manager allows you to set up a HFS partition as case sensitive :p
And in Linux you could use come crazy FUSE-based thing, I'm sure. But it's not something that sane people usually do, since it kind of breaks all the programs at random . . .
* Aryeh Gregor Simetrical+wikilist@gmail.com [Sun, 6 Sep 2009 06:05:37 -0400]:
On Sat, Sep 5, 2009 at 7:46 AM, Platonides Platonides@gmail.com
wrote:
Javascript is only used for collapsation. The TOC is generated by PHP, as you can test by browsing the page
with
javascript disabled.
The main TOC handling is at includes/parser/parser.php on function formatHeadings
This is correct. Although it's includes/parser/Parser.php (not all of us use Windows or Mac! :P).
This is correct, but why there were some toc-related javascript inserted into page parsed by command line script?
My code:
$text = strip_tags( $text ) . "\n__NOTOC__"; // strip xml hook tags and suppress TOC $parser_output = $this->Parser->parse( $text, $title, $this->mParserOptions ); // parse
Since then command line scripts are learned to understand javascript? Thats not a browser. Dmitriy
On Mon, Sep 7, 2009 at 1:37 AM, Dmitriy Sintsov questpc@rambler.ru wrote:
This is correct, but why there were some toc-related javascript inserted into page parsed by command line script?
To allow it to be collapsed by the user.
Since then command line scripts are learned to understand javascript? Thats not a browser.
MediaWiki's HTML output is intended for browsers, not command line scripts. If you're trying to parse HTML using a command-line script, you should expect it to include things like scripts, which are after all a legitimate part of HTML. Why would you expect Parser::parse() to produce output appropriate for scripts?
wikitech-l@lists.wikimedia.org