Skip to content

Commit

Permalink
doc: document the new zotonic-tpl-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kaos committed Dec 6, 2012
1 parent 2d44ea6 commit e8a92be
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion doc/dev/codestyle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,28 @@ of the Erlang world.
Indenting templates
-------------------

Provided with the Zotonic distribution is a Zotonic template mode,
``zotonic-tpl-mode``, which supports the Zotonic flavor of ErlyDtl.
It is located in the :file:`priv/emacs/zotonic-tpl-mode.el` file, and
may be installed in emacs by adding something like this to your `.emacs`
file::

(setq load-path (cons ".../path/to/zotonic/priv/emacs" load-path))
(require 'zotonic-tpl-mode)
;; optional, for associating .tpl files with zotonic-tpl-mode
(setq auto-mode-alist (append
'(("\\.tpl$" . zotonic-tpl-mode)) auto-mode-alist))


Hint when using the m.rsc model
...............................

A common style and shorthand techniques make templates from multiple
authors more alike. This makes them easier to maintain and share in a
team or with the community.

When the template sees that you request a property of an integer then
it assumes that the integer is a m.rsc id. This makes templates more
it assumes that the integer is a ``m.rsc`` `id`. This makes templates more
readable.

Example::
Expand Down

0 comments on commit e8a92be

Please sign in to comment.