opts
, a simple object containing any options that the event providesnext
, a completion callbacknext
callback is perfectly valid (even encouraged) if you're using DocPad in your own synchronous code. (Of course, you're free to write in whatever style works best for you! If you enjoy coding in the asynchronous style, the next
callback is available for you.)events
property.docpad.coffee
configuration file. Binding to the serverExtend
event would look like so:this
/@
points to) of event handlers is a shared object between the event handlers that contains only the docpad instance variable.render
event to render from one extension to the other would look like so:this
/@
points to) of event handlers in your plugin will be your plugin's instance.extendCollections
extendTemplateData
templateData
the object to inject your additions todocpadLoaded
docpadReady
as we have to load the configuration in order to be ready.docpadReady
docpadDestroy
event.consoleSetup
consoleInterface
the console interface instance we are usingpopulateCollectionsBefore
generateBefore
event. Partnered with the populateCollections
event.populateCollections
generateBefore
event. Partnered with the populateCollectionsBefore
event.generateBefore
generateAfter
event.reset
whether or not this is a partial- (false
) or full-regeneration (true
)server
Deprecated; use getServer()
API method insteadparseBefore
parseAfter
conextualizeBefore
contextualizeAfter
event. Contextualizing is the process of adding layouts and awareness of other documents to our document.collection
the collection we are working withtemplateData
Deprecated; use extendTemplateData
event insteadcontextualizeAfter
conextualizeBefore
event. Contextualizing is the process of adding layouts and awareness of other documents to our document.collection
the collection we are working withtemplateData
Deprecated; use extendTemplateData
event insteadrenderBefore
renderAfter
event.templateData
the template data that will be provided to the documentsrenderCollectionBefore
renderPass
which render pass is this render collection for?renderCollectionAfter
renderPass
which render pass is this render collection for?render
inExtension
the extension we are rendering fromoutExtension
the extension we are rendering totemplateData
the template data that we will use for this document's renderingfile
the model instance for the document we are renderingcontent
the current content that this document contains, you shall overwrite this option with any updates you doblah.html.md.eco
will call trigger this event twice. The first time for the eco
to md
conversion. The second time for the md
to html
conversion.inExtension
and outExtension
options to make sure we only apply our rendering for the desired extension conversions. To apply the rendering, we would write our result back to opts.content
. For example here is a render event handler that will convert the content of files to upper case when named like file.txt.captialize|uppercase|upper
:renderDocument
extension
the resulted extension for our documenttemplateData
the template data that we will use for this document's renderingfile
the model instance for the document we are renderingcontent
the current content that this document contains, you shall overwrite this option with any updates you do<code>
HTML elements that have the CSS class highlight
(e.g., <code class="highlight">
) and replaces the element with one that has been syntax highlighted by the popular pygments syntax highlighting engine.renderAfter
renderBefore
event.writeBefore
writeAfter
event.templateData
the template data that was provided to the documentswriteAfter
writeBefore
event.generateAfter
generateBefore
event.generated
serverBefore
serverAfter
event.serverExtend
serverHttp
is the raw Node.js HTTP server we are usingexpress
is the Express module we are usingserverAfter
serverHttp
is the raw Node.js HTTP server we are usingexpress
is the Express module we are usingdocpadDestroy
docpadReady
event.