Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-11 Thread Daniel Kinzler
Am 11.04.2017 um 02:35 schrieb Denny Vrandečić: > Unfortunately, I am unsure whether I can restrict the usage this tightly, > and whether I'd rather let the users shoot themselves in the foot or > restrict them from doing so... age old question! That indeed is one of the ultimate questions, from U

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread C. Scott Ananian
...and inspired, I just submitted https://wikimania2017.wikimedia.org/wiki/Submissions/Writing_Visual_Editor_and_Parsoid_extensions --scott On Mon, Apr 10, 2017 at 3:15 PM, C. Scott Ananian wrote: > More related functionality: Parsoid supports JSON as a contenttype, and > emits a special type

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Denny Vrandečić
Good points. All too familiar from trying to parse and understand the ways the templating system has been used :) Unfortunately, I am unsure whether I can restrict the usage this tightly, and whether I'd rather let the users shoot themselves in the foot or restrict them from doing so... age old qu

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Bartosz Dziewoński
On 2017-04-10 06:17, Denny Vrandečić wrote: On Sat, Apr 8, 2017 at 11:30 PM James Hare wrote: Why, exactly, do you want a wikitext intermediary between your JSON and your HTML? The value of wikitext is that it’s a syntax that is easier to edit than HTML. But if it’s not the native format of yo

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Denny Vrandečić
Uh, that sounds nifty. Thanks for that! On Mon, Apr 10, 2017 at 12:15 PM C. Scott Ananian wrote: > More related functionality: Parsoid supports JSON as a contenttype, and > emits a special type of table (the same as the HTML table generated by the > HTML handler for JSON in mediawiki). You can

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Denny Vrandečić
Ah, just an internal data structure. In the end, the UI will be form-based anyway. But in these forms, the user will be able to enter some wikitext fragments. Yucky, I know. I prefer JSON over XML only because it is the Zeitgeist, and I expect the tool support for JSON to grow whereas I don't see

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread C. Scott Ananian
More related functionality: Parsoid supports JSON as a contenttype, and emits a special type of table (the same as the HTML table generated by the HTML handler for JSON in mediawiki). You can edit this in VE, although w/o any special support, and Parsoid will serialize it back to JSON. This could

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Daniel Kinzler
Am 10.04.2017 um 06:17 schrieb Denny Vrandečić: > Ah, good question indeed. The reason is that users would be actually > putting fragments of wikitext into the JSON structure, and then the JSON > structure gets assembled into wikitext. Not only would I prefer to have the > users work with fragments

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Denny Vrandečić
Thanks Brad, that's perfect! I'll proceed as suggested. Thanks list, that was really helpful and saved me plenty of trial and errors! On Mon, Apr 10, 2017 at 7:07 AM Brad Jorsch (Anomie) wrote: > On Sun, Apr 9, 2017 at 11:38 AM, Daniel Kinzler < > daniel.kinz...@wikimedia.de > > wrote: > > > Ge

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-10 Thread Brad Jorsch (Anomie)
On Sun, Apr 9, 2017 at 11:38 AM, Daniel Kinzler wrote: > Generating wikitext from some other thing is what Scribunto does. Not really. What Scribunto does is let you run a program to generate wikitext. If you wanted to write code that took some JSON and turned it into wikitext without going th

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Denny Vrandečić
Thanks Tpt, that sounds relevant! I will take a look into the code. More code examples are really useful to figure this all out :) On Sun, Apr 9, 2017 at 9:53 AM Thomas PT wrote: > An other maybe relevant example : ProofreadPage has a content model for > proofreading pages with multiple areas of

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Denny Vrandečić
On Sun, Apr 9, 2017 at 8:38 AM Daniel Kinzler wrote: > Am 09.04.2017 um 08:23 schrieb Denny Vrandečić: > > Here's my requirement: > > - a wiki page is one JSON document > > - when editing, the user edits the JSON directly > > - when viewing, I have a viewer that turns the JSON into wikitext, and

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Denny Vrandečić
On Sun, Apr 9, 2017 at 4:11 AM Gergo Tisza wrote: > You probably want to subclass JsonContentHandler and add wikitext transform > What does it mean to add wikitext transform? > and whatever else you need. For schemas, have a look > at JsonSchemaContentHandler in EventLogging. > Thanks, that l

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Denny Vrandečić
On Sat, Apr 8, 2017 at 11:30 PM James Hare wrote: > Why, exactly, do you want a wikitext intermediary between your JSON and > your HTML? The value of wikitext is that it’s a syntax that is easier to > edit than HTML. But if it’s not the native format of your data, nor can > browsers render it dir

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Thomas PT
An other maybe relevant example : ProofreadPage has a content model for proofreading pages with multiple areas of Wikitext and use some for transclusion and others for rendering: * https://github.com/wikimedia/mediawiki-extensions-ProofreadPage/blob/master/includes/page/PageContent.php * https

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Isarra Yos
Sounds like what they want is what collaborationlistcontent/handler does, specifically, at least for now. On 09/04/17 06:30, James Hare wrote: Why, exactly, do you want a wikitext intermediary between your JSON and your HTML? The value of wikitext is that it’s a syntax that is easier to edit th

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread zppix e
That seems like a performance hog in the making in my opinion to not mention, mostly unneeded as far as I can tell. Sent from my iPhone > On Apr 9, 2017, at 6:11 AM, Gergo Tisza wrote: > > You probably want to subclass JsonContentHandler and add wikitext transform > and whatever else you need.

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Daniel Kinzler
Am 09.04.2017 um 08:23 schrieb Denny Vrandečić: > Here's my requirement: > - a wiki page is one JSON document > - when editing, the user edits the JSON directly > - when viewing, I have a viewer that turns the JSON into wikitext, and that > wikitext gets rendered as wikitext and turned into HTML by

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-09 Thread Gergo Tisza
You probably want to subclass JsonContentHandler and add wikitext transform and whatever else you need. For schemas, have a look at JsonSchemaContentHandler in EventLogging. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedi

Re: [Wikitech-l] Editing JSON in MediaWiki

2017-04-08 Thread James Hare
Why, exactly, do you want a wikitext intermediary between your JSON and your HTML? The value of wikitext is that it’s a syntax that is easier to edit than HTML. But if it’s not the native format of your data, nor can browsers render it directly, what’s the point of having it? The CollaborationKit

[Wikitech-l] Editing JSON in MediaWiki

2017-04-08 Thread Denny Vrandečić
Here's my requirement: - a wiki page is one JSON document - when editing, the user edits the JSON directly - when viewing, I have a viewer that turns the JSON into wikitext, and that wikitext gets rendered as wikitext and turned into HTML by MediaWiki I have several options, including: 1) hook fo