maxitg / SetReplace

C++/Wolfram Language package for exploring set and graph rewriting systems
MIT License
216 stars 43 forks source link

Introduce rasterization functions to DevUtils #535

Closed taliesinb closed 3 years ago

taliesinb commented 3 years ago

These are:

They have a variety of options (including the max width of image after which to line break, the magnification, and details about compression).

The rasterization workflow is documented in CONTRIBUTING.md.

Here's an example of RasterizePreviousInputOutputAndExportToMarkdown being used (with the DryRun option given to make the example easier to see):

PixelSnap 2020-11-30 at 16.56.50@2x.png/Users/taliesinb/Library/Application Support/PixelSnap/media/PixelSnap 2020-11-30 at 16.56.50@2x.png

This shows the behavior when the input cannot be stringified:

PixelSnap 2020-11-30 at 16.56.12@2x.png /Users/taliesinb/Library/Application Support/PixelSnap/media/PixelSnap 2020-11-30 at 16.56.12@2x.png

This shows the behavior of RasterizePreviousOutputAndExportToMarkdown:

PixelSnap 2020-11-30 at 16.57.23@2x.png/Users/taliesinb/Library/Application Support/PixelSnap/media/PixelSnap 2020-11-30 at 16.57.23@2x.png

This shows the behavior of RasterizeExpressionAndExportToMarkdown:

PixelSnap 2020-11-30 at 16.58.11@2x.png/Users/taliesinb/Library/Application Support/PixelSnap/media/PixelSnap 2020-11-30 at 16.58.11@2x.png


This change is Reviewable

taliesinb commented 3 years ago

@daneelsan that worked because I was manually attaching the cell label myself. But I couldn't do that accurately enough (e.g. the baselines for Out[] was wrong in general). I thought that Rasterize[Notebook[..]] would just do all of that stuff for me, but apparently it doesn't work on Linux. I'll try add that code back to support Linux as soon as I can.