Help:EasyTimeline syntax: Difference between revisions

Content deleted Content added
CmdrObot (talk | contribs)
m Wikipedia URL→wikilink (2); sp (4): Januari→January, comand→command, possiblities→possibilities; capitalisation (2): cyrillic, europe
TRANSWIKI: Copied from Meta:Help:EasyTimeline syntax.
Line 1:
{{H:h|editor toc}}
 
The EasyTimeline feature produces an embedded [[Help:Images and other uploaded files|image]] from wikitext. The image can be a one-dimensional diagram (horizontally or vertically), or a two-dimensional one. The name "EasyTimeline" refers to the possibility to apply the feature with a time scale horizontally or vertically, possibly with another parameter in the other direction, but there are also various other possibilitiespossiblities.
 
See also [[m:EasyTimeline]], [[mhttp:Help:EasyTimeline//stats.wikimedia.org/EN/TimelinesIndex.htm examples]]Gallery (obsolete)of graphical timelines], [[m:Help:EasyTimeline activation|EasyTimeline activation on other MediaWiki installations]]
 
==Introduction==
Line 330:
*Bar names specified in [[#PlotData|PlotData]] can be validated against this list, thus preventing typing errors.
 
;bar : defines the bar id. Other commands (notably [[#PlotData|PlotData]]) will expect this id for reference. This will also be the label to be shown along the axis, unless attribute ''text'' is present. The bar id should not contain any spaces: use underscores instead, these will be converted to spaces, as wihwith article titles.
;text (O) : When specified this specifies the text to be presented along the axis, instead of the bar id. See also rules for [[#Text Input|text input]]. The text may include one embedded link (see '''Note 1''').
;link (O) : Specify a web link (see '''Note 1''') (URL). The label along the axis will be shown as a blue clickable link.
Line 347:
The following lines produce the same output (only reference in [[#PlotData|PlotData]] changes):
<pre>
bar:US text:[[United StatesUnited_States]]
 
bar:US text:"United States" link:http://www.wikipedia.org/wiki/United_States
Line 354:
</pre>
----
 
===Colors===
This command allows colors to be defined and coupled to an id (identification tag).
Line 362 ⟶ 363:
;value : Actual color definition. Color values can be either be specified as:
;* predefined color constant, for which 32 predefined color names are recognized (see the [http://ploticus.sourceforge.net/doc/color.html Ploticus color page] where all these constants are defined).
;* rgb (red, green, blue): specify 3 numbers between 0 (minimal) and 1 (maximal)
;* hsv (hue, saturation, value): specify 3 numbers between 0 and 1
;* gray (value): specify a number between 0 (black) and 1 (white)
Line 380 ⟶ 381:
===DateFormat===
 
This commandcomand defines how dates, specified in other commands, should be
interpreted.
 
Line 393 ⟶ 394:
<small>Example:</small>
<pre>
DateFormat = mm/dd/yyyyyyy
</pre>
 
Line 444 ⟶ 445:
;'''columns''' (O) : Specify 1, 2, 3 or 4. When this attribute is omitted the number of columns is determined as follows:
*'''orientation horizontal''' : Attribute columns does not apply here. All entries will be on the same line.
*'''orientation vertical''' :
**'''position right''' : All entries will be in one column
**'''position top''' or '''bottom''' : The number of columns depends on the number of entries to be shown:<br/>1-5 entries: 1 column, 6-10 entries: 2 columns, 11 or more entries: 3 columns.
Line 603 ⟶ 604:
:When command [[#BarData|BarData]] has not been used, bars will be drawn in the order in which they occur in any [[#PlotData|PlotData]] data block. The id specified here will also be the text presented along the axis, next to the bar.
:When command BarData has been used, bars will presented in the order specified there, also the bar id specified here will be validated against that list. Also the text presented along the axis will depend on the definition in [[#BarData|BarData]].
;barset : Restarts the bar display "from the top", allowing multiple bars on the same line. Syntax: <tt>barset:name</tt><br>Blank lines may be added to skip over lines that you do not wish to add to with declarations such as <tt>at:1234</tt> with no further attributes.
;color : Specifies the color is which the bar should be drawn.
:The color id specified should be defined first with command [[#Colors|Colors]].
Line 610 ⟶ 612:
<pre>
BarData=
idbar:US text:United States
idbar:SB text:Sea Battles
 
Colors=
Line 657 ⟶ 659:
 
====Marker attribute====
;mark : Places a marker in a bar at the specified position. Specify as mark: (symbol, color). The only value for ''symbol'' supported to date is ''line''. The ''color'' id specified should be defined first with command [[#Colors|Colors]]. When not specified color black will be assumed.
 
<small>Example:</small>
Line 664 ⟶ 666:
bar:test width:15 color:red
from:1900 till:2000
at:1990 mark:(line, white)
</pre>
 
Line 682 ⟶ 684:
width:15 color:red
bar:test from:1900 till:2000
bar:test at:1990 mark:(line, white)
</timeline>
 
Line 724 ⟶ 726:
Used to define a text block that can be positioned anywhere on the chart.
;text : The actual text. See also [[#Text Input|Text Input]] for rules. The text may include embedded links (see '''Notes 1 & 2''').
;pos : Defines the top-left corner of the text block in absolute or relative [[#Input_rules|measurements]]. Define as ''pos:(x, y)''.
;link (O) : Specify a web link (see '''Note 1''') (URL) for use in clickable maps. The label along the axis will be shown as a blue clickable link.
;textcolor (O) : Defines the color of the text. The color id specified should be defined first using [[#Colors|Colors]]. When not specified, the color is black.
Line 741 ⟶ 743:
pos:(20,67) textcolor:black fontsize:S
tabs:(10-right,14-left,50-left,90-left,230-left)
text:^1^1940^27/9^Germany, Italy and Japan sign [[Tripartite Pact]]
text:^10^1944^1-22/7^Bretton Woods 44 nations establish
text:^^^^^IMF and World Bank
Line 757 ⟶ 759:
pos:(20,67) textcolor:black fontsize:S
tabs:(10-right,14-left,50-left,90-left,230-left)
text:^1^1940^27/9^Germany, Italy and Japan sign [[Tripartite Pact]]
text:^10^1944^1-22/7^Bretton Woods 44 nations establish
text:^^^^^IMF and World Bank
Line 778 ⟶ 780:
 
==Presets==
 
Presets are a shorthand for often used settings. They save a few code lines and promote standardisation, but may be confusing, as the timeline script become less self documenting.
 
At the moment two presets are available:
*'''Preset = TimeVertical_OneBar_UnitYear''', which expands to
PlotArea = left:45 right:10 top:10 bottom:10
*Preset = TimeHorizontal_AutoPlaceBars_UnitYear
TimeAxis = orientation:vertical format:yyyy
DateFormat = yyyy ;
AlignBars = early
ScaleMajor = unit:year
ScaleMinor = unit:year
PlotData =
mark:(line,white) align:left fontsize:S width:20 shift:(20,0)
 
*'''Preset = TimeHorizontal_AutoPlaceBars_UnitYear''', which expands to
Not clear if whether there is documentation about them.
ImageSize = height:auto barincrement:20
PlotArea = left:25 right:25 top:15 bottom:30
TimeAxis = orientation:horizontal format:yyyy
Colors =
id:canvas value:gray(0.7)
id:grid1 value:gray(0.4)
id:grid2 value:gray(0.2)
BackgroundColors = canvas:canvas
DateFormat = yyyy ;
AlignBars = justify
ScaleMajor = unit:year grid:grid1
ScaleMinor = unit:year
Legend = orientation:vertical left:35 top:130
PlotData =
align:left anchor:from fontsize:M width:15 shift:(4,-6) textcolor:black
 
==Input rules==
Line 826 ⟶ 852:
</pre>
 
3 In data lines following command [[#TextData|TextData]] twoone characterscharacter havehas special meaning:
:'''~''' (tilde) means ''line break''
:'''^''' (caret) means ''tab''
 
<small>Example showing line breaks:</small>
<pre>
TextData =
.. text:Generated for Wikipedia~Version 1.1 - 2 January 2004
 
# will be shown as:
#
# Generated for Wikipedia
# Version 1.1 - 2 January 2004
</pre>
 
<small>Example showing tabs:</small>
Line 845 ⟶ 859:
TextData =
tabs:(4-right,12-right,14-left,34-left)
text:^1^1940^27/9^Berlin Ger, It, Jap sign Tripartite Pact
text:^10^1944^1-22/7^Bretton Woods 44 nations establish
text:^^^^^IMF and World Bank
Line 851 ⟶ 865:
# will be shown as:
#
# 1 27/9 Berlin Ger, It, Jap sign Tripartite Pact
# 10 1-22/7 Bretton Woods 44 nations establish
# IMF and World Bank
Line 910 ⟶ 924:
 
<pre>
<nowiki>text:[[http://en.wikipedia.org/wiki/Rembrandt|Rembrandt| van Rijn]] paints Night Watch</nowiki>
</pre>
will be shown as:
Line 922 ⟶ 936:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"[[http://en.wikipedia.org/wiki/Rembrandt|Rembrandt| van Rijn]] paints Night Watch"
</timeline>
 
Line 928 ⟶ 942:
 
<pre>
<nowiki>text:[[en:Main PageMain_Page]]</nowiki>
</pre>
and similar with nl: and m: give:
Line 940 ⟶ 954:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"[[en:Main PageMain_Page]]"
</timeline>
 
Line 952 ⟶ 966:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"[[nl:Main PageMain_Page]]"
</timeline>
 
Line 964 ⟶ 978:
BackgroundColors = canvas:canvas
TextData =
pos:(10,10) fontsize:XL text:"[[m:Main PageMain_Page]]"
</timeline>
 
The third one to Meta-Wikipedia works properly, except from Meta itself, the other links work like [[Main PageMain_Page]] (internal page, the prefix is ignored) or e.g. {{SERVER}}/w/Main_Page (gives File not found), depending on the URL of the referring page (e.g. different for a preview page and a diff page).
 
'''Special characters:'''
Line 988 ⟶ 1,002:
 
==Font Support==
Timeline has somewhat limited unicode support. It uses FreeSans.ttf font, which supports a subset of all the possible glyphs (it supports Cyrilliccyrillic alphabet, east-Europeeurope diactrics and kana for instance, but lacks kanji). No other fonts are available at this time.
 
<timeline>
Line 999 ⟶ 1,013:
Period = from:1 till:2 # dummy
TextData=
pos:(10,7090) fontsize:L text:"Википедия维基百科"
pos:(10,5070) fontsize:L text:"Zażółć gęślą jaźń"
pos:(10,2050) fontsize:L text:"ウィキペディア"
</timeline>
 
Line 1,031 ⟶ 1,045:
 
{{H:f|langs=|enname=EasyTimeline syntax}}
 
[[Category:Graphical Timelines|EasyTimeline syntax, Help]]