-
Notifications
You must be signed in to change notification settings - Fork 208
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
Command line renderer #27
Comments
I have looked into this since I had the same idea. The first step to reach this goal has already been completed when nomnoml was made into a standalone library. However, to render images you can't rely only on node. You would need to run the code in an environment with a graphical context (with support specifically for the canvas api), such as phantomjs. But making the core nomnoml depend on phantomjs just to support command line rendering is probably not a good idea. A better way would be to create another package that brings phantomjs and nomnoml together, something like nomnoml-phantomjs-renderer. When time allows this is probably something I'll pursue, unless someone beats me to it, hehe. |
Took a poke at doing this with canvas ...
But hit:
Not sure what to make of this exactly, except that it seems some work is required to get nomnoml to run under plain node. phantomjs may be a path of less resistance. |
I realized I can get around that problem by tweaking little I think there might be some small changes to nomnoml that would eliminate the need for this workaround when running under node, but for the time being the approach above is sufficient to my needs. I agree with @korroz that the command-line renderer makes more sense as a separate package using nomnoml, as opposed to a modification to nomnoml, so I'll go ahead and close this. |
@VWoeltjen Nice one! When I made sure nomnoml could be |
Would it be possible to get a node command line interface for rendering nomnoml files?
It would be great to be able to:
...or similar.
My use case is that I'd like to be able to keep plain-text versions of diagrams under version control, and render these to image files as part of an npm build process to generate documentation. I'd love to use nomnoml for this purpose, as the rendering and syntax are quite nice compared to the few alternatives I've seen.
The text was updated successfully, but these errors were encountered: