Template, Style And Syntax

From Synfig Studio :: Documentation
Jump to: navigation, search
m (templates intra link)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<!-- Page info -->
 
<!-- Page info -->
{{Title|Style And Syntax}}
+
{{Title|Template, Style And Syntax}}
{{Navigation|Writer_Documentation|Meta:ScreenShots}}
+
{{Navigation|Writer_Documentation|Meta:Translation}}
 +
{{TOCright}}
 
<!-- Page info end -->
 
<!-- Page info end -->
Before you start editing pages in this wiki, you should be aware about some improvements we made to original MediWiki to provide extra features.
+
Before you start editing pages in this wiki, you should be aware about some rules and improvements we made to original MediaWiki to provide extra features.
 +
 
 +
= Moderation =
 +
This wiki is moderated. It means that by default it displays the latest approved version instead of the very latest edit.
 +
 
 +
The moderation is introduced for two reasons:
 +
# Contributors can safely prepare documentation for the new (upcoming) version of Synfig, while information about current (stable) version still will be available by default at the frontend.
 +
# Administrators can review the edits in most comfortable time for them, without worrying that someone will put undesired edits during their absence.
 +
 
 +
If the approved edit for the page is not the latest one, then you will see a special message near the page heading: '''"This is the approved revision of this page; it is not the most recent."''' That means there are some newer edits not approved by moderator (yet). You can click '''"View the most recent revision."''' to see the most recent edit.
  
 
= Page head =
 
= Page head =
Line 11: Line 21:
 
  <nowiki>{{</nowiki>Title|Getting Started}}<!-- Scary? That's to make sure that GetTitle template will not catch the Title template -->
 
  <nowiki>{{</nowiki>Title|Getting Started}}<!-- Scary? That's to make sure that GetTitle template will not catch the Title template -->
 
  <nowiki>{{</nowiki>Navigation|Category:Manual|Doc:Animation_Basics}}
 
  <nowiki>{{</nowiki>Navigation|Category:Manual|Doc:Animation_Basics}}
  <nowiki>[[</nowiki>Category:Manual]]
+
  <nowiki>{{</nowiki>Category|Manual}}
  <nowiki>[[</nowiki>Category:Tutorials]]
+
  <nowiki>{{</nowiki>Category|Tutorials}}
  <nowiki>[[</nowiki>Category:Tutorials Basic]]
+
  <nowiki>{{</nowiki>Category|Tutorials Basic}}
 
  <nowiki><!-- Page info end --></nowiki></code>
 
  <nowiki><!-- Page info end --></nowiki></code>
  
Please take your time and be sure to fill in this section properly, otherwise some things may not work as expected. There are only few templates allowed in this section.
+
Please take your time and be sure to fill in this section properly, otherwise some things may not work as expected. There are only few templates allowed in this section. For example, it's the good place to put the {{L|Template:TOCright|TOCright template}}.
  
 +
=Basics templates=
 
== Title template ==
 
== Title template ==
 +
 +
  <nowiki>{{Title|Getting Started}}</nowiki>
 +
 
The Title tag is mandatory and used to specify the title for a page. Its main purpose is to provide a proper title for translated pages. You should set the page title even if it's the same as the page name. This ensures that translators will not forget to set this tag at the time of translation.
 
The Title tag is mandatory and used to specify the title for a page. Its main purpose is to provide a proper title for translated pages. You should set the page title even if it's the same as the page name. This ensures that translators will not forget to set this tag at the time of translation.
  
 
== Categories ==
 
== Categories ==
You can specify categories a page belongs to the same way as with any mediawiki:  
+
Please specify categories a page belongs to with this syntax:  
<pre><nowiki>[[Category:Manual]]</nowiki></pre>
+
<pre><nowiki>{{Category|Manual}}</nowiki></pre>
  
 
:Consider the fact that linking to categories differs from the usual MediaWiki syntax. In an ordinary MediaWiki setup you are forced to use ''<nowiki>[[</nowiki>:Category:MyCategory<nowiki>]]</nowiki>'' syntax if you want a link to category. That approach is replaced here by one considered more logical for our taste, where all links are defined by L tag (see below).
 
:Consider the fact that linking to categories differs from the usual MediaWiki syntax. In an ordinary MediaWiki setup you are forced to use ''<nowiki>[[</nowiki>:Category:MyCategory<nowiki>]]</nowiki>'' syntax if you want a link to category. That approach is replaced here by one considered more logical for our taste, where all links are defined by L tag (see below).
Line 35: Line 49:
 
* Tools / Layers / Panels / Parameters / Tools - group relevant pages together.
 
* Tools / Layers / Panels / Parameters / Tools - group relevant pages together.
 
* CMS - images belonging to CMS interface ("Theme" category is the same, should be merged with)
 
* CMS - images belonging to CMS interface ("Theme" category is the same, should be merged with)
 +
 +
'''Reworked Terminology'''
 +
 +
For technical reasons, use just '''<nowiki>{{NewTerminology}}</nowiki>''' to mark page as updated when [http://wiki.synfig.org/wiki/Dev:Sprints/2013-01-07_Reworked_Terminology rewrite terminology is done]
  
 
== Navigation template ==
 
== Navigation template ==
Line 44: Line 62:
 
Notice that you don't need to specify the previous page because it's determined automatically from the data in the navigation tags of other pages.
 
Notice that you don't need to specify the previous page because it's determined automatically from the data in the navigation tags of other pages.
  
Please, if you place the Anvigation at the top of the chapter, do so as well at the end... this is the natural place when you read the documentation.
+
Please, if you place the Navigation at the top of the chapter, do so as well at the end... this is the natural place when you read the documentation.
  
= Links =
+
==Table of contents : TOC==
The rule is simple: just use <nowiki>{{L| ... }}</nowiki> instead of <nowiki>[[ ... ]]</nowiki> EVERYWHERE for internal links.
+
<pre><nowiki>{{</nowiki>TOCright<nowiki>}}</nowiki></pre>
 +
Align to the right the Table of contents.
  
TODO: table here
+
==More templates==
 +
For a full list of templates used in the synfig wiki or before adding a new one, have a look to [[Meta:Templates|the template page listing]].
  
= Menu command template =
+
= Formating =
Usage: <nowiki>{{c|<menuname>|<submenu1>|submenu2|…}}</nowiki>
+
  
= Development Notes =
+
== Links ==
 +
The rule is simple: just use <nowiki>{{L| ... }}</nowiki> (instead of <nowiki>[[ ... ]]</nowiki>) EVERYWHERE for internal links.
 +
 
 +
This special template make the localization mechanic work on this wiki. When you translate a page, create (or let) the links with <nowiki>{{L|OrginalPageName}}</nowiki>, if the {{literal|OrginalPageName}} exist in your language, the link will be translated and linked to it.
 +
 
 +
Usage :
 +
 
 +
<nowiki>A jump into {{L|Special:Random|random}} world.</nowiki>
 +
 
 +
gives
 +
 
 +
A jump into {{L|Special:Random|random}} world.
 +
 
 +
== Table ==
 +
 
 +
Add a table with a lot of options. Typicaly used in Layer's parameters description.
 +
If you have a left align table (what is default align) and want a paragraph break after the table, add this following "magic" code after it : <nowiki><br style="clear:both;"></nowiki> (or simply change <nowiki>align="left"</nowiki> with <nowiki>align="none"</nowiki> from table definition)
 +
 
 +
Usage :
 +
 
 +
<code>
 +
<nowiki>
 +
{|border="0" align="left" style="border-collapse"  cellpadding="3" cellspacing="0"</nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|-style="background:#silver"</nowiki><br><nowiki>
 +
|'''Name'''||'''Value'''||'''Type'''  </nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|-</nowiki><br><nowiki>
 +
||{{l|Image:Type_real_icon.png|16px}} {{l|Z Depth Parameter|Z Depth}}</nowiki><br><nowiki>
 +
||0.000000</nowiki><br><nowiki>
 +
||real</nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|-style="background:#eeeeee"</nowiki><br><nowiki>
 +
||{{l|Image:Type_real_icon.png|16px}} {{l|Amount Parameter|Quantity}}</nowiki><br><nowiki>
 +
||1.000000</nowiki><br><nowiki>
 +
||real</nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|-</nowiki><br><nowiki>
 +
||icon ...</nowiki><br><nowiki>
 +
||...</nowiki><br><nowiki>
 +
||...</nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|-style="background:#eeeeee"</nowiki><br><nowiki>
 +
||icon ...</nowiki><br><nowiki>
 +
||...</nowiki><br><nowiki>
 +
||...</nowiki><br><nowiki>
 +
</nowiki><br><nowiki>
 +
|}
 +
</nowiki>
 +
</code>
 +
 
 +
give
 +
 
 +
{|border="0" align="left" style="border-collapse"  cellpadding="3" cellspacing="0"
 +
 
 +
|-style="background:#silver"
 +
|'''Name'''||'''Value'''||'''Type'''
 +
 
 +
|-
 +
||{{l|Image:Type_real_icon.png|16px}} {{l|Z Depth Parameter|Z Depth}}
 +
||0.000000
 +
||real
 +
 
 +
|-style="background:#eeeeee"
 +
||{{l|Image:Type_real_icon.png|16px}} {{l|Amount Parameter|Quantity}}
 +
||1.000000
 +
||real
 +
 
 +
|-
 +
||icon ...
 +
||...
 +
||...
 +
 
 +
|-style="background:#eeeeee"
 +
||icon ...
 +
||...
 +
||...
 +
 
 +
|}
 +
<br style="clear:both;">
 +
 
 +
More informations : [http://meta.wikimedia.org/wiki/Help:Table wikimedia.org / Help:Table]
 +
 
 +
== Menu command template ==
 +
Used to indicate a path in the menu system.
 +
 
 +
<nowiki>{{c|<menuname>|<submenu1>|submenu2|…}}</nowiki>
 +
 
 +
Usage :
 +
<nowiki>Display Layer Panel {{c|<File>|<Panel>|Layer|}} to ...</nowiki>
 +
 
 +
gives<br>
 +
 
 +
Display Layer Panel {{c|<File>|<Panel>|Layer|}} to ...
 +
 
 +
== Shortcut ==
 +
The shortcut template display the shortcuts in a friendly way.
 +
 
 +
<includeonly><span class="hotkeybg"><!--
 +
-->{{Shortcut/Hotkey|{{{1}}} |lower={{{lower1|}}}}}<!--
 +
-->{{#if:{{{2|}}}|{{Shortcut/Hotkey| {{{2}}} |lower={{{lower2|}}}}} }}<!--
 +
-->{{#if:{{{3|}}}|{{Shortcut/Hotkey| {{{3}}} |lower={{{lower3|}}}}} }}<!--
 +
-->{{#if:{{{4|}}}|{{Shortcut/Hotkey| {{{4}}} |lower={{{lower4|}}}}} }}<!--
 +
-->{{#if:{{{5|}}}|{{Shortcut/Hotkey| {{{5}}} |lower={{{lower5|}}}}} }}<!--
 +
-->{{#if:{{{6|}}}|[[Category:Fixme/Shortcut template]] }}</span></includeonly><noinclude>Put a sequence of up to 5 keys to show a shortcut:<br>
 +
<nowiki>{{Shortcut|<key1>|<key2>|...|...}}</nowiki>
 +
 
 +
Example :
 +
<nowiki>{{Shortcut|alt|shift|S}}</nowiki>
 +
returns {{Shortcut|alt|shift|S}}
 +
 
 +
More informations : [[Template:Shortcut]]
 +
 
 +
== Literal ==
 +
This template is used to ‘wrap’ all reference to GUI items (control name, menu item, …).
 +
 
 +
Usage :<br>
 +
 
 +
<nowiki>Select {{Literal|Color}} parameter.</nowiki>
 +
 
 +
gives<br>
 +
 
 +
Select {{Literal|Color}} parameter.
 +
 
 +
More informations : [[Template:Literal]]
 +
 
 +
= Extras =
 +
 
 +
== Development Notes ==
 
Use DevNotesBegin and DevNotesEnd templates to mark text describing features of development Synfig version.
 
Use DevNotesBegin and DevNotesEnd templates to mark text describing features of development Synfig version.
Usage: <nowiki>{{DevNotesBegin}}Any wiki markup.{{DevNotesEnd}}</nowiki>
 
  
= Note template =
+
Usage : <br>
 +
 
 +
  <nowiki>{{DevNotesBegin}}Any wiki markup.{{DevNotesEnd}}</nowiki>
 +
 
 +
gives<br>
 +
 
 +
{{DevNotesBegin}}Any wiki markup.{{DevNotesEnd}}
 +
 
 +
== Note template ==
 
This template gives a box of fixed width.<br>
 
This template gives a box of fixed width.<br>
  
<nowiki>{{Note|Note title|Short note text}}</nowiki>
+
<nowiki>{{Note|Note title|Short note text}}</nowiki>
  
 
gives <br>
 
gives <br>
Line 77: Line 231:
 
See also [[Template:NiceTip]]
 
See also [[Template:NiceTip]]
  
= NiceTip template =
+
== NiceTip template ==
 
(TODO) This template gives a box with an icon and a title, expanding with the text width up to page-width.
 
(TODO) This template gives a box with an icon and a title, expanding with the text width up to page-width.
 
...
 
...
{{Navigation|Writer_Documentation|Meta:ScreenShots}}
+
 
 +
= More informations =
 +
For more ressources about synfig wiki template, have a look to [[Special:UncategorizedTemplates|Uncategorized Templates]]
 +
 
 +
Reading, Editing, Advanced editing ... [https://www.mediawiki.org/wiki/Help:Contents from mediawiki]
 +
 
 +
{{Navigation|Writer_Documentation|Meta:Translation}}

Latest revision as of 13:10, 20 April 2017

Navigation Navigation:  <<Writer Documentation>>


Before you start editing pages in this wiki, you should be aware about some rules and improvements we made to original MediaWiki to provide extra features.

Moderation

This wiki is moderated. It means that by default it displays the latest approved version instead of the very latest edit.

The moderation is introduced for two reasons:

  1. Contributors can safely prepare documentation for the new (upcoming) version of Synfig, while information about current (stable) version still will be available by default at the frontend.
  2. Administrators can review the edits in most comfortable time for them, without worrying that someone will put undesired edits during their absence.

If the approved edit for the page is not the latest one, then you will see a special message near the page heading: "This is the approved revision of this page; it is not the most recent." That means there are some newer edits not approved by moderator (yet). You can click "View the most recent revision." to see the most recent edit.

Page head

At the top of each page there is a special section where additional page information is stored. Shown below is an example of how this section might look:

<!-- Page info -->
{{Title|Getting Started}}
{{Navigation|Category:Manual|Doc:Animation_Basics}}
{{Category|Manual}}
{{Category|Tutorials}}
{{Category|Tutorials Basic}}
<!-- Page info end -->

Please take your time and be sure to fill in this section properly, otherwise some things may not work as expected. There are only few templates allowed in this section. For example, it's the good place to put the TOCright template.

Basics templates

Title template

 {{Title|Getting Started}}

The Title tag is mandatory and used to specify the title for a page. Its main purpose is to provide a proper title for translated pages. You should set the page title even if it's the same as the page name. This ensures that translators will not forget to set this tag at the time of translation.

Categories

Please specify categories a page belongs to with this syntax:

{{Category|Manual}}
Consider the fact that linking to categories differs from the usual MediaWiki syntax. In an ordinary MediaWiki setup you are forced to use [[:Category:MyCategory]] syntax if you want a link to category. That approach is replaced here by one considered more logical for our taste, where all links are defined by L tag (see below).

We have too many categories today. We might delete many of them soon.

Just use those categories today:

  • Unverified / Updated - marks page/screenshot status.
  • Manual / Tutorial / Glossary - shows is the page in "Doc" namespace belong to tutorials or is it part of the Manual or Glossary.
  • Tutorials Basic / Tutorials Intermediate / Tutorials Advanced - shows tutorial complexity level.
  • Tools / Layers / Panels / Parameters / Tools - group relevant pages together.
  • CMS - images belonging to CMS interface ("Theme" category is the same, should be merged with)

Reworked Terminology

For technical reasons, use just {{NewTerminology}} to mark page as updated when rewrite terminology is done

Navigation template

The Navigation tag is optional. It's used when you want to link a set of pages into a sequence, like Manual pages. The syntax is:
{{Navigation|Parent Page|Next Page}}
  • "Parent Page" is the name of the top-level (index) page for the sequence which the current page belongs to. For example, "Parent Page" for Getting Started is Manual. And the parent page for this page is Writer Documentation.
  • "Next Page" is the name of the page which in reading sequence is following the current one. For example, "Next Page" for Getting Started is Animation Basics.

Notice that you don't need to specify the previous page because it's determined automatically from the data in the navigation tags of other pages.

Please, if you place the Navigation at the top of the chapter, do so as well at the end... this is the natural place when you read the documentation.

Table of contents : TOC

{{TOCright}}

Align to the right the Table of contents.

More templates

For a full list of templates used in the synfig wiki or before adding a new one, have a look to the template page listing.

Formating

Links

The rule is simple: just use {{L| ... }} (instead of [[ ... ]]) EVERYWHERE for internal links.

This special template make the localization mechanic work on this wiki. When you translate a page, create (or let) the links with {{L|OrginalPageName}}, if the "OrginalPageName" exist in your language, the link will be translated and linked to it.

Usage :

A jump into {{L|Special:Random|random}} world.

gives

A jump into random world.

Table

Add a table with a lot of options. Typicaly used in Layer's parameters description. If you have a left align table (what is default align) and want a paragraph break after the table, add this following "magic" code after it : <br style="clear:both;"> (or simply change align="left" with align="none" from table definition)

Usage :

{|border="0" align="left" style="border-collapse" cellpadding="3" cellspacing="0"

|-style="background:#silver"
|'''Name'''||'''Value'''||'''Type'''

|-
||{{l|Image:Type_real_icon.png|16px}} {{l|Z Depth Parameter|Z Depth}}
||0.000000
||real

|-style="background:#eeeeee"
||{{l|Image:Type_real_icon.png|16px}} {{l|Amount Parameter|Quantity}}
||1.000000
||real

|-
||icon ...
||...
||...

|-style="background:#eeeeee"
||icon ...
||...
||...

|}

give

Name Value Type
Type real icon.png Z Depth 0.000000 real
Type real icon.png Quantity 1.000000 real
icon ... ... ...
icon ... ... ...


More informations : wikimedia.org / Help:Table

Menu command template

Used to indicate a path in the menu system.

{{c|<menuname>|<submenu1>|submenu2|…}}

Usage :

Display Layer Panel {{c|<File>|<Panel>|Layer|}} to ...

gives

Display Layer Panel "<File> → <Panel> → Layer" to ...

Shortcut

The shortcut template display the shortcuts in a friendly way.

Put a sequence of up to 5 keys to show a shortcut:

{{Shortcut|<key1>|<key2>|...|...}}

Example :

{{Shortcut|alt|shift|S}}

returns Alt⇧ ShiftS

More informations : Template:Shortcut

Literal

This template is used to ‘wrap’ all reference to GUI items (control name, menu item, …).

Usage :

Select {{Literal|Color}} parameter.

gives

Select "Color" parameter.

More informations : Template:Literal

Extras

Development Notes

Use DevNotesBegin and DevNotesEnd templates to mark text describing features of development Synfig version.

Usage :

 {{DevNotesBegin}}Any wiki markup.{{DevNotesEnd}}

gives

Development Notes:
Any wiki markup.

Note template

This template gives a box of fixed width.

{{Note|Note title|Short note text}}

gives

Note title

Short note text
note end


while

{{Note|Note title|Suspendisse sodales leo at dolor mollis sagittis. In tempor venenatis tellus sed tincidunt.}}

gives

Note title

Suspendisse sodales leo at dolor mollis sagittis. In tempor venenatis tellus sed tincidunt.
note end


See also Template:NiceTip

NiceTip template

(TODO) This template gives a box with an icon and a title, expanding with the text width up to page-width. ...

More informations

For more ressources about synfig wiki template, have a look to Uncategorized Templates

Reading, Editing, Advanced editing ... from mediawiki

Navigation Navigation:  <<Writer Documentation>>