Jump to content

Web2Cit/Docs/JSON Editor

From Meta, a Wikimedia project coordination wiki

The JSON configuration file editor source code is currently part of the Web2Cit server code base, and it is thus served alongside it at https://web2cit.toolforge.org/edit.html. However, it should be prepared to become a separate general-purpose JSON editor project, as described in T306837.

Web2Cit's JSON configuration file editor is available at https://web2cit.toolforge.org/edit.html.

It:

  1. Fetches a user-requested Web2Cit JSON configuration file from Web2Cit storage repository on metawiki.
  2. Uses the json-editor library to generate a JSON editing form, based on the JSON schema retrieved from the Web2Cit core repository corresponding to the type of the configuration file for the current configuration type (i.e., patterns, templates or tests). Note that these are fetched from the Github mirror because of CORS restrictions in Wikimedia Gitlab (see T305700)
  3. Provides a way to save changes back to metawiki.

It takes the following URL query string parameters:

...

File redirections

[edit]

The JSON editor follows MediaWiki page redirects. If a configuration file requested to be opened using the JSON file redirects to another page, the page redirected to is opened instead, and the save-as field at the bottom is updated accordingly.

i18n

[edit]

Internationalization and translation implies two separate parts:

  • the editor interface
  • the JSON schemas (because most text on the JSON editing form comes from them)

Follow the discussion on T316951.