-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(BuildCommand.php): add lifecycle hooks for prehtml and prepdf #14
base: master
Are you sure you want to change the base?
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