feat(BuildCommand.php): add lifecycle hooks for prehtml and prepdf#14
feat(BuildCommand.php): add lifecycle hooks for prehtml and prepdf#14bmcminn wants to merge 1 commit intothemsaid:masterfrom
Conversation
|
I think it's better if you don't have to define global functions. Just include a closure in the config file to be invoked within the build command. Also can you please include an example of how you're using both callbacks in a real scenario? |
|
Yeah it's not ideal. Reason I went this route was because the method signature for I think it makes more sense to make As for an example: function prehtml($markdown) {
// remove frontmatter/comments/notes/etc
$markdown = preg_replace("/-----/", '<hr>', $markdown); // convert horizontal rules first
$markdown = preg_replace("/---[\s\S]*?---/", '', $markdown); // strip frontmatter content blocks
$markdown = preg_replace("/\/\/[\s\S]+?\n/", '', $markdown); // strip inline C-style comments
return $markdown;
}The It also gives people a place to initialize content plugins at will, so my comment stripper could become a |
a04cdf9 to
332ed57
Compare
|
I think that's the final version of this feature. To recap, I moved the So far I'm pretty happy with how this turned out. |
Adds optional user defined functions to ibis.php that allows users to modify content Fixes themsaid#13
|
I think this feature is in pretty good shape for final review. |
|
@themsaid any thoughts on accepting this PR? |
|
@themsaid *bump |
Adds user editable functions to ibis.php that allows users to modify
content via global event hook callbacks.
Fixes issue #13