MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Silme:Tutorial:Diff",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "1538": {
                "pageid": 1538,
                "ns": 0,
                "title": "Silme",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "Silme is an localization library written in python.\n\n* HG: [http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme]\n\n== Tutorial ==\n\n* [[Silme:Tutorial:Concepts| Concepts]]\n* [[Silme:Tutorial:Setting up environment| Setting up environment]]\n* [[Silme:Tutorial:Entity| Entity and EntityList]]\n* [[Silme:Tutorial:L10nObject| L10nObject and L10nPackage]]\n* [[Silme:Tutorial:IOClient| File, SVN, SQL]]\n* [[Silme:Tutorial:FormatParser| DTD, Properties, gettext, HTML, XLIFF]]\n* [[Silme:Tutorial:Diff| Diffing between objects, packages]]\n* [[Silme:Tutorial:Logging| Logging]]\n* [[Silme:Tutorial:Command line| Command line example]]\n* [[Silme:Tutorial:Webtool| Webtool example]]\n* [[Silme:Tutorial:GUI| GUI example]]\n* [[Silme:Tutorial:Shortcuts]]\n\n== Others ==\n\n* [[Silme:roadmap]]\n* [[Silme:apps]] - experimental applications on top of the library"
                    }
                ]
            },
            "1561": {
                "pageid": 1561,
                "ns": 0,
                "title": "Silme:Tutorial:Concepts",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "Silme is built around several abstract concepts that allow the library to support any possible localization format, from DTD, GetText or XLIFF, to MySQL and SQLite, from JAR and normal directory to SVN, CVS or any other Revision Control System.\nIn this section I will explain the basic concepts that will allow you to understand the architecture of the library. Of course it is just an introduction, Silme allows you to extend each class with your data, but here we will focus on the simplest cases.\n\n== Objects ==\n\n=== Entity ===\n\nSilme's most core and atom unit is Entity. Entity is a class that stores single pair of ID<-->VALUE in an abstract model. It is a representation of DTD's <pre><!ENTITY ID \"VALUE\"></pre>, Gettext's <pre>msgid \"ID\"\\nmsgstr \"VALUE\"</pre>, MySQL's ID column and VALUE column in L10n table etc., etc...\n\nIt's very important to understand that you can serialize any localization list to use Entity as long as you can generate unique ID across one list and assign it a value.\n\n=== EntityList ===\n\nGroup of Entity objects is stored as a EntityList object. EntityList is a list (in fact, a '''dict''' structure in Python) that stores list of Entities and nothing more. The easiest way to imagine it is a localization SQL table containing two columns - ID and VALUE. The single row is Entity, the whole table is EntityList.\n\n=== L10nObject ===\n\nAbove that, in some abstract sense, there is L10nObject class. L10nObject extends EntityList and is a representation of any L10n file. So beside of list of Entity objects it also contains Comment objects and normal Strings between them.\nIt's easiest to imagine it as a full representation of simple DTD file:\n<pre>\n\n<!ENTITY myapp.title \"MyApp Title\">\n<!--\nNot used anymore\n<!ENTITY title.old \"Some Title\">\n-->\n<!ENTITY notify.msg \"Please, click OK to continue\">\n<!ENTITY notify.btn \"OK\">\n\n</pre>\n\nwill look like this:\n\n<pre>\nString('\\n')\nEntity(id:'myapp.title',value:'MyApp Title')\nString('\\n')\nComment(\n  String('\\nNot used anymore\\n')\n  Entity(id:'title.old', value:'Some Title')\n)\nString('\\n')\nEntity(id:'notify.msg',value:'Please, click OK to continue')\nString('\\n')\nEntity(id:'notify.btn',value:'OK')\nString('\\n\\n')\n</pre>\n\nL10nObject is more like a file, EntityList like a SQL table. You can get EntityList out of L10nObject or you can get EntityList out of a file directly if you don't want to use the other elements of the structure.\n\nL10nObject stores whole content of the file and should always represent the full file, which means that dumping this structure back to the same format will produce identical file as a source one. In the middle you can operate, move, remove, add strings, comments and entities.\n\n=== Object ===\n\nBeside of L10nObject we have similar structure called Object. Object is used to store data about files that we cannot parse. If, for example, your application will be prepared to parse DTD/PO/Properties and will get HTML file or JPEG it will store it as an Object. Object has an ID and '''source''' properties. Not very useful but will allow us to build a full structure above it:\n\n=== L10nPackage ===\n\nL10nPackage is a representation of list of L10nObjects/Object/EntityLists and potentially other L10nPackages. In the file system world, the nearest similar thing is a directory. Directory can store DTD files, JPEG files, and other directories. Another similar structure is MySQL database which stores tables (EntityLists in our case).\n\n=== Summary ===\n\nThat's all. Currently the scope of the library is to present all potential localization structures using those classes and build an API to operate on them easily.\n\n== Diff module ==\n\nEach and every of the objects - Entity, EntityList, L10nObject, Object, L10nPackage has it's mirror class in the Diff land. So in result we have EntityDiff, EntityListDiff, L10nObjectDiff, ObjectDiff, L10nPackageDiff.\nDiff module allows you to store a difference between two objects of the same type and apply it later. It's like a '''diff''' tool in Linux, beside that it is aware of the syntax of the files/structures and stores the diff in appropriate way. For example if a diff between two EntityLists is a value of one entity, it'll store it as EntityDiff with ID of that entity and (oldvalue,newvalue) tuple.\n\nIn case of an API, it'll usually go down to:\n\n<pre>\nl10npackagediff = l10npackage1.diff(l10npackage2)\n\nl10npackage3.apply_diff(l10npackagediff)\n\nl10npackage4.apply_diff(l10npackagediff)\n</pre>\n\nbut of course you will be able to manually operate on all structures by adding/removing/modifying the content of each object.\n\n== I/O ==\n\nBecause we want to support multiply methods of accessing entities lists, we need to abstract the layer of Input-Output.\nIn Silme, IOManager is a class that manages all IO classes called IOClients.\nExample three IOClients:\n<pre>\nio_client = silme.io.Manager.get('file')\nl10nobject = io_client.get_l10nobject(path='./test/example.dtd')\n\nio_client = silme.io.Manager.get('svn')\nl10nobject = io_client.get_l10nobject(path='svn://svn.server.net/project/trunk/example.dtd')\n\nio_client = silme.ioManager.get('mysql')\nentitylist = io_client.get_entitylist(path='mysql://localhost:8908/l10ndb', table='l10nList')\n</pre>\n\nOf course you can also use get_entitylist on file and SVN, but you cannot get L10nObject from MySQL.\n\nYou can also go the \"raw\" way by asking io_client to give you the source of the file, and then manually create L10nObject out of it. To parse the simple string into L10nObject or EntityList we use:\n\n== FormatParsers ==\n\nFormatParser is a class that can parse string into L10nObject or L10nObject to string. Example FormatParsers are DTD/GetText/Properties/XLIFF/L20n. They're managed by silme.format.Manager:\n\n<pre>\nio_client = silme.io.Manager.get('file')\nfp = silme.format.Manager.get('dtd')\nstring = io_client.get_source(path='./test/example.dtd')\nl10nobject = fp.get_l10nobject(string)\n\nl10nobject.add_entity(silme.core.Entity('id','value'), pos=('after','test.id'))\n\n\n# to save the file you can use this:\nio_client.write_object(l10nobject, path='./test/example2.dtd')\n# or:\nstring = fp.dump_l10nobject(l10nobject)\nio_client.write_to_file(string, path='./test/example2.dtd')\n</pre>\n\n== Summary ==\n\nThat's all for now. This article explained the basic concepts behind the library and I hope you'll find the library useful enough to experiment with writing apps on top of it and/or working with the library itself.\n\nNow, how to set up an [[Silme:Tutorial:Setting up environment|environment]]."
                    }
                ]
            }
        }
    }
}