Page MenuHomePhabricator

Limit scope of title-based syntax highlighting
Closed, ResolvedPublic


Currently any page in the Module namespace has its full contents syntax highlighted. This is problematic as it makes hyperlinking impossible. Every page in the Module namespace becomes a dead-end page! This is bad.

There has to be some support for including working (i.e., parsed and rendered) wikitext in Module pages, in some form. I've come up with three different ideas for doing so. There may be better ideas, but these are a starting point for thought and discussion.

(1) Explicitly define non-script areas, similar to how templates have a <noinclude> area. You could add some markup such as a horizontal rule ("----") or something where text in those sections is not treated as part of the scripting language (code) and is instead run through the standard MediaWiki parser.

(2) Implicitly define non-script areas. This would rely on magic transclusion, for example Module:Foo would have an implicit transclusion of Module:Foo/Header and Module:Foo/Footer, allowing users to add categories and introductory text in subpages, but not mess with the Module:Foo page itself.

(3) Create a linking hybrid, where links are clickable and get properly inserted into link-trakcing tables, but do not alter how the code reads. This would be similar to Bugzilla's current linking behavior in a lot of ways. This is my least favorite option.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:06 AM
bzimport set Reference to bz39609.

Pretty much the same problem as bug 10410. Maybe even a duplicate?

If I'm understanding this correctly, the wish is for text formatted like [[this (not forgetting the possible)|pipe trick]] to be rendered as wikilinks within LUA comments…and the discussion at bug 10410 suggests that this might be something desirable in other languages also.

My on-topic reaction is that one way of constructing comments in LUA involves doubled square brackets (with or without contained equals signs [[like this]] or [=[like this]=]) which would mean that at least some perfectly-valid comments in LUA would be made into wikilinks in error.

My off-topic reaction is to wonder whether it would be possible to insert a callback hook into the Syntax Highlighter module to optionally pass comments through a wikitext parser…which is a discussion for elsewhere so I'll stop there.

yperret wrote:

I +1 this idea (and I wrote mostly the same in one Lua discussion page).

This should be useful for several this.
The main in my opinion is the possibility to put modules in categories (the wikipedia I know all have templates in thematic categories).
It is also useful to at least have a link to wikified module documentation.

I prefer the #2 way if this feature is added. It is similar to the convention of using /Doc (/Documentation on fr:) subpage for templates.



About /doc subpages, see also [[mw:Extension talk:Scribunto/Documentation specification]].

Personally, i'm happy to keep the situation as is (i.e., no direct link from the script to its docs), and treat the talk pages in the Module: namespace as the proper place for documentation.

if "real" talkpage is needed (i.e., somewhere to discuss the module, in contrast with somewhere to document it), a subpage of the "main" talkpage can be used, and be linked from the doc.

so in a nutshell:

[[Module:Foo]] (the Lua script - and maybe, in some future, a non-lua script)
[[Module talk:Foo]] (the documentation page)
[[Module talk:Foo/Discussion]] (somewhere to discuss the script.

		linked from [[Module talk:Foo]])

embedding links to the documentation inside comments in the script seems both complicated and dangerous, and when a seldom-used text page (IOW, the talkpage of the module) is only a mouseclick away, it seems like the wrong thing to do.


(In reply to comment #5)

so in a nutshell:

[[Module:Foo]] (the Lua script - and maybe, in some future, a non-lua
[[Module talk:Foo]] (the documentation page)
[[Module talk:Foo/Discussion]] (somewhere to discuss the script.

linked from [[Module talk:Foo]])

This would cause comments about the module not to appear in my WatchList if I'm just watching the module. The discussion has to happen in the talk page, [[Module talk:Foo]].

(In reply to comment #4)

About /doc subpages, see also [[mw:Extension talk:Scribunto/Documentation

It seems Anomie proposed this in

Since gerrit change 50143 is merged, which allows for wikitext documentation of modules, let's mark this fixed.