npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

texvcjs

v0.3.1

Published

A TeX/LaTeX validator for mediawiki.

Downloads

4

Readme

texvcjs

NPM

Build Status dependency status dev dependency status

A TeX/LaTeX validator.

texvcjs takes user input and validates it while replacing MediaWiki-specific functions. It is a JavaScript port of texvc, which was originally written in ocaml for the Math extension.

The texvcjs library was originally written to be used by the mw-ocg-latexer PDF-generation backend of the mediawiki Collection extension.

Installation

Node version 0.8 and 0.10 are tested to work.

Install the node package depdendencies with:

npm install

Ensure everything works:

npm test

Running

To test your installation:

bin/texvcjs '\sin(x)+{}{}\cos(x)^2 newcommand'

which should emit:

+\sin(x)+{}{}\cos(x)^{2}newcommand

API

Your programs can also use the JavaScript API exported by the texvcjs node module:

var texvcjs = require('texvcjs');

var result = texvcjs.check('\\sin(x)+{}{}\\cos(x)^2 newcommand');
console.log(result.status);
console.log(result.output || ''); // cleaned/validated output

If the output field is not undefined, then validation was successful.

The status field is a single character:

  • +: Success! The result is in the output field.
  • F: A TeX function was not recognized. The function name is in the details field.
  • S: A parsing error occurred.
  • -: Some other problem occurred.

For status types F, S, and -, the position of the error may be found in the line, column and offset fields of the result. More information about the problem can be found in the details field of the result, which is a string.

The fields ams_required, cancel_required, color_required, euro_required, and teubner_required are set to true iff the input string requires the use of the corresponding LaTeX packages. The ams_required field requires the use of the amsmath and amssymb packages.

Low-level API

The low level parser, abstract syntax tree (AST), and renderer are also exported from the module. This allows you to define more interesting queries on the input source. An example can be found in lib/astutil.js which defines a visitor function to test for the presence of specific TeX functions in the input.

License

Copyright (c) 2014 C. Scott Ananian

Licensed under GPLv2.