Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to the commonJS command line API #7

Closed
fred-wang opened this issue Jan 23, 2014 · 3 comments
Closed

Enhancements to the commonJS command line API #7

fred-wang opened this issue Jan 23, 2014 · 3 comments

Comments

@fred-wang
Copy link
Owner

Currently, the commonJS API only exposes the getTeXSource, toMathMLString and toMathML functions. When commonJS is more standardized it would be useful to extend the API. Concrete use cases:

  • allow to use TeXZilla as a stream filter.
  • allow to run TeXZilla as a Web service.

http://wiki.commonjs.org/wiki/System/1.0
http://wiki.commonjs.org/wiki/JSGI

@fred-wang
Copy link
Owner Author

I've added a basic command line interface.

slimerjs TeXZilla.js parser aTeX [aDisplay] [aRTL] [aThrowExceptionOnError]
  Print TeXZilla.toMathMLString(aTeX, aDisplay, aRTL, aThrowExceptionOnError)
  The interpretation of arguments and the default values are the same.

slimerjs TeXZilla.js webserver [port]
  TODO

cat input | slimerjs TeXZilla.js stream > output
  TODO

@fred-wang
Copy link
Owner Author

The interface is now:

  commonjs TeXZilla.js [help]
    Print this help message.

  commonjs TeXZilla.js parser aTeX [aDisplay] [aRTL] [aThrowExceptionOnError]
    Print TeXZilla.toMathMLString(aTeX, aDisplay, aRTL, aThrowExceptionOnError)
    The interpretation of arguments and the default values are the same.

  commonjs TeXZilla.js webserver [port]
    Start a Web server on the specified port (default:3141)
    See the TeXZilla wiki for details.

  cat input | commonjs TeXZilla.js streamfilter > output
    Make TeXZilla behaves as a stream filter. The TeX fragments are
    converted into MathML.

    where commonjs is slimerjs, nodejs or phantomjs.

However, I didn't find how to access the stdin with slimerJS so the streamfilter mode does not work (this has been reported to laurentj/slimerjs#188).

@fred-wang
Copy link
Owner Author

The command line is now implemented. I'm moving the issue with slimerjs to #35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant