Skip to content

[feature] I'd like to specify the order of preprocessors #1172

@JakubKoralewski

Description

@JakubKoralewski

I'm building a preprocessor, but it requires that I work on the markdown file that already has the links resolved, i.e. it should have the {{ #playpen }}, {{ #include }}, and {{ #rustdoc_include }} already resolved. I'd like to work on Markdown files that have those included files in the Markdown.

Very simply it would be awesome if I could just do:

[preprocessor.links]
[preprocessor.custom]
command = "cargo run --manifest-path=../../Cargo.toml --bin mdbook-custom"

But since this creates a toml table, it would require either:

  1. a depends key in the custom preprocessor, like so:
[preprocessor.custom]
command = "cargo run --manifest-path=../../Cargo.toml --bin mdbook-custom"
depends-on = "links"

Note that in this hypothetical solution explicitly marking the [preprocessor.links] would not be needed.

  1. Making the preprocessor into a list.
[[preprocessor]]
name = "links"
[[preprocessor]]
name = "custom"
command = "cargo run --manifest-path=../../Cargo.toml --bin mdbook-custom"

And after this configuration, each preprocessor would work on the book that has already been preprocessed by the preprocessors defined before it (if it is not the first).

If this is already possible, or a workaround exists please let me know (thx).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions