Difference between revisions of "Template:Documentation/MasterTOC/Zh"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:文档目录主模板}}
 
 
<div id="tocwrapper" class="docooo_tocwrapper" style="float:right;  width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;">
 
<div id="tocwrapper" class="docooo_tocwrapper" style="float:right;  width: 200px; padding: 0px; border: 3px solid #fff; border-left: 20px solid #fff; border-bottom: 20px solid #fff; margin-left: 40px; margin-bottom: 20px; margin-top: -5px;">
 +
<!--
 
   <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div>
 
   <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div>
   <div id="{{{bookid}}}" style="border:1px solid #9099a8; padding: 0px; font-size: xx-small; background-color: #FFF;">
+
//-->
     <div id="doc_toctitle" class="docooo_toctitle" style="background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:130%;">{{{booktitle}}}</div>
+
   <div id="{{{bookid}}}" style="border:1px solid #9BC0F5; padding: 0px; font-size: xx-small; background-color: #FFF;">
     <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:{{{ShowParttitle|none}}}">
+
     <div id="doc_toctitle" class="docooo_toctitle docsection" style="font-size:130%;">{{{booktitle}}}</div>
 +
     <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8;font-size:130%;display:{{{ShowParttitle|none}}}">
 
: {{{parttitle}}}
 
: {{{parttitle}}}
 
  <div id="tocfooter" class="docooo_tocfooter" style="padding: 1px;">  
 
  <div id="tocfooter" class="docooo_tocfooter" style="padding: 1px;">  
Line 29: Line 30:
 
<noinclude>
 
<noinclude>
  
==Usage of Parameters==
+
==参数用法==
 
;ShowPrevPage:set to "block" to show the "previous page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore '''must explicitly''' be set to none to hide the link. The TOC must use <nowiki>{{{ShowPrevPage}}}</nowiki> as the parameter value to ensure passing along.
 
;ShowPrevPage:set to "block" to show the "previous page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore '''must explicitly''' be set to none to hide the link. The TOC must use <nowiki>{{{ShowPrevPage}}}</nowiki> as the parameter value to ensure passing along.
 
;PrevPage:the path to the previous page (no surrounding "[")
 
;PrevPage:the path to the previous page (no surrounding "[")
Line 44: Line 45:
 
;NextPart:the path to the first page of the next part (no surrounding "[")
 
;NextPart:the path to the first page of the next part (no surrounding "[")
  
{{Documentation/Note|The style classes are not yet created in the css file}}
+
{{Note|The style classes are not yet created in the css file}}
  
 
=== Simulated example ===
 
=== Simulated example ===
Line 64: Line 65:
 
   <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div>
 
   <div id="icon" style="float:right; margin-right: -10px; margin-top: -10px;">[[Image:Book.png]]</div>
 
   <div id="1234" style="border:1px solid #9099a8; padding: 0px; font-size: xx-small; background-color: #FFF;">
 
   <div id="1234" style="border:1px solid #9099a8; padding: 0px; font-size: xx-small; background-color: #FFF;">
     <div id="toctitle" class="docooo_toctitle" style="background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:120%;">[[My Manual]]</div>
+
     <div id="toctitle" class="docooo_toctitle" style="background-color: #c5d0e1; border: 0px solid #9099a8; padding: 1px;font-weight: bold; text-align: left; font-size:130%;">[[My Manual]]</div>
 
     <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block">
 
     <div id="parttitle" class="docooo_parttitle" style="padding: 1px;font-weight: bold; text-align: left; border-bottom: 1px solid #9099a8; display:block">
 
: [[My First Part]]
 
: [[My First Part]]
Line 75: Line 76:
 
|}
 
|}
 
</div>
 
</div>
     <div id="tocbody" class="docooo_tocbody" style="padding: 6px;">
+
     <div id="tocbody" class="docooo_tocbody" style="padding: 6px;font-size:130%;">
 
* Chapter
 
* Chapter
 
* Chapter
 
* Chapter
Line 95: Line 96:
 
(note: not usable in preview mode while editing this template):
 
(note: not usable in preview mode while editing this template):
  
<pre>{{Documentation/MasterTOC
+
<pre>{{Documentation/MasterTOC/Zh
 
|ShowPrevPage=none
 
|ShowPrevPage=none
 
|ShowNextPage=block
 
|ShowNextPage=block
 
|NextPage=The Next Page
 
|NextPage=The Next Page
 
|bookid=1234'''
 
|bookid=1234'''
|booktitle=[[My Manual]]
+
|booktitle=[[我的指南]]
 
|ShowParttitle=block
 
|ShowParttitle=block
|parttitle=[[The First Part]]
+
|parttitle=[[第一章节]]
 
|ShowPrevPart=none
 
|ShowPrevPart=none
 
|ShowNextPart=block
 
|ShowNextPart=block
|NextPart=The Second Part
+
|NextPart=The Next Part
|toccontent=* Chapter
+
|toccontent=* 章节一
* Chapter
+
* 章节二
* Chapter
+
* 章节三
 
}}
 
}}
 
</pre>
 
</pre>
Line 116: Line 117:
 
<div style="border: 1px dotted #000; padding: 20px; width: 400px; height: 200px; margin: 20px;">
 
<div style="border: 1px dotted #000; padding: 20px; width: 400px; height: 200px; margin: 20px;">
  
{{Documentation/MasterTOC
+
{{Documentation/MasterTOC/Zh
 
|ShowPrevPage=none
 
|ShowPrevPage=none
 
|ShowNextPage=block
 
|ShowNextPage=block
 
|NextPage=The Next Page
 
|NextPage=The Next Page
 
|bookid=1234'''
 
|bookid=1234'''
|booktitle=[[My Manual]]
+
|booktitle=[[我的指南]]
 
|ShowParttitle=block
 
|ShowParttitle=block
|parttitle=[[The First Part]]
+
|parttitle=[[第一章节]]
 
|ShowPrevPart=none
 
|ShowPrevPart=none
 
|ShowNextPart=block
 
|ShowNextPart=block
|NextPart=The Second Part
+
|NextPart=The Next Part
|toccontent=* Chapter
+
|toccontent=* 章节一
* Chapter
+
* 章节二
* Chapter
+
* 章节三
 
}}
 
}}
 
</div>
 
</div>
 +
[[Category:Wiki Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 15:23, 4 July 2018

{{{booktitle}}}

{{{toccontent}}}

[[{{{PrevPage}}}|< 上一页]] [[{{{NextPage}}}|下一页 >]]


参数用法

ShowPrevPage
set to "block" to show the "previous page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore must explicitly be set to none to hide the link. The TOC must use {{{ShowPrevPage}}} as the parameter value to ensure passing along.
PrevPage
the path to the previous page (no surrounding "[")
ShowNextPage
set to "block" to show the "next page" link, set to "none" to hide it. This parameter is not set in the TOC based on this template, but rather in the file containing that TOC. So the parameter value is "passed through" the TOC to this template and therefore must explicitly be set to none to hide the link. The TOC must use {{{ShowNextPage}}} as the parameter value to ensure passing along.
NextPage
the path to the previous page (no surrounding "[")
bookid
The id for the book (not yet evaluated)
booktitle
The book title that appears at the top of the TOC in full wiki syntax (i.e. as a link: [[MyGuide|My Great Manual]]
ShowParttitle
set to "block" to show the part title. This will be used in Sub-TOCs. It will default to hidden when not specified.
parttitle
The title of the part that this Sub-TOC covers in full wiki syntax (i.e. as a link: [[MyGuide/MyPart|Part 1: My Great Part]]
toccontent
The content of the TOC as lists and divs.
ShowPrevPart
set to "block" in to show the "previous part" link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.
PrevPart
the path to the first page of the previous part (no surrounding "[")
ShowNextPart
set to "block" in to show the "previous part" link at the bottom of the TOC. If this parameter is set at the TOC level (and not on the file level like the prev/next page parameter), it will default to hidden when not specified.
NextPart
the path to the first page of the next part (no surrounding "[")
Documentation note.png The style classes are not yet created in the css file

Simulated example

  • ShowPrevPage set to none
  • ShowNextPage set to block
  • NextPage set to The Next Page
  • bookid set to 1234
  • booktitle set to [[My Manual]]
  • ShowParttitle set to block
  • parttitle set to [[The First Part]]
  • ShowPrevPart set to none
  • ShowNextPart set to block
  • NextPart set to The Second Part
  • toccontent set to * Chapter
    * Chapter
    * Chapter
Book.png
[[{{{PrevPart}}}|< Previous Part]] Next Part >
  • Chapter
  • Chapter
  • Chapter
[[{{{PrevPage}}}|< Previous Page]] Next Page >

Calculated example

(note: not usable in preview mode while editing this template):

{{Documentation/MasterTOC/Zh
|ShowPrevPage=none
|ShowNextPage=block
|NextPage=The Next Page
|bookid=1234'''
|booktitle=[[我的指南]]
|ShowParttitle=block
|parttitle=[[第一章节]]
|ShowPrevPart=none
|ShowNextPart=block
|NextPart=The Next Part
|toccontent=* 章节一
* 章节二
* 章节三
}}

will be:

第一章节
[[{{{PrevPart}}}|< 上一章]] 下一章 >
  • 章节一
  • 章节二
  • 章节三
[[{{{PrevPage}}}|< 上一页]] 下一页 >


Personal tools