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 revision
Previous revision
pracro:post-commit-hook [2011/12/02 10:48] devapracro:post-commit-hook [2011/12/02 13:35] (current) deva
Line 22: Line 22:
 All generated resume texts must equally be available in order for the script to be able to commit data to the pcpraxis journal. All generated resume texts must equally be available in order for the script to be able to commit data to the pcpraxis journal.
 The data can therefore be made available in a preloaded map hierarchy of macros/names/value in the following manner: The data can therefore be made available in a preloaded map hierarchy of macros/names/value in the following manner:
-<code>+<code lua>
 value = vars['macro1']['name'] value = vars['macro1']['name']
 </code> </code>
 All resume texts are stored with the '''resume''' name making it possible iterate the macros and producing the complete journal text by simple concatenation. All resume texts are stored with the '''resume''' name making it possible iterate the macros and producing the complete journal text by simple concatenation.
 An important feature of this list is that the native order of the macros are the same as in the template - **NOT** sorted alphabetically or similar!. An important feature of this list is that the native order of the macros are the same as in the template - **NOT** sorted alphabetically or similar!.
-  
  
 +It is considered to read out value fields using a function instead in order to prevent setting the values:
 +<code lua>
 +value = getValue('macro1', 'name')
 +</code>
 +This method will also require a function to retrieve the macro list as well as field list from a specific macro since the above function also prevents macro iteration:
 +<code lua>
 +macrolist = getMacroList()
 +fieldlist = getFieldList('macro1')
 +</code>
 +This solution is however fairly ugly. Setting the map from the first method to read-only (or const if you will) would much be prefered.
  
 =====Script placement===== =====Script placement=====
pracro/post-commit-hook.1322819328.txt.gz · Last modified: 2011/12/02 10:48 by deva