xod icon indicating copy to clipboard operation
xod copied to clipboard

As a documentation writer, I want to run CLI-renderer to convert patch saved to an SVG image

Open nkrkv opened this issue 9 years ago • 0 comments

As a documentation author, I want a command-line utility that given a path to patch JSON would provide rendered SVG file.

Patch figures are massively used for end-user documentation. It’s a pain to have a long toolset to produce that images.

The better idea is to keep example mini-patches as JSONs along with documentation source files and get them rendered automatically on documentation build.

This would also guarantee that we’ll get 1:1 visual experience between IDE and HTML docs.

Produced SVG’s must be correctly rendered by supported browsers.

Acceptance criteria

  • [ ] I can xodc render /path/to/project/patch-to-render/patch.xodp and result SVG well be rendered to stdout
  • [ ] xodc render can understand paths of shorter form /path/to/project/patch-to-render/ and /path/to/project/patch-to-render as well
  • [ ] xodc render can take --output or -o argument to output to file rather than stdout
  • [ ] Dimensions of the output are determined by bounding box of patch contents
  • [ ] The resulting SVG alone is rendered correctly in Chrome and Firefox

How to implement

  • Implement an additional build step of xod-client that would produce a single CSS for patch rendering
  • Make a ReadOnlyPatch React container that is similar to existing Patch but doesn’t attach all interactive stuff
  • In the implementation of render subcommand use that container and invoke method to render it to an SVG string
  • Inline CSS required into the SVG string
  • Output the SVG string

nkrkv avatar Jun 14 '16 10:06 nkrkv