Move documentation to Read the Docs

Read the docs is used to host the documentation.
https://language-data.readthedocs.io/en/latest/

The following documentation has been moved,

* Introduction
* Using the PHP / Node.js libraries
* Adding new languages
* PHP API documentation

Updated the README.md to point to the new documentation.

Doxygen is used to pull out the PHPDoc comments into XML.
This is parsed via doxyphp2sphinx into Sphinx which is
then used by Read the docs to generate the documentation.

Read the docs has been configured to update the code documentation
under the docs/api folder automatically whenever a commit is made
so no manual work is needed.

Bug: T218639
This commit is contained in:
Abijeet
2020-01-30 23:54:21 +05:30
committed by Niklas Laxström
parent f0a1d0a1f7
commit 8b0ca32167
14 changed files with 3175 additions and 78 deletions

View File

@@ -1,41 +1,35 @@
# CLDR based language data and utilities
[![npm][npm]][npm-url]
[![node-build][node-build]][node-build-url]
[![php-build][php-build]][php-build-url]
The language data with following details are populated from the current version of [CLDR supplemental data](http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml)
This library contains language related data, and utility libraries written in PHP and Node.js to
interact with that data.
1. The script in which a language is written.
The language related data comprises of the following,
1. The script in which a language is written
2. The script code
3. The language code
4. The regions in which the language is spoken
5. The autonym - language name written in its own script
6. The directionality of the text
## Adding languages
This data is populated from the current version of
[CLDR supplemental data](http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml).
New languages must be added to the `data/langdb.yaml` file.
## Documentation
The file format is:
ISO 639 code: [writing system code, [regions list], autonym]
The writing system is indicated using ISO 15924 codes. Make sure that the code appears in the scriptgroups section towards the end of the file, and add it if it doesn't.
The list of region codes appears at the end of `data/langdb.yaml`.
The autonym is the name of the language in the language itself. In some cases, for example for extinct languages such as Jewish Babylonian Aramaic (tmr), the name can be something that is useful for modern users, but in most cases it should be the natural name in the language itself. Please do your best to verify that it's spelled correctly in reliable sources.
After adding a language to `data/langdb.yaml`, run `php src/util/ulsdata2json.php` in the base directory to generate the language-data.json file. Don't edit language-data.json manually.
Example:
`myv: [Cyrl, [EU], эрзянь]`
This is the [Erzya language](https://en.wikipedia.org/wiki/Erzya_language). Its writing system is Cyrillic (ISO 15924: Cyrl). It's spoken in Europe (EU). Its autonym is "эрзянь".
Some languages are listed as redirects. In this case, the only value in the square brackets is the target language code. For example:
`fil: [tl]`
This is the Filipino language, which is a redirect to Tagalog (tl).
1. [Full documentation](https://language-data.readthedocs.io/en/latest/index.html)
2. [Using the PHP library](https://language-data.readthedocs.io/en/latest/index.html#using-the-php-library)
* [PHP API documentation](https://language-data.readthedocs.io/en/latest/api/languagedata.html)
3. [Using the Node.js library](https://language-data.readthedocs.io/en/latest/index.html#using-the-node-js-library)
4. [Adding Languages](https://language-data.readthedocs.io/en/latest/user/adding_new_language.html)
[npm]: https://img.shields.io/npm/v/@wikimedia/language-data.svg
[npm-url]: https://npmjs.com/package/@wikimedia/language-data
[npm-url]: https://npmjs.com/package/@wikimedia/language-data
[node-build]: https://github.com/Abijeet/language-data/workflows/Node.js%20build/badge.svg
[node-build-url]: https://github.com/Abijeet/language-data/actions?query=workflow%3A%22Node.js+build%22
[php-build]: https://github.com/Abijeet/language-data/workflows/PHP%20build/badge.svg
[php-build-url]: https://github.com/Abijeet/language-data/actions?query=workflow%3A%22PHP+build%22