Last modified: 2013-04-22 16:14:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47845, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45845 - Do not hardcode the documentation location for modules
Do not hardcode the documentation location for modules
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Brad Jorsch
usability
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-07 14:57 UTC by Danny B.
Modified: 2013-04-22 16:14 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danny B. 2013-03-07 14:57:23 UTC
The following messages and their behavior imply that the documentation location *must* be as a subpage. That is not an approach taken by all wikis, so the location must not be hardcoded this way.


scribunto-doc-subpage-does-not-exist
  ''Documentation for this module may be created at [[$1]]''

Rename to scribunto-doc-page-does-not-exist
Change the behavior of $1 to be <scribunto-doc-page-name>


scribunto-doc-subpage-header
  '''This is the documentation subpage for [[$1]]'''

Rename to scribunto-doc-page-header
Change to '''This is the documentation page for [[$1]]'''


scribunto-doc-subpage-name
  doc

Rename to scribunto-doc-page-name
Change to {{FULLPAGENAME}}/doc (alt. $1/doc, if the former wouldn't work)


scribunto-doc-subpage-show
  {{$1}} <hr />

Change to scribunto-doc-page-show
Comment 1 Andre Klapper 2013-03-07 15:07:27 UTC
Reverting my changes after IRC chat. Sorry.
Comment 2 Brad Jorsch 2013-03-07 17:37:16 UTC
It *could* work as long as scribunto-doc-page-name remains unparsed (i.e. using Message::plain()). Which would mean you'd be able to put the documentation at something like "Project:Module documentation/$1", or generally add any prefix or suffix to $1, but you couldn't do anything fancier, i.e. no parser functions. Allowing parser functions would make it impossible for Scribunto to determine whether any particular page is supposed to be documentation so it can allow it to be rendered as wikitext.

$1 could be either {{FULLPAGENAME}} or {{PAGENAME}}, with the default being either "$1/doc" or "Module:$1/doc" to match.
Comment 3 Danny B. 2013-03-07 21:39:08 UTC
If you actually need this to determine whether to syntaxhilight or parse the page in Module namespace, then better approach would be to have another message, let's say "scribunto-noscript-pages" as a blacklist of those not to be hilighted / whitelist of those to be parsed. Similar to title blacklist, bad image list and others. Or have a new magic word, let's say __NOCODE__ or something like that to be added to pages which should be parsed.

Hardcoding some pattern is definitely not good approach because it is so very limmiting, besides it can cause issues in case the name which would match the patter would have to be actually used for the code.

(In reply to comment #2)
> Which would mean you'd be able to put the documentation at
> something like "Project:Module documentation/$1", or generally add any prefix
> or suffix to $1
> $1 could be either {{FULLPAGENAME}} or {{PAGENAME}}, with the default being
> either "$1/doc" or "Module:$1/doc" to match.

That's exactly what I'm suggesting. To be able to add any prefix/suffix to the name itself. Which implies, that having {{PAGENAME}} for $1 is obviously better than {{FULLPAGENAME}}, since it's easy to add namespace as prefix, but quite impossible to remove it.

Looking forward this solution the sooner the better, preferably before the wider deployment of Scribunto on WMF wikis to save the further work with relocations.
Comment 4 Brad Jorsch 2013-03-07 22:10:00 UTC
(In reply to comment #3)
> If you actually need this to determine whether to syntaxhilight or parse the
> page in Module namespace, then better approach would be to have another
> message, let's say "scribunto-noscript-pages" as a blacklist of those not to
> be
> hilighted / whitelist of those to be parsed. Similar to title blacklist, bad
> image list and others. Or have a new magic word, let's say __NOCODE__ or
> something like that to be added to pages which should be parsed.

No. Let's keep things simple: if a module looks at a particular page for its documentation, then that page should be module documentation.

> Looking forward this solution the sooner the better, preferably before the
> wider deployment of Scribunto on WMF wikis to save the further work with
> relocations.

You'll have to convince someone to update the extension in wmf11 then, because wmf12 will be too late.
Comment 5 Brad Jorsch 2013-03-08 17:17:09 UTC
Gerrit change #52875.
Comment 6 Alex Monk 2013-03-17 19:48:18 UTC
Merged by Demon on the 13th. Is this bug fixed now?
Comment 7 Brad Jorsch 2013-03-17 23:01:55 UTC
I would assume so.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links