Skip to content

Latest commit

 

History

History
83 lines (55 loc) · 2.34 KB

CONTRIBUTING.md

File metadata and controls

83 lines (55 loc) · 2.34 KB

Contributing guide

If you want to contribute to the source code, feel free to do so! ❤️

Don't forget to state what should be changed and their respective reasons.

If you want to see/modify on the codepoints supported and/or their respective translation(s), feel free to do so! Here are the ways on how to do them;

  • To convert the binary into a readable text file, do the following:
node scripts/read.mjs path/to/output.txt
  • To convert the binary into a readable and modifiable JSON, do the following:
node scripts/read.mjs [path/to/output.json]

If the output file name is not supplied, it will default to output.json.

  • And to validate, optimize, and convert the JSON back into a binary, do the following:
node scripts/write.mjs path/to/input.json
  • The structure of the JSON is as follows:

The optional fields here are only optional when writing and encoding them back into a binary.

interface Codepoint {
  codepoint: number
  translation: string
}

interface JsonContents {
  codepoints: Codepoint[]
  similar: string[][]
}
  • Information regarding the Codepoint structure:

    • The JsonContents#codepoints array must NOT be empty.
    • Codepoint#codepoint is the unicode codepoint. It must be around \u80 to \ue00ff and must NOT be a surrogate.
    • Codepoint#translation is the translation string: its length must not exceed 15, it must be in lowercase, and it must be in ASCII.
  • Information regarding the JsonContents#similar field:

    • The string[][] two-dimensional array must NOT be empty and its length must NOT exceed 127.
    • The string[] arrays must NOT be empty and their lengths must NOT exceed 255.
    • Each string must ONLY be one character long.
    • Each string must be ASCII.

Other scripts

Other useful scripts have been added as a utility for maintaining decancer.

Pretty source code files

Prerequisites:

node scripts/pretty.mjs

Bump version number

node scripts/version.mjs 1.2.3

Update cache if a new unicode version is released

node scripts/update_unicode.mjs