Skip to content

Feature Request: on_cleanup event type #2971

@steven-terrana

Description

@steven-terrana

Hello,

I'm working on a plugin that creates temporary files that should be cleaned up at the end.
i'm having an issue caused by on_post_build firing multiple times (as it should) during mkdocs serve.
I'd like to propose an on_cleanup event type that runs once and only once at the end of either mkdocs build or mkdocs serve.

i'm happy to take a shot at implementing this first but would like some feedback on the idea before i try.

alternatives considered

If i was able to determine the cli command that was executed (i.e., is this a build or a serve) within my implementation of BasePlugin then i'd have a suitable workaround - but i'm not seeing a way to cleanly determine this information.

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