mitar avatar mitar committed 33fc85d

Documentation improvements.

Comments (0)

Files changed (4)

-The primary author of cmsplugin-markup is Donald von Stufft <donald@xenofox.com>
+The primary author of cmsplugin-markup is Donald von Stufft <donald@xenofox.com>.
+
+Some additional features were added by Mitar <mitar.markup@tnode.com>.
 ========================
-Django CMS MarkUp
+Django CMS Markup
 ========================
 
 This is a fairly simple plugin for django-cms that allows using various markup

docs/backends.rst

         name = 'Human Readable Name for the Mark Up'
         identifier = 'Internal Identifier for Mark Up'
 
-        def parse(self, value):
+        def parse(self, value, context=None, placeholder=None):
             return value
 
 This barebones class contains all the required pieces to work. 
 
 The ``identifier`` variable is stored as a CharField and anything that is allowed in a CharField is allowed in this. It must be unique across all the installed Markup Parsers and may be at most 20 characters long.
 
-The ``parse`` function must accept self, and a value argument. This function is where you will impliment the actual parsing of the user's input. At this point in time this function should fail silently and simply return an unchanged string. This might change in the future.
+The ``parse`` function must accept self, and a value argument. It must accept also possible Django template rendering context and current placeholder. Those are given when rendering markup every time the page is displayed is enabled; to give more information about the context and location in which they are rendered. This function is where you will impliment the actual parsing of the user's input. At this point in time this function should fail silently and simply return an unchanged string. This might change in the future.
 
 There are some additional methods and a variable if markup supports adding plugins. In this case ``text_enabled_plugins`` variable should be set to ``True`` and the following methods should be defined.
 
 
 ``plugin_regexp(self)`` should return JavaScript code for anonymous function which construct plugin regexp given plugin_id. It should be marked as safe to prevent escaping.
 
+Some markups support dynamically rendered output (like macros) which could be rendered every time differently. If your markup supports this you can set ``is_dynamic`` to ``True`` and this will then give users an option to enable rendering of the content every time the page (Markup plugin) is displayed. Otherwise the content is rendered only once, when saved.
+
 Directory Layout
 ~~~~~~~~~~~~~~~~
 
-A MarkUp Backend Package should be laid out as follows
+A Markup Backend Package should be laid out as follows
 
 backend_name/
 - __init__.py
 setup(
         name='cmsplugin-markup',
         version=version.replace(' ', '-'),
-        description='Adds a plugin based MarkUp System for django-cms',
+        description='Adds a plugin based Markup System for django-cms',
         author='Xenofox, LLC',
         author_email='info@xenofox.com',
         url='http://bitbucket.org/xenofox/cmsplugin-markup',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.