Commit 542b60aa authored by Siltaar's avatar Siltaar
Browse files

doc

parent a5afed19
......@@ -13,15 +13,13 @@ name, in 69 https://en.wiktionary.org/wiki/Appendix:Months_of_the_year[languages
The function returns a month number from a given litteral case-insensitive month
name or abbreviation. It returns `undefined` if no corresponding number is found.
It's currently presented as plain JavaScript files. To use it simply include
It's currently presented as plain JavaScript files. To use it simply includes
the following files in your environnement :
```html
<script src="month_nb.json" type="text/json" id="mnb_json_elt"></script>
<script type="text/javascript">
(function() {
const month_nb_json = JSON.parse(document.getElementById("mnb_json_elt").innerText);
})();
month_nb_json = {};
fetch("month_nb.json").then(r => r.json()).then(json => month_nb_json = json);
</script>
<script src="month_nb.js" type="text/javascript"></script>
```
......@@ -32,10 +30,10 @@ the following files in your environnement :
`month_nb.js` only contains a loop going through a JSON tree data structure
made of regular expression strings as keys (for the nodes), sub-objects as
branchs and numbers as leafs. The data structure itself resides in the
`month_nb_json.js` file.
`month_nb.json` file.
This clear separation between code and data is wanted to ease the re-use of
`month_nb_json.js` data structure with other languages, to reimplement a
`month_nb.json` data structure with other languages, to reimplement a
`month_nb` feature.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment