Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: docs/api/filters.md

Issue 29628724: Issue 5521 - Restructure CMS documentation to make it easier to use and extend (Closed) Base URL: https://hg.adblockplus.org/cms
Patch Set: Add initial API docs Created Dec. 13, 2017, 11:08 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | docs/api/functions.md » ('j') | docs/content/includes.md » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/api/filters.md
new file mode 100644
--- /dev/null
+++ b/docs/api/filters.md
@@ -0,0 +1,16 @@
+# Custom filters #
+The following custom filters can be used on pages:
+* `translate(default, name, comment=None)`: translates the given default string
+ and string name for the current page and locale. The string name should be
+ unique for the page but otherwise is only seen by the translators. Optionally
+ a comment (description) can be specified to help provide the translators with
+ additional context.
+* `linkify(url, locale=None, **attrs)`: generates an `<a href="...">` tag for
+ the URL. If the URL is a page name it will be converted into a link to the
+ most appropriate page language. The language used can also be specified
+ manually with the locale parameter. Any further keyword arguments passed
+ are turned into additional HTML attributes for the tag.
+* `toclist(html)`: extracts a list of headings from HTML code, this can be used
+ to generate a table of contents.
« no previous file with comments | « README.md ('k') | docs/api/functions.md » ('j') | docs/content/includes.md » ('J')

Powered by Google App Engine
This is Rietveld