plugins
(i.e. yourwebsite/plugins
)yourwebsite/plugins/yourpluginname
)package.json
file is that our plugin starts with the version 2.0.0
. This is because v2 plugins are compatible for with DocPad v6, whereas v1 plugins are compatible with DocPad v5. This is currently a necessary convention that you must follow.​source/index.coffee
file is the logic for our plugin. It's current contents will uppercase all documents with .uc
or .uppercase
extension. The simplest form of this file (which wouldn't perform anything) would be:BasePlugin.extend({})
method like so:render
event. A plugin can hook into this event by adding the render
function inside it.document.html.md.eco
will have two render events fire. The first render event will contain the inExtension
as eco
, and the outExtension
as md
. The second render event will contain the inExtension
as md
, and the outExtension
as html
. This is why generally in our plugins we want to check the values of inExtension
and outExtension
to make sure our plugin is performing the correct render.render
event to trigger their behaviour other plugin types use a variety of events such as writeBefore
and parseAfter
to alter the creation of documents and add additional functionality. Click here for more information on event types​src
src/yourpluginname.plugin.coffee
package.json
README.md
package.json
file with the new values, you would want to run npm run our:release:prepare
which will also compile your plugin's meta files with projectz, which is very useful for automatically updating your README.md
and LICENSE.md
files with the latest details for your package.json
file.RendererTester
which by default runs your plugin against a folder of documents and compares the output to the contents of the out-expected
folder. This is all you'll need for most plugins as we're only really concerned about the input and output of our plugins.RendererTester
will setup an instance of DocPad using the configuration specified in your tester above, it will then generate a site using the documents in the test/source/render
folder and compare the results with the files in the test/out-expected
folder. This way you can quickly and easily test how documents in a site are handled by your plugin.npm owner add bevryme
in your plugin directory to give the DocPad Core Team publishing rights