GetPublii / Publii

The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
https://getpublii.com
GNU General Public License v3.0
6.06k stars 407 forks source link

Is there any documentation on plugin development? Need help with addInsertions and addModifiers #1279

Open reedjones opened 8 months ago

reedjones commented 8 months ago

I've been looking for documentation on plugin development, haven't found any. Does it exist? If not, is this something that's planned? I would be willing to contribute.

I posted a question on the forums that I'll repost here:

Looking at some of the example we have API.addInsertions, API.addEvents, and API.addModifiers 

When to use which? 

In the following code we see addInsertion with 'customCommentsCode' as the first argument, where :

this.API.addInsertion('customCommentsCode', this.addPostScripts, 1, this);

Some other examples:


this.API.addInsertion('publiiHead', this.addStyles, 1, this);
this.API.addInsertion('publiiFooter', this.addScripts, 1, this);

The parameters to addInsertion are: place, callback, priority, pluginInstance

So above 'publiiHead' is a place

I guess one question is what/where are these places? Can we stick any value in there? etc... 

The same goes for addModifiers

this.API.addModifier('postText', this.addDecodingAttribute, 1, this);

In this code how do we know that 'postText' is a valid value, is there a list or something somewhere?

Thank you!

atomGit commented 8 months ago

apparently there's no documentation yet

WishesofHue commented 3 months ago

Heads up, there has been a WIP version since Feb. https://github.com/GetPublii/Publii/discussions/1359