Changeset 540
- Timestamp:
- 2007-05-19 11:51:09 (2 years ago)
- Files:
-
- trunk/app/controllers/nodes_controller.rb (modified) (1 diff)
- trunk/app/controllers/versions_controller.rb (modified) (1 diff)
- trunk/app/models/image.rb (modified) (1 diff)
- trunk/db/init/base/skins/default/Contact.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_admin_layout.html (modified) (3 diffs)
- trunk/db/init/base/skins/default/Node_index.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_login.html (modified) (3 diffs)
- trunk/db/init/base/skins/default/Node_not_found.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_popup_layout.html (modified) (2 diffs)
- trunk/db/init/base/skins/default/Node_search.html (modified) (2 diffs)
- trunk/db/init/base/skins/default/Node_tree.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Project.html (modified) (1 diff)
- trunk/db/init/base/skins/default/layout.html (modified) (3 diffs)
- trunk/db/init/base/skins/default/notes.html (modified) (2 diffs)
- trunk/lib/parser/lib/rules/code_syntax.rb (modified) (1 diff)
- trunk/lib/parser/lib/rules/zafu.rb (modified) (3 diffs)
- trunk/lib/parser/lib/rules/zena.rb (modified) (5 diffs)
- trunk/lib/parser/test/zafu.yml (modified) (11 diffs)
- trunk/lib/parser/test/zafu_asset.yml (modified) (1 diff)
- trunk/lib/parser/test/zafu_insight.yml (modified) (1 diff)
- trunk/test/fixtures/versions.yml (modified) (6 diffs)
- trunk/test/helpers/basic.yml (modified) (28 diffs)
- trunk/test/helpers/relations.yml (modified) (12 diffs)
- trunk/test/helpers/zafu_ajax.yml (modified) (3 diffs)
- trunk/test/helpers/zena_parser_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/nodes_controller.rb
r530 r540 131 131 # store the id used to preview versions 132 132 session[:preview_id] = params[:preview_id] if params[:preview_id] 133 @title_for_layout = @node.rootpath 133 134 end 134 135 format.js do trunk/app/controllers/versions_controller.rb
r527 r540 61 61 # store the id used to preview when editing 62 62 session[:preview_id] = params[:node_id] 63 @title_for_layout = @node.rootpath 63 64 @edit = true 64 65 end trunk/app/models/image.rb
r518 r540 47 47 48 48 Same example in a zafu template: 49 < z:img src='icon' format='pv'/>49 <r:img src='icon' format='pv'/> 50 50 51 51 or to create a link to the article using the icon: 52 < z:img src='icon' format='pv' href='self'/>52 <r:img src='icon' format='pv' href='self'/> 53 53 54 54 =end trunk/db/init/base/skins/default/Contact.html
r480 r540 1 < z:include template='layout.html'>2 < z:with part='body/container/content/main'>1 <r:include template='layout.html'> 2 <r:with part='body/container/content/main'> 3 3 <h1 do='title' attr='c_fullname' actions='all'>Gaspard Bucher</h1> 4 </ z:with>5 </ z:include>4 </r:with> 5 </r:include> trunk/db/init/base/skins/default/Node.html
r518 r540 1 < z:include template='layout.html'>2 < z:with part='body/container/context'>3 < z:project>1 <r:include template='layout.html'> 2 <r:with part='body/container/context'> 3 <r:project> 4 4 <h2 do='show' attr='name'>zena</h2> 5 < z:icon store='project'>6 < z:img id='project_icon' mode='side' link='stored_project'/>7 < z:else>5 <r:icon store='project'> 6 <r:img id='project_icon' mode='side' link='stored_project'/> 7 <r:else> 8 8 <div class='header'> 9 9 <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 10 10 </div> 11 < z:summary or='v_text'/>12 </ z:else>13 </ z:icon>14 </ z:project>15 </ z:with>16 < z:with part='body/container/content/main'>11 <r:summary or='v_text'/> 12 </r:else> 13 </r:icon> 14 </r:project> 15 </r:with> 16 <r:with part='body/container/content/main'> 17 17 <div class='header'> 18 18 <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 19 19 <div class='subtitle'> 20 < z:case>21 < z:when test='[user_id] == [v_user_id]'>22 < z:trans>posted by</z:trans> <b do='author' do='show' attr='fullname'>Super Man</b>23 </ z:when>24 < z:else>25 < z:trans>original by</z:trans> <b do='show' attr='fullname'>Platon</b>26 < z:trans>modified by</z:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b>27 </ z:else>28 </ z:case>20 <r:case> 21 <r:when test='[user_id] == [v_user_id]'> 22 <r:trans>posted by</r:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 23 </r:when> 24 <r:else> 25 <r:trans>original by</r:trans> <b do='show' attr='fullname'>Platon</b> 26 <r:trans>modified by</r:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 27 </r:else> 28 </r:case> 29 29 </div> 30 30 </div> 31 31 32 < z:summary text=''/>33 < z:text/>32 <r:summary text=''/> 33 <r:text/> 34 34 <!-- FIXME: comments --> 35 </ z:with>36 </ z:include>35 </r:with> 36 </r:include> trunk/db/init/base/skins/default/Node_admin_layout.html
r531 r540 1 <z:include template='layout.html'> 2 <z:with part='head/stylesheets' do='stylesheets' list='zen,comment,admin,search'/> 1 <r:include template='layout.html'> 2 <r:with part='head/stylesheets'> 3 <r:stylesheets list='zen,comment,admin,search'/> 4 <link href="default.css" rel="Stylesheet" type="text/css"/> 5 </r:with> 3 6 4 < z:with part='body/container'>7 <r:with part='body/container'> 5 8 <div id='context' do='void' name='context'> 6 9 <ul> … … 8 11 </ul> 9 12 </div> 10 < z:content_for_layout>13 <r:content_for_layout> 11 14 <div id='content' do='void' name='content'> 12 15 <div id='main' do='void' name='main'> 13 <h2>< z:trans>home of</z:trans> <z:user do='show' attr='fullname'>Panther Tigris</z:user></h2>16 <h2><r:trans>home of</r:trans> <r:user do='show' attr='fullname'>Panther Tigris</r:user></h2> 14 17 </div> 15 18 16 19 <div id='related' do='void' name='related'> 17 20 <ul class='actions' do='user'> 18 <li do='to_publish'>< z:trans>to publish</z:trans>21 <li do='to_publish'><r:trans>to publish</r:trans> 19 22 <ul class='list'> 20 <li do='each' set_class='li_s[status]'>< z:link attr='title'>title</z:show></li>23 <li do='each' set_class='li_s[status]'><r:link attr='title'>title</r:show></li> 21 24 </ul> 22 25 </li> 23 <li do='comments_to_publish'>< z:trans>comments to publish</z:trans>26 <li do='comments_to_publish'><r:trans>comments to publish</r:trans> 24 27 <ul class='list'> 25 <li do='each'>< z:show attr='title'>title</z:show></li>28 <li do='each'><r:show attr='title'>title</r:show></li> 26 29 </ul> 27 30 </li> 28 <li do='proposed'>< z:trans>waiting for publication</z:trans>31 <li do='proposed'><r:trans>waiting for publication</r:trans> 29 32 <ul class='list'> 30 <li do='each'>< z:show attr='title'>title</z:show></li>33 <li do='each'><r:show attr='title'>title</r:show></li> 31 34 </ul> 32 35 </li> 33 <li do='redactions'>< z:trans>redactions</z:trans>36 <li do='redactions'><r:trans>redactions</r:trans> 34 37 <ul class='list'> 35 <li do='each' set_class='li_s[status]'>< z:link attr='title'>title</z:show></li>38 <li do='each' set_class='li_s[status]'><r:link attr='title'>title</r:show></li> 36 39 </ul> 37 40 </li> … … 39 42 </div> 40 43 </div> 41 </ z:content_for_layout>42 </ z:with>43 </ z:include>44 </r:content_for_layout> 45 </r:with> 46 </r:include> trunk/db/init/base/skins/default/Node_index.html
r471 r540 1 < z:include template='Project.html'/>1 <r:include template='Project.html'/> trunk/db/init/base/skins/default/Node_login.html
r523 r540 1 < z:include template='layout.html'>2 < z:with part='head'>1 <r:include template='layout.html'> 2 <r:with part='head'> 3 3 <title do='title_for_layout' do='trans'>login</title> 4 4 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 5 5 <meta http-equiv="Content-Language" do='void' content="fr-fr" tset_content='[v_lang]_content' /> 6 6 7 < z:stylesheets name='stylesheets' list='reset,zena,code'/>7 <r:stylesheets name='stylesheets' list='reset,zena,code'/> 8 8 9 < z:javascripts list='prototype,effects,zena'/>10 < z:uses_calendar/>9 <r:javascripts list='prototype,effects,zena'/> 10 <r:uses_calendar/> 11 11 <style> 12 12 /* login, not found */ … … 59 59 .search p { font-size:0.85em; } 60 60 </style> 61 </ z:with>62 < z:with part='body/navigation/menu'/>63 < z:with part='body/container'>61 </r:with> 62 <r:with part='body/navigation/menu'/> 63 <r:with part='body/container'> 64 64 <div id='login_form'><div> 65 65 <form action="/session" method="post"> <table> … … 76 76 </table> 77 77 </form></div></div> 78 </ z:with>79 < z:with part='body/siteinfo'/>80 </ z:include>78 </r:with> 79 <r:with part='body/siteinfo'/> 80 </r:include> trunk/db/init/base/skins/default/Node_not_found.html
r489 r540 1 < z:include template='layout.html'>2 < z:with part='body/navigation/menu'/>3 < z:with part='body/container'>1 <r:include template='layout.html'> 2 <r:with part='body/navigation/menu'/> 3 <r:with part='body/container'> 4 4 <div id="not_found"><div> 5 <p><b>< z:trans>Sorry, the requested page could not be found.</z:trans></b></p>6 <p>< z:trans>Please go </z:trans><a do='link' href='root' do='trans'>home</a>,7 <a onclick="history.go(-2)" href="#">< z:trans>back</z:trans></a>8 < z:trans>or</z:trans> <a href="/login" do='trans'>login</a>5 <p><b><r:trans>Sorry, the requested page could not be found.</r:trans></b></p> 6 <p><r:trans>Please go </r:trans><a do='link' href='root' do='trans'>home</a>, 7 <a onclick="history.go(-2)" href="#"><r:trans>back</r:trans></a> 8 <r:trans>or</r:trans> <a href="/login" do='trans'>login</a> 9 9 </p> 10 10 </div></div> 11 </ z:with>12 </ z:include>11 </r:with> 12 </r:include> trunk/db/init/base/skins/default/Node_popup_layout.html
r517 r540 8 8 <meta http-equiv="Content-Language" content="fr-fr" /> 9 9 10 < z:stylesheets list='popup,zena,search'/>11 < z:javascripts list='prototype,effects,dragdrop,zena'/>10 <r:stylesheets list='popup,zena,search'/> 11 <r:javascripts list='prototype,effects,dragdrop,zena'/> 12 12 <script type="text/javascript" charset="utf-8"> 13 13 // <![CDATA[ … … 16 16 // ]]> 17 17 </script> 18 < z:uses_calendar/>18 <r:uses_calendar/> 19 19 </head> 20 20 21 21 <body onLoad='popup_loaded();'> 22 22 <div id='messages'> 23 <div id='loader'><img src='/images/ajax-loader.gif'/> < z:trans text='uploading'/></div>23 <div id='loader'><img src='/images/ajax-loader.gif'/> <r:trans text='uploading'/></div> 24 24 </div> 25 25 26 < z:content_for_layout/>26 <r:content_for_layout/> 27 27 28 28 </body> trunk/db/init/base/skins/default/Node_search.html
r530 r540 1 < z:include template='layout.html'>2 < z:with part='body/container/context'/>1 <r:include template='layout.html'> 2 <r:with part='body/container/context'/> 3 3 4 < z:with part='body/container/content/main'>4 <r:with part='body/container/content/main'> 5 5 6 6 <h2 do=trans>search results</h2> … … 8 8 <ul id='search_results' do='search_results'> 9 9 <li class='result_entry' do='each'> 10 <p class='result_image'>< z:img mode='pv'/></p>11 <p class='result_name'><em>< z:show attr='score' format='%.1f'/>%</em> <z:link/></p>12 <p class='result_path'>< z:show attr='rootpath'/></p>13 < z:summary/>10 <p class='result_image'><r:img mode='pv'/></p> 11 <p class='result_name'><em><r:show attr='score' format='%.1f'/>%</em> <r:link/></p> 12 <p class='result_path'><r:show attr='rootpath'/></p> 13 <r:summary/> 14 14 <div class='clear'></div> 15 15 </li> 16 < z:else>16 <r:else> 17 17 <p do='trans'>no result found</p> 18 </ z:else>18 </r:else> 19 19 </ul> 20 </ z:with>21 </ z:include>20 </r:with> 21 </r:include> trunk/db/init/base/skins/default/Node_tree.html
r500 r540 1 < z:include template='layout.html'>2 < z:with part='body/navigation/menu'/>1 <r:include template='layout.html'> 2 <r:with part='body/navigation/menu'/> 3 3 4 < z:with part='body/container/content/main'>4 <r:with part='body/container/content/main'> 5 5 <div class='header'><h1 do='title' class='s30' status='true' actions='all'>this is the title</h1></div> 6 6 <ul class='tree' do='nodes'> 7 <li class='parent' do='parent'>< z:title actions='all' link='tree'/></li>8 <li class='current'>< z:show attr='name'/></li>9 <li do='each'>< z:show attr='name' edit='true'/>7 <li class='parent' do='parent'><r:title actions='all' link='tree'/></li> 8 <li class='current'><r:show attr='name'/></li> 9 <li do='each'><r:show attr='name' edit='true'/> 10 10 <ul do='nodes' name='tree'> 11 11 <li do='each'> 12 < z:link mode='tree' attr='name'/>12 <r:link mode='tree' attr='name'/> 13 13 </li> 14 14 </ul> 15 15 </li> 16 16 </ul> 17 </ z:with>17 </r:with> 18 18 19 </ z:include>19 </r:include> trunk/db/init/base/skins/default/Project.html
r532 r540 1 < z:include template='layout.html'>2 < z:with part='body/container/context'>1 <r:include template='layout.html'> 2 <r:with part='body/container/context'> 3 3 <div id='small_calendar' do='calendar'/> 4 < z:hot>4 <r:hot> 5 5 <div class='header'> 6 6 <h2 do='title' actions='all'>hot news</h2> 7 7 <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 8 8 </div> 9 < z:summary or='v_text'/>10 </ z:hot>11 </ z:with>12 < z:with part='body/container/content/main'>9 <r:summary or='v_text'/> 10 </r:hot> 11 </r:with> 12 <r:with part='body/container/content/main'> 13 13 14 < z:home>14 <r:home> 15 15 <div class='header'> 16 16 <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 17 17 <div class='subtitle'> 18 < z:case>19 < z:when test='[user_id] == [v_user_id]'>20 < z:trans>posted by</z:trans> <b do='author' do='show' attr='fullname'>Super Man</b>21 </ z:when>22 < z:else>23 < z:trans>original by</z:trans> <b do='show' attr='fullname'>Platon</b>24 < z:trans>modified by</z:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b>25 </ z:else>26 </ z:case>18 <r:case> 19 <r:when test='[user_id] == [v_user_id]'> 20 <r:trans>posted by</r:trans> <b do='author' do='show' attr='fullname'>Super Man</b> 21 </r:when> 22 <r:else> 23 <r:trans>original by</r:trans> <b do='show' attr='fullname'>Platon</b> 24 <r:trans>modified by</r:trans> <b do='version' do='author' do='show' attr='fullname'>Socrate</b> 25 </r:else> 26 </r:case> 27 27 </div> 28 28 </div> 29 29 30 < z:summary text=''/>31 < z:text/>32 < z:else>30 <r:summary text=''/> 31 <r:text/> 32 <r:else> 33 33 <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 34 </ z:else>35 </ z:home>34 </r:else> 35 </r:home> 36 36 37 37 <div id='largecal' style='display:none;'></div> 38 < z:include template='notes.html'/>39 </ z:with>40 </ z:include>38 <r:include template='notes.html'/> 39 </r:with> 40 </r:include> trunk/db/init/base/skins/default/layout.html
r532 r540 7 7 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 8 8 <meta http-equiv="Content-Language" do='void' content="fr-fr" tset_content='[v_lang]_content' /> 9 <r:void name='stylesheets'> 10 <r:stylesheets list='reset,zena,code'/> 11 <link href="default.css" rel="Stylesheet" type="text/css"/> 12 </r:void> 9 13 10 <z:stylesheets name='stylesheets' list='reset,zena,code'/> 11 <link href="default.css" rel="Stylesheet" type="text/css"/> 12 13 <z:javascripts list='prototype,effects,zena'/> 14 <z:uses_calendar/> 14 <r:javascripts list='prototype,effects,zena'/> 15 <r:uses_calendar/> 15 16 </head> 16 17 … … 27 28 <div id='nav_menu' do='node' name='menu' select='root'> 28 29 <ul do='pages'> 29 <li do='each'>< z:link attr='name'/>30 <li do='each'><r:link attr='name'/> 30 31 <ul do='pages'> 31 <li do='each'>< z:link attr='name'/></li>32 <li do='each'><r:link attr='name'/></li> 32 33 </ul> 33 34 </li> 34 35 </ul> 35 36 </div> 36 <div id='branding' do='link' href='root'><img src='/img/logo.png' width='220' height='100'/></div>37 <div id='branding' do='link' name='branding' href='root'><img src='/img/logo.png' width='220' height='100'/></div> 37 38 </div> 38 39 39 40 40 < z:flash_messages/>41 <r:flash_messages/> 41 42 42 < z:void name='container'>43 <r:void name='container'> 43 44 <div id='context' do='void' name='context'> 44 45 </div> … … 49 50 50 51 <div id='related' do='void' name='related'> 51 < z:documents name='documents'><h3 class='group'>documents</h3>52 <r:documents name='documents'><h3 class='group'>documents</h3> 52 53 <ol> 53 <li do='each' set_class='li_s[v_status]'>< z:link format='data'><z:img mode='tiny'/></z:link> <z:link><z:show attr='name'/>.<z:show attr='c_ext'/></z:link></li>54 <li do='add'><a href='#' do='void' set_onclick='uploader=window.open("/documents/new?parent_id=[id]", "uploader", "location=1,width=400,height=300");return false;' set_href='/documents/new?parent_id=[id]'>< z:trans>btn_add_doc</z:trans></a></li>54 <li do='each' set_class='li_s[v_status]'><r:link format='data'><r:img mode='tiny'/></r:link> <r:link><r:show attr='name'/>.<r:show attr='c_ext'/></r:link></li> 55 <li do='add'><a href='#' do='void' set_onclick='uploader=window.open("/documents/new?parent_id=[id]", "uploader", "location=1,width=400,height=300");return false;' set_href='/documents/new?parent_id=[id]'><r:trans>btn_add_doc</r:trans></a></li> 55 56 </ol> 56 </ z:documents>57 < z:if kind_of='Page' do='pages' name='pages'><h3 class='group'>pages</h3>57 </r:documents> 58 <r:if kind_of='Page' do='pages' name='pages'><h3 class='group'>pages</h3> 58 59 <ol> 59 60 <li do='each' set_class='li_s[v_status]' do='link'/> 60 < z:add before='self' tag='li'/>61 < z:form>61 <r:add before='self' tag='li'/> 62 <r:form> 62 63 <li class='inline_form'> 63 64 <form> 64 65 <p class='hidden'> <input type='hidden' name='node[parent_id]' value='' do='void' set_value='[id]'/></p> 65 <p class='node_klass'> < z:input type='select' attr='klass' options='Page,Section,Skin,Project'/></p>66 <p class='node_klass'> <r:input type='select' attr='klass' options='Page,Section,Skin,Project'/></p> 66 67 <p class='node_v_title'><input type='text' name='node[v_title]' value=''/></p> 67 68 <p class='btn_validate'><input type="submit" value='validate' do='void' tset_value='validate'/></p> 68 69 </form> 69 70 </li> 70 </ z:form>71 </r:form> 71 72 </ol> 72 </ z:if>73 </r:if> 73 74 </div> 74 75 </div> 75 </ z:void>76 </r:void> 76 77 <ul id='siteinfo' do='void' name='siteinfo'> 77 78 <li do='design'><a href='http://teti.ch'>teti.ch</a></li> trunk/db/init/base/skins/default/notes.html
r497 r540 1 1 <div id='notes' do='notes_all' limit='10' order='log_at DESC'> 2 2 <ul class='note_list'> 3 < z:add after='self' tag='li'/>4 < z:form><li class='inline_form'><form>3 <r:add after='self' tag='li'/> 4 <r:form><li class='inline_form'><form> 5 5 <p class='hidden'> <input type='hidden' name='node[parent_id]' value='' do='void' set_value='[project_id]'/></p> 6 <p class='node_klass'> < z:input type='select' attr='klass' options='Post,Letter'/></p>7 <p class='node_log_at'> < z:input type='date_box' attr='log_at'/></p>6 <p class='node_klass'> <r:input type='select' attr='klass' options='Post,Letter'/></p> 7 <p class='node_log_at'> <r:input type='date_box' attr='log_at'/></p> 8 8 <p class='node_v_title'><input type='text' name='node[v_title]' do='void' set_value='[v_title]' size='25'/></p> 9 9 <p class='validate'> <input type="submit" value='validate' do='void' tset_value='validate'/></p> 10 10 </form></li> 11 </ z:form>11 </r:form> 12 12 <li class='note' do='each'> 13 13 <div class='header'> … … 16 16 <p class='title' do='title'>our new cms runs in a zen garden</p> 17 17 <p class='sign' do='version' do='author' do='show' attr='initials'>GB</p> 18 < z:actions select='all'/>18 <r:actions select='all'/> 19 19 </div> 20 20 </div> 21 < z:summary or='v_text' limit='2'/>21 <r:summary or='v_text' limit='2'/> 22 22 <div class='clear'></div> 23 23 </li> trunk/lib/parser/lib/rules/code_syntax.rb
r513 r540 101 101 class ZafuTokenizer < Syntax::Tokenizer 102 102 def step 103 if ztag = scan(/\A<\/? z:[^>]+>/)104 ztag =~ /<(\/?) z:([^> ]+)([^>]*)(\/?)>/105 start_group :tag, "<#{$1} z:"103 if ztag = scan(/\A<\/?r:[^>]+>/) 104 ztag =~ /<(\/?)r:([^> ]+)([^>]*)(\/?)>/ 105 start_group :tag, "<#{$1}r:" 106 106 start_group :ztag, $2 107 107 trailing = $4 trunk/lib/parser/lib/rules/zafu.rb
r513 r540 123 123 124 124 # end_tag 125 @end_tag = @html_tag || @options.delete(:end_do) || " z:#{@method}"125 @end_tag = @html_tag || @options.delete(:end_do) || "r:#{@method}" 126 126 @end_tag_count = 1 127 127 … … 206 206 flush $& 207 207 end 208 elsif $1[0..1] == ' z:'209 # / ztag208 elsif $1[0..1] == 'r:' 209 # /rtag 210 210 eat $& 211 211 if $1 != @end_tag 212 puts [@end_tag, $1].inspect 212 213 # error bad closing ztag 213 214 store "<span class='parser_error'>#{$&.gsub('<', '<').gsub('>','>')}</span>" … … 240 241 def scan_tag(opts={}) 241 242 # puts "TAG(#{@method}): [#{@text}]" 242 if @text =~ /\A< z:([\w_]+)([^>]*?)(\/?)>/243 # puts " ZTAG:#{$~.to_a.inspect}}" # ztag243 if @text =~ /\A<r:([\w_]+)([^>]*?)(\/?)>/ 244 # puts "RTAG:#{$~.to_a.inspect}}" # ztag 244 245 eat $& 245 246 opts.merge!(:method=>$1, :params=>$2) trunk/lib/parser/lib/rules/zena.rb
r539 r540 325 325 326 326 # TODO: add parent_id into the form ! 327 # FIXME: use < z:form href='self'> or <z:form action='...'>327 # FIXME: use <r:form href='self'> or <r:form action='...'> 328 328 def r_form 329 329 @pass[:form] = self … … 683 683 # Shows a 'made with zena' link or logo. ;-) Thanks for using this ! 684 684 # TODO: test and add translation. 685 # < z:zena show='logo'/> or <z:zena show='text'/> == <z:zena/>685 # <r:zena show='logo'/> or <r:zena show='text'/> == <r:zena/> 686 686 def r_zena 687 687 if @params[:show] == 'logo' … … 715 715 # :tattr (translated attribute used as text link) 716 716 # :attr (attribute used as text link) 717 # < z:link href='node'><z:trans attr='lang'/></z:link>718 # < z:link href='node' tattr='lang'/>717 # <r:link href='node'><r:trans attr='lang'/></r:link> 718 # <r:link href='node' tattr='lang'/> 719 719 def r_link 720 720 # text … … 850 850 851 851 # FIXME: stored should be clarified and managed in a single way through links and contexts. 852 # < z:link href='stored_whatever'/>853 # < z:pages from='stored_whatever'/>854 # < z:pages from='project' project='stored_whatever'/>855 # < z:img link='stored_whatever'/>852 # <r:link href='stored_whatever'/> 853 # <r:pages from='stored_whatever'/> 854 # <r:pages from='project' project='stored_whatever'/> 855 # <r:img link='stored_whatever'/> 856 856 # ... 857 857 if value = @params[:author] … … 916 916 end 917 917 end 918 # < z:hot else='project'/>919 # < z:relation role='hot,project'> = get relation if empty get project918 # <r:hot else='project'/> 919 # <r:relation role='hot,project'> = get relation if empty get project 920 920 # relation ? get ? role ? go ? 921 921 trunk/lib/parser/test/zafu.yml
r503 r540 4 4 5 5 hello: 6 src: "< z:hello/>"6 src: "<r:hello/>" 7 7 res: "hello world!" 8 8 9 9 double_hello: 10 src: "< z:hello/> <z:hello/>"10 src: "<r:hello/> <r:hello/>" 11 11 res: "hello world! hello world!" 12 12 … … 16 16 17 17 hello_skip_content: 18 src: "< z:hello>I want to live forever</z:hello>"18 src: "<r:hello>I want to live forever</r:hello>" 19 19 res: "hello world!" 20 20 21 21 tag_not_closed: 22 src: "this is < z:test super='life' is = \"fine\""23 res: "this is < z:test super='life' is = \"fine\""22 src: "this is <r:test super='life' is = \"fine\"" 23 res: "this is <r:test super='life' is = \"fine\"" 24 24 25 25 hello_not_closed: 26 src: "I say < z:hello>blah blah"26 src: "I say <r:hello>blah blah" 27 27 res: "I say hello world!" 28 28 29 29 test: 30 src: "this < z:test>is a test</z:test> <z:hello/>"30 src: "this <r:test>is a test</r:test> <r:hello/>" 31 31 res: "this [test]is a test[/test] hello world!" 32 32 33 33 very_messy: 34 src: "this < z: blah> </z:truc> whak"35 res: "this < z: blah> <span class='parser_error'></z:truc></span> whak"34 src: "this <r: blah> </r:truc> whak" 35 res: "this <r: blah> <span class='parser_error'></z:truc></span> whak" 36 36 37 37 bad_closing_tag: 38 src: "this < z:test>looks </z:truc> ok"38 src: "this <r:test>looks </r:truc> ok" 39 39 res: "this [test]looks <span class='parser_error'></z:truc></span>[/test] ok" 40 40 … … 60 60 61 61 do_tag_with_ztags: 62 src: "I say <div do='test'>this < z:hello/></div>"62 src: "I say <div do='test'>this <r:hello/></div>" 63 63 res: "I say [test]<div>this [hello/]</div>[/test]" 64 64 … … 72 72 73 73 do_and_ztags: 74 src: "Hey < z:test>this is <p do='hello'>ok</p></z:test>"74 src: "Hey <r:test>this is <p do='hello'>ok</p></r:test>" 75 75 res: "Hey [test]this is [hello]<p>ok</p>[/hello][/test]" 76 76 … … 79 79 res: "Hey [test]<p> is [hello]<p>hello <p>cool</p></p>[/hello]</p>[/test]" 80 80 expand_with: 81 src: "this < z:test>looks </z:test> ok"81 src: "this <r:test>looks </r:test> ok" 82 82 res: "this [test]looks [/test] ok" 83 83 84 84 params: 85 src: "some < z:test good='choice' nice='work'>things</z:test> are fine"85 src: "some <r:test good='choice' nice='work'>things</r:test> are fine" 86 86 res: "some [test {= :good=>'choice', :nice=>'work'}]things[/test] are fine" 87 87 88 88 default_menu: 89 src: "the < z:test>menu</z:test> is nice"89 src: "the <r:test>menu</r:test> is nice" 90 90 res: "the [test]menu[/test] is nice" 91 91 92 92 include_menu: 93 src: "include_menu: < z:include template='/default/menu'/>"93 src: "include_menu: <r:include template='/default/menu'/>" 94 94 res: "include_menu: the [test]menu[/test] is nice" 95 95 96 96 include_context: 97 src: "include_context: < z:include template='menu'/>"97 src: "include_context: <r:include template='menu'/>" 98 98 res: "include_context: include_menu: the [test]menu[/test] is nice" 99 99 100 100 infinite_loop: 101 src: "< z:include template='/infinite/loop'/>"101 src: "<r:include template='/infinite/loop'/>" 102 102 res: "<span class='parser_error'>[include error: /infinite/loop --> /infinite/loop ]</span>" 103 103 104 104 infinite_foo: 105 src: "< z:include template='bar'/>"105 src: "<r:include template='bar'/>" 106 106 res: "<span class='parser_error'>[include error: /infinite/foo --> /infinite/bar --> /infinite/foo ]</span>" 107 107 108 108 infinite_bar: 109 src: "< z:include template='foo'/>"109 src: "<r:include template='foo'/>" 110 110 res: "<span class='parser_error'>[include error: /infinite/bar --> /infinite/foo --> /infinite/bar ]</span>" 111 111 112 112 default_context: 113 src: "from other: < z:include template='menu'/> and <z:include template='/include/menu'/>"113 src: "from other: <r:include template='menu'/> and <r:include template='/include/menu'/>" 114 114 res: "from other: the [test]menu[/test] is nice and include_menu: the [test]menu[/test] is nice" 115 115 116 116 set_context: 117 src: "res:< z:test/> <z:set_context truc='machin'>src:<z:test/></z:set_context> res:<z:test/>"117 src: "res:<r:test/> <r:set_context truc='machin'>src:<r:test/></r:set_context> res:<r:test/>" 118 118 res: "res:[test/] src:[test {> :truc=>'machin'}/] res:[test/]" 119 119 120 120 nested_set_context: 121 src: "< z:set_context var1='out' var2='foo'>1:<z:test/><z:set_context var1='in'>2:<z:test/></z:set_context>3:<z:test/></z:set_context>"121 src: "<r:set_context var1='out' var2='foo'>1:<r:test/><r:set_context var1='in'>2:<r:test/></r:set_context>3:<r:test/></r:set_context>" 122 122 res: "1:[test {> :var1=>'out', :var2=>'foo'}/]2:[test {> :var1=>'in', :var2=>'foo'}/]3:[test {> :var1=>'out', :var2=>'foo'}/]" 123 123 124 124 complex_example: 125 125 src: | 126 Some people say < z:hello/>127 Some say < z:include template='/default/menu'/>126 Some people say <r:hello/> 127 Some say <r:include template='/default/menu'/> 128 128 <ul class='list' do='set_context' life='ok'> 129 129 <li>truc</li> … … 131 131 <li do='test'>sunny day</li> 132 132 </ul> 133 < z:set_context var='complex'><z:include template='/default/menu'/></z:set_context>133 <r:set_context var='complex'><r:include template='/default/menu'/></r:set_context> 134 134 res: | 135 135 Some people say hello world! … … 143 143 144 144 unknown: 145 src: "this looks bad: < z:system truc='lala'/>"145 src: "this looks bad: <r:system truc='lala'/>" 146 146 res: "this looks bad: <span class='parser_unknown'><z:system truc='lala'/></span>" 147 147 148 148 check_params: 149 src: "bad < z:missing/> params"149 src: "bad <r:missing/> params" 150 150 res: "bad [missing parameter(s) missing:good, night] params" 151 151 152 152 check_params_partial: 153 src: "bad < z:missing good='ok'/> params"153 src: "bad <r:missing good='ok'/> params" 154 154 res: "bad [missing parameter(s) missing:night] params" 155 155 156 156 check_params_ok: 157 src: "bad < z:missing good='ok' night='hey'/> params"157 src: "bad <r:missing good='ok' night='hey'/> params" 158 158 res: "bad nothing missing params" 159 159 … … 170 170 [/test]end 171 171 no_tag: 172 src: "< z:set_context no_test='true'>this is a <z:test>test</z:test>dog</z:set_context>"172 src: "<r:set_context no_test='true'>this is a <r:test>test</r:test>dog</r:set_context>" 173 173 res: "this is a dog" 174 174 175 175 html_comments: 176 src: "< z:test><z:hello/><!-- this is nothing > <z:hello/> --></z:test>"177 res: "[test][hello/]<!-- this is nothing > < z:hello/> -->[/test]"176 src: "<r:test><r:hello/><!-- this is nothing > <r:hello/> --></r:test>" 177 res: "[test][hello/]<!-- this is nothing > <r:hello/> -->[/test]" 178 178 179 179 html_do_comment: 180 src: "< z:test><z:hello/><!--|this is not a comment <z:hello/> --></z:test>"180 src: "<r:test><r:hello/><!--|this is not a comment <r:hello/> --></r:test>" 181 181 res: "[test][hello/]this is not a comment [hello/] [/test]" 182 182 183 183 do_simple: 184 src: "< z:test do='hello'/>"184 src: "<r:test do='hello'/>" 185 185 res: "[test][hello/][/test]" 186 186 … … 190 190 191 191 do_multiple: 192 src: "< z:test param='1' do='test' param='2' do='hello' param='3'/>"192 src: "<r:test param='1' do='test' param='2' do='hello' param='3'/>" 193 193 res: "[test {= :param=>'1'}][test {= :param=>'2'}][hello {= :param=>'3'}/][/test][/test]" 194 194 195 195 do_with_inner: 196 src: "< z:test do='hello'>a thing <z:hello/> here</z:test>"196 src: "<r:test do='hello'>a thing <r:hello/> here</r:test>" 197 19
