This proposal is for a rewrite of idnits in javascript, so that it can run both natively in the browser and on the server / console.
General Implementation
Implemented as a ESM library, exposing a single async function checkNits(opts), that resolves to a result object.
A separate cli.js parses command line arguments, calls the library and output the results in a console friendly format.
Section texts should be stored in a separate .json file.
Distribution
As a NPM package that can be both embedded into a web application or used as a standard CLI, on any platform supported by Node.js.
Arguments
Outdated
| CLI mode | Library mode | Description |
|--------------------|----------------------|-----------------------------------------------------------|
| `--version` | N/A | Print the version and exit |
| `--help` | N/A | Print the help text and exit |
| `--nowarn` | `nowarn: false` | Don't issue warnings, only ID-Checklist violations |
| `--verbose` | N/A | Show more information about offending lines |
| `--nitcount` | N/A | Show a count of nits |
| `--debug` | N/A | Debug output, especially of boilerplate matching |
| `--year` | `year: 2023` | Expect the given year in the boilerplate |
| `--checklistwarn` | N/A | Only warn (no errors) for ID-Checklist violations |
| `--nonascii` | `noascii: false` | Disable warnings for non-ascii characters |
| `--submitcheck` | `submitcheck: false` | Only output errors and warnings related to 1id-guidelines |
| `--status doctype` | `status: 'doctype'` | Assume the given intended document type |
{
result: string, // either "success" or "failed"
file: {
path: string, // Path of the document
lines: Number, // Number of total lines processed
size: Number // filesize in bytes
},
issues: [
{
lines: Array<Number>, // start and end line number (starts at 1), e.g. [1,5]
message: string, // error message
ref: string, // optional link reference
level: string // either "warn" or "error"
},
...
]
}
Web UI Mockup
The library could be integrated into a web app, allowing the user to browse for a document to validate. The document would be presented in a code editor like view, with warnings / errors shown on relevant lines (either inline or on the side).
This proposal is for a rewrite of idnits in javascript, so that it can run both natively in the browser and on the server / console.
General Implementation
checkNits(opts)
, that resolves to a result object.cli.js
parses command line arguments, calls the library and output the results in a console friendly format..json
file.Distribution
As a NPM package that can be both embedded into a web application or used as a standard CLI, on any platform supported by Node.js.
Arguments
Outdated
| CLI mode | Library mode | Description | |--------------------|----------------------|-----------------------------------------------------------| | `--version` | N/A | Print the version and exit | | `--help` | N/A | Print the help text and exit | | `--nowarn` | `nowarn: false` | Don't issue warnings, only ID-Checklist violations | | `--verbose` | N/A | Show more information about offending lines | | `--nitcount` | N/A | Show a count of nits | | `--debug` | N/A | Debug output, especially of boilerplate matching | | `--year` | `year: 2023` | Expect the given year in the boilerplate | | `--checklistwarn` | N/A | Only warn (no errors) for ID-Checklist violations | | `--nonascii` | `noascii: false` | Disable warnings for non-ascii characters | | `--submitcheck` | `submitcheck: false` | Only output errors and warnings related to 1id-guidelines | | `--status doctype` | `status: 'doctype'` | Assume the given intended document type |See README.md instead.
Returns
Web UI Mockup
The library could be integrated into a web app, allowing the user to browse for a document to validate. The document would be presented in a code editor like view, with warnings / errors shown on relevant lines (either inline or on the side).
Breakdown of the Current Implementation
Original idnits SOW
idnits-SOW-00.pdf