{"id":18645454,"url":"https://github.com/cscott/texvcjs","last_synced_at":"2025-04-11T12:31:22.474Z","repository":{"id":18900206,"uuid":"22118431","full_name":"cscott/texvcjs","owner":"cscott","description":"A LaTeX validator/translator for TeX strings embedded in wikitext","archived":false,"fork":false,"pushed_at":"2024-06-12T06:11:30.000Z","size":23599,"stargazers_count":3,"open_issues_count":4,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T13:51:10.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cscott.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-22T19:53:51.000Z","updated_at":"2023-01-29T04:44:09.000Z","dependencies_parsed_at":"2023-01-14T00:45:33.043Z","dependency_job_id":null,"html_url":"https://github.com/cscott/texvcjs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cscott%2Ftexvcjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cscott%2Ftexvcjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cscott%2Ftexvcjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cscott%2Ftexvcjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cscott","download_url":"https://codeload.github.com/cscott/texvcjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247965208,"owners_count":21025340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:15:58.431Z","updated_at":"2025-04-11T12:31:21.286Z","avatar_url":"https://github.com/cscott.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# texvcjs\n[![NPM][NPM1]][NPM2]\n\n[![Build Status][1]][2] [![dependency status][3]][4] [![dev dependency status][5]][6]\n\nA TeX/LaTeX validator.\n\n`texvcjs` takes user input and validates it while replacing\nMediaWiki-specific functions.  It is a JavaScript port of [texvc],\nwhich was originally written in [OCaml] for the [Math extension].\n\nThe `texvcjs` library was originally written to be used by the\n[mw-ocg-latexer] PDF-generation backend of the mediawiki\n[Collection extension].\n\n## Installation\n\nNode version 0.8 and 0.10 are tested to work.\n\nInstall the node package dependencies with:\n```\nnpm install\n```\nEnsure everything works:\n```\nnpm test\n```\n\n## Running\n\nTo test your installation:\n```sh\nbin/texvcjs '\\sin(x)+{}{}\\cos(x)^2 newcommand'\n```\nwhich should emit:\n```\n+\\sin(x)+{}{}\\cos(x)^{2}newcommand\n```\n\n## API\n\nYour programs can also use the JavaScript API exported by the\n`texvcjs` node module:\n```js\nvar texvcjs = require('texvcjs');\n\nvar result = texvcjs.check('\\\\sin(x)+{}{}\\\\cos(x)^2 newcommand');\nconsole.log(result.status);\nconsole.log(result.output || ''); // cleaned/validated output\n```\n\nIf the `output` field is not `undefined`, then validation was successful.\n\nThe `status` field is a single character:\n* `+`: Success! The result is in the `output` field.\n* `F`: A TeX function was not recognized.  The function name is in the\n  `details` field.\n* `S`: A parsing error occurred.\n* `-`: Some other problem occurred.\n\nFor status types `F`, `S`, and `-`, the position of the error may be found\nin the `line`, `column` and `offset` fields of the result.  More information\nabout the problem can be found in the `details` field of the result, which\nis a string.\n\nThe fields `ams_required`, `cancel_required`, `color_required`,\n`euro_required`, and `teubner_required` are set to `true` iff the input\nstring requires the use of the corresponding [LaTeX packages].\nThe `ams_required` field requires the use of the `amsmath` and `amssymb`\npackages.\n\n### Low-level API\n\nThe low level parser, abstract syntax tree (AST), and renderer are also\nexported from the module.  This allows you to define more interesting\nqueries on the input source.  An example can be found in `lib/astutil.js`\nwhich defines a visitor function to test for the presence of specific\nTeX functions in the input.\n\n## License\n\nCopyright (c) 2014 C. Scott Ananian\n\nLicensed under GPLv2.\n\n[mw-ocg-latexer]: https://github.com/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer\n[texvc]: https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/REL1_23/texvccheck%2FREADME\n[Math extension]: https://www.mediawiki.org/wiki/Extension:Math\n[Collection extension]: https://www.mediawiki.org/wiki/Extension:Collection\n[OCaml]: https://ocaml.org/\n[LaTeX packages]: http://www.ctan.org/\n\n[NPM1]: https://nodei.co/npm/texvcjs.svg\n[NPM2]: https://nodei.co/npm/texvcjs/\n\n[1]: https://travis-ci.org/cscott/texvcjs.svg\n[2]: https://travis-ci.org/cscott/texvcjs\n[3]: https://david-dm.org/cscott/texvcjs.svg\n[4]: https://david-dm.org/cscott/texvcjs\n[5]: https://david-dm.org/cscott/texvcjs/dev-status.svg\n[6]: https://david-dm.org/cscott/texvcjs#info=devDependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscott%2Ftexvcjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcscott%2Ftexvcjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscott%2Ftexvcjs/lists"}