You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: I would like to invoke some external command every time mdoc finishes generating files while in file watching mode.
Motivation:
I use mdoc to generate typesafe markdown files, and then use pandoc to turn the markdown into html (or any other format pandoc supports). The current workflow looks like:
Thank you for reporting! I can see how this would be useful. This feature is unrelated to #245, that PR is about managing the life-cycle of custom modifiers.
finalclassEventHandlerContextprivate[mdoc] (
valworkingDirectory:Path// other useful information
)
finalclassOnWatchIterationCompleteprivate[mdoc] (
valupdatedFiles:List[Path]
)
abstractclassEventHandler {
defwithContext(params: EventHandlerContext):EventHandler=thisdefonWatchIterationComplete(params: OnWatchIterationComplete):Unit= ()
// We can add new hooks in the future as long as they have a default implementation
}
objectEventHandler {
defdefault():List[EventHandler] = default(this.getClass.getClassLoader)
defdefault(classLoader: ClassLoader):List[EventHandler] =ServiceLoader.load(classOf[EventHandler], classLoader).iterator().asScala.toList
}
The watch event can be sent to handlers around this method here
TLDR: I would like to invoke some external command every time
mdoc
finishes generating files while in file watching mode.Motivation:
I use mdoc to generate typesafe markdown files, and then use pandoc to turn the markdown into html (or any other format pandoc supports). The current workflow looks like:
coursier launch org.scalameta:mdoc_2.13:2.2.10 -- --in hello.md --out mhello.md \ && pandoc --from=markdown --to=html5 mhello.md --output=hello.html
I'd prefer to be able to leverage mdoc's file watcher mode (
--watch
) to gain the performance benefits.I had assumed this would require the life cycle code in #245 but perhaps not?
The text was updated successfully, but these errors were encountered: