Skip to content

Multipass/cascaded site compilation #71

@zor-el

Description

@zor-el

This is a feature suggestion:

It is not uncommon for markdown content to contain visualization markup, like math or graphviz/dot blocks, that would be processed in (possibly custom) Nanoc filters. It is of course possible for the filter to inject the final visual representation inline (as SVG or image data), but often enough it'd bloat the HTML page to proportions that can affect its load speed. It is often useful to generate an SVG or PNG file and refer to it in the HTML (and combine them with lazy-loading).

While this is already possible with filters, the thusly generated assets are not available as Nanoc items. (The assets can be written to disk within the filter, bypassing the Nanoc pipeline, which feels a bit like a hack. If pruning is enabled, they would be deleted upon every site compilation. A workaround is possible by saving them into a uniquely named directory and excluding it from pruning, but this feels like an even uglier hack.)

It feels like it would be cleaner to add the items programmatically (and then be able to further process them), but adding items programmatically is currently only possible in a preprocess block, i.e. before any items are processed and thus the content of such assets is still unknown.

Is a feature like enqueuing new items for compilation during a compilation pass at all thinkable / feasible @denisdefreyne? (Or are there simpler and already existing ways to accomplish this that I don't know of?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions