mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-27 17:50:55 +00:00
docs: update usage documentation
* add transclusion under usage * rewrite the old usage information
This commit is contained in:
parent
c045490a01
commit
9d0c70e4d6
83
README.md
83
README.md
|
@ -1,8 +1,9 @@
|
|||
![](https://upload.wikimedia.org/wikipedia/commons/d/d7/TabberNeue-icon-ltr.svg)
|
||||
# TabberNeue
|
||||
![](https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue/workflows/MediaWiki%20CI/badge.svg)
|
||||
|
||||
The TabberNeue extension allows wikis to create tabs within a page. It is a rewritten and forked version of [Extension:Tabber](https://www.mediawiki.org/wiki/Extension:Tabber). It includes multiple improvements such as responsive layout support, ARIA support, and conform to Wikimedia UI. **TabberNeue is a complete replacement of Tabber, please disable or remove Tabber before enabling TabberNeue.**
|
||||
![](https://upload.wikimedia.org/wikipedia/commons/d/d7/TabberNeue-icon-ltr.svg)
|
||||
|
||||
The TabberNeue extension allows wikis to create tabs within a page. It is a forked and rewritten version of [Extension:Tabber](https://www.mediawiki.org/wiki/Extension:Tabber). It includes multiple improvements such as page transclusion, responsive layout support, ARIA support, and conform to Wikimedia UI. **TabberNeue is a complete replacement of Tabber, please disable or remove Tabber before enabling TabberNeue.**
|
||||
|
||||
[Extension:TabberNeue on MediaWiki](https://www.mediawiki.org/wiki/Extension:TabberNeue).
|
||||
|
||||
|
@ -22,32 +23,70 @@ into a directory called TabberNeue.
|
|||
|
||||
## Usage
|
||||
TabberNeue uses the exact same syntax as Tabber.
|
||||
Tabs are created with `tabName=tabBody`, and separated by `|-|`.
|
||||
|
||||
### Simple tabbers
|
||||
Tabs are created with `tabName=tabBody`, and separated by `|-|`. You can use any wikitext within your tabs, including templates and images.
|
||||
```html
|
||||
<tabber>
|
||||
tab1=Some neat text here
|
||||
|-|
|
||||
tab2=
|
||||
[http://www.google.com Google]<br/>
|
||||
[http://www.cnn.com Cnn]<br/>
|
||||
|-|
|
||||
tab3={{Template:SomeTemplate}}
|
||||
|-|First Tab Title=
|
||||
First tab content goes here.
|
||||
|-|Second Tab Title=
|
||||
Second tab content goes here.
|
||||
|-|Third Tab Title=
|
||||
Third tab content goes here.
|
||||
</tabber>
|
||||
```
|
||||
|
||||
### Parser functions and conditionals
|
||||
```html
|
||||
### Nested tabbers
|
||||
Nested tabbers need to be written as parser functions. Instead of the `<tabber/>` tags, they are wrapped with `{{#tag:tabber|}}` and separated by `{{!}}-{{!}}`. It is useful when creating nested tabber.
|
||||
```
|
||||
<tabber>
|
||||
Tab1 = {{{1|}}}
|
||||
|-|
|
||||
Tab2 = {{{2|}}}
|
||||
|-|First Tab Title=
|
||||
{{#tag:tabber|
|
||||
Tab Title A=
|
||||
Tab content A goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title B=
|
||||
Tab content B goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title C=
|
||||
Tab content C goes here.
|
||||
}}
|
||||
|-|Second Tab Title=
|
||||
{{#tag:tabber|
|
||||
Tab Title D=
|
||||
Tab content D goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title E=
|
||||
Tab content E goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title F=
|
||||
Tab content F goes here.
|
||||
}}
|
||||
|-|Third Tab Title=
|
||||
{{#tag:tabber|
|
||||
Tab Title G=
|
||||
Tab content G goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title H=
|
||||
Tab content H goes here.
|
||||
{{!}}-{{!}}
|
||||
Tab Title I=
|
||||
Tab content I goes here.
|
||||
}}
|
||||
</tabber>
|
||||
```
|
||||
Becomes:
|
||||
```
|
||||
{{#tag:tabber|
|
||||
Tab1={{{1|}}}
|
||||
{{!}}-{{!}}
|
||||
Tab2={{{2|}}}
|
||||
}}
|
||||
|
||||
### Transclusion
|
||||
With the transclusion mode, the syntax is different, and it's more similar to `<gallery>` syntax.
|
||||
|
||||
The contents of the page of the first tab will be transcluded. Other tabs will be transcluded on-demand with AJAX, performing a request to the MediaWiki api. Once requested, they won't be fetched again until the page is reloaded. Note that Tabbers on the transcluded page will not be rendered.
|
||||
|
||||
Tabs are created with `pageName|tabName`, and separated by a new line.
|
||||
```html
|
||||
<tabbertransclude>
|
||||
First Page Name|First Tab Title
|
||||
Second Page Name|Second Tab Title
|
||||
Third Page Name|Third Tab Title
|
||||
</tabbertransclude>
|
||||
```
|
Loading…
Reference in a new issue