Last modified: 2014-11-02 16:03:23 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 T65211, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63211 - Add anchors to MediaWiki Web API help output
Add anchors to MediaWiki Web API help output
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Brad Jorsch
https://www.mediawiki.org/w/api.php
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-28 00:26 UTC by MZMcBride
Modified: 2014-11-02 16:03 UTC (History)
7 users (show)

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


Attachments

Description MZMcBride 2014-03-28 00:26:18 UTC
Re: https://www.mediawiki.org/w/api.php

The help output is really long, which is great for in-browser search, but sometimes I want to point a person to a specific section.

It'd be nice to have HTML anchors in the help output of the MediaWiki Web API.  For example, I'd like to be able to link to the "* meta=globaluserinfo (gui) *" section. Without HTML anchors (such as <span id="foo">bar</span>), pointing someone to a specific portion of the help output is difficult.
Comment 1 Sam Reed (reedy) 2014-03-28 00:45:56 UTC
I'm sure this is a dupe... Of something that might've been WONTFIX'd or similar...
Comment 2 MZMcBride 2014-03-28 01:47:01 UTC
(In reply to Sam Reed (reedy) from comment #1)

Perhaps you're thinking of bug 19721 (found via bug 26990)?

I'd forgotten about bug 19721. I still think anchors would be helpful in the full Web API help output, but as an alternate idea, I'd accept including _links_ to the module-specific help pages from the main help page next to each module.
Comment 3 Brad Jorsch 2014-03-28 14:07:57 UTC
There has been some discussion (although I don't remember if any of it was public rather than just people talking to me) about reworking the default auto-generated help page to be actual HTML rather than the weird HTML/text/XML hybrid that it is now.

The general idea would be that the landing page would give some general information and list the action modules as links somehow or other, and clicking the link for one would give you the help for just that module (and something like action=query would have the same setup for its submodules). There would also be a one-huge-page mode for printing or Ctrl-F searching.

This would, of course, probably require some changes to the architecture of the existing API modules, to the point where it's probably something of a big project. And for maximum benefit it would ideally be integrated into i18n of the API so the help could be generated in non-English languages, which is itself a big project. These sorts of API-related projects may be my next project to work on.
Comment 4 db [inactive,noenotif] 2014-03-31 18:55:15 UTC
action=help accepts a modules param, so you can choose one or more modules to link to (but you have already found the bug for that). That should be enough.

For example:
https://www.mediawiki.org/w/api.php?modules=tokens|query+info
Comment 5 MZMcBride 2014-04-01 03:50:35 UTC
(In reply to Brad Jorsch from comment #3)
> There has been some discussion (although I don't remember if any of it was
> public rather than just people talking to me) about reworking the default
> auto-generated help page to be actual HTML rather than the weird
> HTML/text/XML hybrid that it is now.

*nod*  Though I wonder how much of this would overlap with [[mw:API:Main page]] and [[mw:Special:ApiSandbox]]. There are definitely plenty of good ideas to consider and explore here.

(In reply to db from comment #4)
> That should be enough.
> 
> For example:
> https://www.mediawiki.org/w/api.php?modules=tokens|query+info

I think this currently has very poor discoverability.

I think we can improve the API user experience by adding anchor links and/or links to module-specific help pages in the current weird HTML/text/XML hybrid output, at least as an interim solution. If the whole output gets rewritten, this enhancement request will likely become moot.
Comment 6 Brad Jorsch 2014-04-01 14:33:08 UTC
(In reply to MZMcBride from comment #5)
> *nod*  Though I wonder how much of this would overlap with [[mw:API:Main
> page]]

There is some overlap. But I'm not considering changing the information available via api.php, just improving the formatting. So api.php would remain more of a programmer's quick reference while [[mw:API:Main page]] would remain more in-depth with explained examples.
Comment 7 Kishan Thobhani (kishanio) 2014-05-10 15:32:49 UTC
Wording,

1.) Add id to the title of the modules to be anchored. 
2.) Do we just need id or hyperlinks too?

I would like to work on this can someone please assign me?
Comment 8 Sam Reed (reedy) 2014-05-10 15:34:38 UTC
(In reply to kishanio from comment #7)
> I would like to work on this can someone please assign me?

You don't need to be assigned to a bug to be able to work on it. A comment on the bug is sufficient
Comment 9 Gerrit Notification Bot 2014-05-10 19:40:16 UTC
Change 132734 had a related patch set uploaded by Kishanio:
Add anchors to MediaWiki Web API help output

https://gerrit.wikimedia.org/r/132734
Comment 10 Kishan Thobhani (kishanio) 2014-05-12 21:00:02 UTC
WRT Brad Jorsch comment on gerrit,

I need to put some identifier in  to map actions & format in ApiFormatBase.php & hyperlink it. Right now we are using '*' to bold things and likewise i used % for format && %% for action. I don't why i picked it. But somehow foolishly with same thought it just breaks things in requests like api.php?action=parse&text=%25%25foo&title=Foo&prop=wikitext. 

Any thoughts on same?
Comment 11 Brad Jorsch 2014-05-13 18:52:50 UTC
(In reply to kishanio from comment #10)
> Any thoughts on same?

Not really. The best solution is as I outlined in comment 3, but that's far from an "easy" bug since it requires major architectural changes throughout the API classes.
Comment 12 Kishan Thobhani (kishanio) 2014-05-14 11:33:23 UTC
(In reply to Brad Jorsch from comment #11)

> Not really. The best solution is as I outlined in comment 3, but that's far
> from an "easy" bug since it requires major architectural changes throughout
> the API classes.

In that case i'll remove keyword "easy" so no other newbies misinterpret it and start working on it. I'll keep following this space so later whenever you decide to work on it i can contribute as well.
Comment 13 Gerrit Notification Bot 2014-08-15 22:59:48 UTC
Change 154355 had a related patch set uploaded by MarkTraceur:
Add help links to API documentation page

https://gerrit.wikimedia.org/r/154355
Comment 14 Gerrit Notification Bot 2014-09-16 19:26:41 UTC
Change 160798 had a related patch set uploaded by Anomie:
API: HTMLize and internationalize the help, add Special:ApiHelp

https://gerrit.wikimedia.org/r/160798
Comment 15 Gerrit Notification Bot 2014-09-16 21:14:01 UTC
Change 154355 abandoned by MarkTraceur:
Add help links to API documentation page

Reason:
My gosh, the new format is nice. Happily abandoning.

https://gerrit.wikimedia.org/r/154355
Comment 16 Gerrit Notification Bot 2014-10-13 22:19:55 UTC
Change 160798 merged by jenkins-bot:
API: HTMLize and internationalize the help, add Special:ApiHelp

https://gerrit.wikimedia.org/r/160798
Comment 17 Gerrit Notification Bot 2014-11-02 16:03:23 UTC
Change 132734 abandoned by Reedy:
Add anchors to MediaWiki Web API help output

Reason:
I guess this really isn't needed anymore after the API help rewrite...

https://gerrit.wikimedia.org/r/132734

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


Navigation
Links