Skip to content

Conversation

@hdinkel
Copy link

@hdinkel hdinkel commented Sep 13, 2015

Adds filter to execute magick code.

All images are created in the '_images' directory (might need to be created first)
Existing images will not be overwritten - we might want to add a command to the makefile like clean_images

The filter will not blindly execute any codeblock, but expects a key/value pair:

generate_image [True|False]

Another switch enables the automatic generation of HTML code including the tag for the generated image:

include_image [True|False]

Example CodeBlock:

~~~{generate_image=True include_image=False}
convert -size 40x20 xc:red xc:blue -append -rotate 90 append_rotate.gif
~~~

Note: Using fenced code blocks
see http://pandoc.org/README.html#fenced-code-blocks
and jgm/pandoc#673

Current limitations:

  • Image names need to be unique throughout the whole tree.
  • Complex commands, such as using perl/grep/pipes etc.
  • Will need to change image location for those examples which already explicitly include the image (ex. examples at the top of the antialising file)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these values will be boolean in nature, then I would argue them as flags, and can be classnames

 ~~~{.generate_image}
 //...code...
 ~~~

The the check would be as simple as..

if 'generate_image' in classes:
    # Do work

Base automatically changed from master to main January 22, 2021 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants