Template:StreamLinkTable

From Hackerspace ACKspace
Revision as of 09:56, 7 December 2017 by Xopr (talk | contribs) (created fancy readme, set stages to generic name)
Jump to: navigation, search

synopsis

This is the "StreamLinkTable" template.

It will generate a table with various links derived from the stages, languages, formats and types.

It should be called in the following format (all parameters are optional):

{{StreamLinkTable
|baseURL=
|stages=
|languages=
|languageCount=
|formats=
|types=
|typeCount=
}}

parameters

The parameters all default to something useful for CCC and each has a specific syntax: baseURL

  • baseURL: first common part of the link, defaults to http://cdn.c3voc.de/
  • stages: comma separated (,) list of Stage Label;urlPart (note the semicolon ;), defaults to 3 × Stage n;sn
  • languages: comma separated (,) list of Language Label;urlPart (note the semicolon ;), defaults to Native;_native_,Translated;_translated_
  • languageCount: number used for setting the correct table header span, set to reflect the amount of languages, defaults to 2
  • formats: comma separated (,) list of Format Label;urlPart (note the semicolon ;), defaults to WebM;.webm,HLS;.m3u8
  • types: comma separated (,) list of Type Label;urlPart (note the semicolon ;), defaults to HD;hd,SD;sd,Slides;slides
  • typeCount: number used for setting the correct table header span, set to reflect the amount of types, defaults to 3

The links are generated as followed (always using the item part after the semicolon: baseURL+stage(outer row)+language(inner row)+type(inner column)+format(outer column), for example Stage 3 Native Slides as HLS will have the link: http://cdn.c3voc.de/s3_native_slides.m3u8

css

Note that for the best results, this table needs extra CSS in MediaWiki:Common.css:

/* CSS span table rowspan only showing the first header */
table.span tr>th.span2,
table.span tr>th.span3,
table.span tr>th.span4,
table.span tr>th.span5
{
    display: none;
}

table.span tr:nth-of-type(2n+1)>th.span2,
table.span tr:nth-of-type(3n+1)>th.span3,
table.span tr:nth-of-type(4n+1)>th.span4,
table.span tr:nth-of-type(5n+1)>th.span5
{
    display: table-cell;
}

If it is not possible to have this CSS added, make sure to set languageCount = 1, or the table layout will break.

example

Edit the page to see how the following table is generated:

WebMHLS
HDSDSlidesHDSDSlides
Stage 1 Native linklinklinklinklinklink
Stage 1 Translated linklinklinklinklinklink
Stage 2 Native linklinklinklinklinklink
Stage 2 Translated linklinklinklinklinklink
Stage 3 Native linklinklinklinklinklink
Stage 3 Translated linklinklinklinklinklink