Extension:RenderTheFück

From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
RenderTheFuck
Release status: unmaintained
Implementation Tag
Description Render WTF json you'd like to do.
Author(s) Raymond Wu (小璋丸talk)
Latest version 0.1.1 (2017-01-17)
Database changes No
License Apache v2
Download
<thefuck>
Check usage and version matrix.

The fuck is a tag hook to help you render json data by D3.js. It can render timeline currently. The character u has two dot on the top, because [sf]uck are not allowed naming as topic.

How to[edit]

Just input a simple tag hook.

<thefuck example="timeline" />

Then appear this SVG, and it's downloadable. Each text in the bar has a link to Wikipedia.

Thefxck-timeline-example.png

Your own data[edit]

 1 <thefuck width="1000" height="400">
 2 {
 3   "wtf": "timeline",
 4   "settings": {
 5     "title": "Timeline example",
 6     "unit": "year"
 7   },
 8   "lines": [
 9     {
10       "title": "Roman Empire",
11       "from": -27,
12       "to": 476,
13       "wiki": "Roman Empire"
14     },
15     {
16       "title": "Byzantine Empire",
17       "from": 330,
18       "to": 1453,
19       "wiki": "Byzantine Empire"
20     },
21     {
22       "title": "Holy Roman Empire",
23       "from": 962,
24       "to": 1806,
25       "wiki": "Holy Roman Empire"
26     },
27     {
28       "title": "First French Empire",
29       "from": 1804,
30       "to": 1814,
31       "wiki": "First French Empire"
32     },
33     {
34       "title": "Austrian Empire",
35       "from": 1867,
36       "to": 1918,
37       "wiki": "Austrian Empire"
38     }
39   ]
40 }
41 </thefuck>

Installation[edit]

  • Download it from GitHub.
  • Extract this into extension dir.
  • In LocalSettings.php add this extension.
# End of automatically generated settings.
# Add more configuration options below.
wfLoadExtension( 'RenderTheFuck' );