UI Frameworks

Get along with JavaScript frameworks and Elephant Wiki

This site uses Semantic-UI / Fomantic-UI. It also uses the wiki syntax in all pages.

Adding the class attribute to wiki elements

Wiki elements accept CSS style attributes directly within parenthesis. When adding (attribute:value) wiki expands to style="attribute:value". Attributes starting with & are treated as non-style attributes and became an HTML element attribute. This is the case for class.

Wiki

Expanded HTML

Result

[html(&class:ui button)]Button[/html]
<div class="ui button">Button</div>
Button

Mixing class and style attributes

It is possible to use both, class and style attributes in wiki elements. Simply add style attributes separated by comas.

Wiki

Expanded HTML

Result

[html(&class:ui button,font-style:oblique,text-transform:uppercase)]Button[/html]
<div class="ui button" style="font-style:oblique;text-transform:uppercase;">Button</div>
Button

Wiki elements relation to HTML

Wiki

Results in

Description

[html]
<div>

Accepting characters block. Will not create new lines or paragraphs. See Blocks .

[block]
<div>

Non accepting characters block. Creates new lines and paragraphs when an empty line is given. See Blocks .

[span]
<span>

Creates an in line element. See Spans .

[link]
<a>

Creates an anchor. See Links .

[joker(element)]
<element>

Creates an accepting characters element named as the first parameter. See Joker .

The joker as a joker

The joker wiki element can emulate any HTML element. Let's see a joker as an HTML anchor.

Wiki

Expanded HTML

Result

[joker(a,&href:/docs,&class:ui button,text-transform:uppercase)]Docs[/joker]
<a href="/docs" class="ui button" style="text-transform:uppercase;">Docs</a>
Docs

When to use html or block

As you probably noticed, html and block wiki elements do much the same. They create an HTML div with the difference of accepting or not characters. When accepting characters, the element does not create new lines or paragraphs.

When creating Semantic-UI grids, the grid requires the use of html. Columns may use html or block depending on their content. For example, if the column content is text, is preferable to use block. If the content is mainly other elements, use html instead.

The two blocks of construction would be:

For text columns

[html(&class:ui two column grid)]
[block(&class:column)]
Some text.
[/block]
[block(&class:column)]
Some other text.
[/block]
[/html]

For more element columns

[html(&class:ui two column grid)]
[html(&class:column)]
[block(&class:ui segment)]Some segment.[/block]
[/html]
[html(&class:column)]
[block(&class:ui segment)]Some other segment.[/block]
[/html]
[/html]
English04/20/20 13:09Lluís Turró Cutiller