User Tools

Site Tools


pracro:post-commit-hook

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
pracro:post-commit-hook [2011/12/02 08:49] devapracro:post-commit-hook [2011/12/02 10:16] deva
Line 22: Line 22:
 A single scripting section should be stored in the template file. A single scripting section should be stored in the template file.
 Scripting sections should be included from each macro file in order to the macro-specific scripts where they belong (also share if the macro is used in multiple templates). Scripting sections should be included from each macro file in order to the macro-specific scripts where they belong (also share if the macro is used in multiple templates).
 +<code xml>
 +<?xml version='1.0' encoding='UTF-8'?>
 +<template name="mytemplate" version="1.0" title="My Template" oncommit="func1()" ondiscard="func2()">
 +  <scripts>
 +    <script>
 +      function func1()
 +        -- do something useful
 +      end
 +
 +      function func2()
 +        -- do something useful
 +      end
 +    </script>
 +  </scripts>
 +  <macro name="macro1"/>
 +   .
 +   .
 +   .
 +</code>
 +
  
 =====Resume scripts===== =====Resume scripts=====
 The resume scripts cannot directly be replaced by a single on-commit script since the resumes are used dynamically while the template is being edited (to show resumes in collapsed macros). The resume scripts cannot directly be replaced by a single on-commit script since the resumes are used dynamically while the template is being edited (to show resumes in collapsed macros).
  
pracro/post-commit-hook.txt · Last modified: 2011/12/02 13:35 by deva