Skip to content

Formats

phil/markup

Every format reaches the same features. What a language has natively is written its own way; what it lacks is written with an extension of that language, in its own style. Each feature ends up as the same UJO block or inline element, whatever format it was written in, so a text can be converted from one format to another through UJO.

The formats

FormatMarkupFormatRead into UJO byCompiled
MarkdownmarkdownReader\Markdown\MarkdownReaderUJO, rendered by phil/ujo
UJOujoReader\UjoReaderUJO, rendered by phil/ujo
BBCodebbcodeReader\BBCode\BBCodeReaderUJO, rendered by phil/ujo
MediaWikimediawikiReader\MediaWiki\MediaWikiReaderUJO, rendered by phil/ujo
DokuWikidokuwikiReader\DokuWiki\DokuWikiReaderUJO, rendered by phil/ujo
CreolecreoleReader\Creole\CreoleReaderUJO, rendered by phil/ujo
HTMLhtmlReader\Html\HtmlReaderas written, for the purifier
Plain texttextReader\Text\TextReaderAdapter\PlainText, straight to HTML

HTML is compiled as written, so that what an editor wrote reaches the purifier untouched, and plain text straight to its paragraphs; their readers convert them into UJO when a text is to become blocks. An add-on brings a format of its own under another name: see Extension points.

Correspondence

A cell names the syntax; "—" marks a feature the format does not have. The UJO column is what every syntax of the row becomes. The Markdown column describes PHIL's Markdown, {{ }} blocks and pages included. The three wikis share their extension tags: MediaWiki and DokuWiki write them <note>, Creole <<note>>, closed by </note> and <</note>>; a cell of the DokuWiki or Creole column that says "the tag" means the tag of the MediaWiki column, in its own delimiters. The HTML column names the elements, and the classes of the HTML phil/ujo renders, that the HTML reader reads back.

Text and inline elements

FeatureUJOMarkdownBBCodeMediaWikiDokuWikiCreoleHTML
Bold, italic<b>, <i>**b**, *i*, __b__, _i_[b], [i]'''b''', ''i'', '''''both'''''**b**, //i//**b**, //i//<b>, <strong>, <i>, <em>, <cite>, a bold or italic style
Strikethrough<s>~s~, ~~s~~[s]<s>, <del>, <strike>, {{s|…}}<del><<s>>…<</s>><s>, <del>, <strike>, text-decoration: line-through
Underline<u>—[u]<u>, <ins>, {{u|…}}__u____u__<u>, <ins>, text-decoration: underline
Highlight<mark>==text==[mark], [highlight]<mark>, {{Mark|…}}, {{Highlight|…}}<mark><<mark>>…<</mark>><mark>
Exponent, subscript<sup>, <sub>—[sup], [sub]<sup>, <sub><sup>, <sub>^^sup^^, ,,sub,,<sup>, <sub>
Inline code<code>`code`[icode]<code>, <tt>, {{code|…}}''code''##code##, {{{text}}}<code>, <kbd>, <samp>, <tt>
Text kept as writtenits text\ before a character[code], [icode]<nowiki><nowiki>, %%text%%~ before a character, {{{text}}}—
Line break<br>two spaces or \ at the end of a linea new line<br>\\ before a space or the end of the line\\<br>
Link<a href>[text](address), [text][label], [label][url], [url=address], [email][[Page|text]], [[Page#Section]], [https://… text][[page|text]], [[namespace:page#section]], [[https://…|text]][[page|text]], [[https://…|text]]<a href>
Autolink<a href><https://…>, <name@example.com>, https://…, www.…an address in the textan address in the textan address in the text, <name@example.com>an address in the text—
Non-breaking spaceU+00A0—[nbsp]&nbsp;, {{nbsp}}, <nbsp>the tagthe tag&nbsp;
Icon<i data-icon="set:name">—[icon=fas_fa-dragon]{{Icon|fas_fa-dragon}}, <icon fas_fa-dragon>the tagthe tag<i data-icon>
Horizontal space<span data-hspace>—[hspace=100px]{{Hspace|100px}}, <hspace 100px>the tagthe tag<span data-hspace>
Text color<span class="text-color" data-color>—[color=red]{{Color|red|text}}, <color red>the tagthe tag<span data-color>
Spoiler<span class="spoiler">—[spoiler]{{Spoiler|text}}, <spoiler>the tagthe tag<span class="spoiler">
Variableits value—[var=name]value[/var], [var]name[/var]{{#vardefine:name|value}}, {{#var:name}}, <var name="value">, <var name><var name="value">, <var name><<var name="value">>, <<var name>>—
Footnote<sup data-footnote> and footnote[^label], [^label]: text[footnote]text[/footnote]<ref>text</ref>, <ref name="a">, <ref name="a"/>, {{Footnote|text}}((text))<<footnote>>text<</footnote>><sup data-footnote> and its <aside class="ujo-footnote">
Raw HTMLinline elements, sanitizedkept at all, escaped below[html] as a block<html>, kept at all, escaped belowthe tagthe tag—

Blocks

FeatureUJOMarkdownBBCodeMediaWikiDokuWikiCreoleHTML
Paragraphparagraphlines between blank linestext, a blank line between twolines between blank linessamesame<p>, text between blocks
Headingheader, its anchor tune# to ######, or underlined by === or ---[h1]…[h6]= … = to ====== … ============ … ====== is the first level, == … == the fifth= … = to ====== … ======, the closing signs optional<h1>…<h6>
Heading anchoranchor tunegenerated, or {#id}generated, or id=generated, or id on a <div> around itgenerated, or id on a tag around itgenerated, or id on a tag around itgenerated, or id
List, ordered listlist-, +, *; 1., 1)[list], [*]; [list=1], [list=a], [list=i]*, #, a sign more for each level *, -, two spaces more for each level*, #, a sign more for each level<ul>, <ol>, start, type
Task listlist, style checklist- [ ], - [x] on every item[list=check], [*=x][ ], [x] after the sign of every itemsamesamea checkbox, or data-checked, in every item
Indented paragraphparagraph, its indent tune——:, ::, a sign for each level—:, ::—
Quotequote>[quote]<blockquote>>><blockquote>
Quote with attributionquote, its caption—[quote=author]<quote author="…">, <blockquote author="…">the tagthe tag<figure>, its <blockquote> and <figcaption>
Code blockcode, its languagefenced by ``` or ~~~, or indented[code], [code=language]lines that start with a space, <pre>, <syntaxhighlight lang="…">, <source lang="…">, <code php>lines indented by two spaces, <code php>, <file php>{{{ and }}} on lines of their own, <<code php>><pre>, its <code class="language-…">
Ruledelimiter***, ---, ___[hr]------------<hr>
Tabletablethe tables of GitHub[table], [tr], [th], [td]{|, !, |, |-, |}^ headings, | cells|= headings, | cells<table>, <th>, <td>
Imageimage, its alt, its caption, its layout tune![alt](address "caption"), alone or in a paragraph[img], [img=alt width=… wrap=left][[File:a.png|left|200px|alt=…|Caption]]{{ a.png?200|Caption}}, placed by its spaces{{a.png|alt}}<img alt title>, <figure> and its <figcaption>
Definition listdefinitionListTerm then : definition[dl], [dt], [dd]; Term : Definition, : Definition = Term : Definition, : Definition; Term : Definition, : Definition<dl>, <dt>, <dd>
Table of contentstoc[TOC][toc], [toc=Title depth=4]__TOC__, {{TOC|title=…}}, <toc title="…" depth=4>~~TOC~~, the tagthe tag<nav class="ujo-toc">
Front matterReading::$metadataYAML between --- lines[metadata] YAML, [style] CSS<metadata> YAML, <style> CSSthe tagsthe tags<title>, <meta name="…" content="…">
Raw HTML blockrawkept at all, escaped below[html], kept at all, escaped below<html> on lines of its own, kept at all, escaped belowthe tagthe tag—
Attributestunes, or a container{.class #id} after a heading or on the line under a blockid=, class=, align=, width=, height=, wrap= on a block tagid, class, align, width, height, wrap on an extension tag; <div id="…"> around a blockthe same, on the tagthe same, on the tagid, align, text-align, the classes ujo-align-… and ujo-wrap-…
Boxed note, read-aloud textnote, descriptive::: note Title, {{note …}}[note=Title], [descriptive]<note title="…">, <descriptive>the tagsthe tags<aside class="ujo-note">, ujo-descriptive, their ujo-box__title
Warning, alertwarning, alert::: warning, ::: info and the other alert types[warning=Title], [alert=info]<warning title="…">, <alert info>the tags, and <note warning>, <note important>, <note tip> of the note pluginthe tags<aside class="ujo-warning">, <div class="ujo-alert ujo-alert--info">
Collapsible blocktoggle—[spoiler=Title]<spoiler title="…">, <toggle> holding blocksthe tags, and <hidden title="…">the tags<details>, its <summary>
A class of the lookcontainer::: {.class}, {{class …}}[block=class], class=<div class="…">, <block class><WRAP class>, the tagsthe tags<div class="ujo-container …">

Pages and game books

FeatureUJOMarkdownBBCodeMediaWikiDokuWikiCreoleHTML
Page break, column breakpageBreak, columnBreak\page, \column[pagebreak], [columnbreak]{{Page break}}, {{Column break}}, <pagebreak>, <columnbreak>~~PAGEBREAK~~, ~~COLUMNBREAK~~, the tagsthe tagsujo-page-break, ujo-column-break
Style of the next page, coverpageStyle\page {class}[pagebreak=frontCover], [block=frontCover]{{Page break|frontCover}}, <pagebreak frontCover>, <block frontCover>~~PAGEBREAK:frontCover~~, the tagsthe tagsujo-page-style, its data-variant
Across the columnswide::: wide, {{wide …}}[wide], the flag wide<wide>, the flag widethe samethe sameujo-wide
Columns side by sidecolumns—[columns][column]…[column]…[/columns]<columns><column>…<column>…</columns>the same, <newcolumn> toothe sameujo-columns, its ujo-column
Flowing columnscolumnFlow—[columns=3]<columns 3>the samethe sameujo-column-flow--3
Blank linesspacer—[spacer=3]{{Spacer|3}}, <spacer 3>~~SPACER:3~~, the tagthe tagujo-spacer, its data-lines
Alignmentalignment tune{text-align:center} under a block[center], [left], [right], [justify], [align=…], align=<center>, <left>, <right>, <justify>, <align right>, align=the samethe same<center>, align, text-align
Page numberpageNumber{{pageNumber 1}}[pagenumber], [pagenumber=12], [pagenumber=skip], [pagenumber=reset]{{Page number|12}}, <pagenumber 12>, <pagenumber skip>, <pagenumber reset>~~PAGENUMBER:12~~, the tagsthe tagsujo-page-number, its data-mode
Running footerrunningFooter{{footnote …}}[footer]<footer>the tagthe tagujo-running-footer
Watermark, bannerwatermark, banner{{watermark …}}, {{banner …}}[watermark], [banner]<watermark>, <banner>the tagsthe tagsujo-watermark, ujo-banner
Decorationdecoration{{watercolor1}} to {{watercolor99}}[decoration=12 color=#rrggbb]{{Decoration|12|color=#rrggbb}}, <decoration 12 color=#rrggbb kind=ornament>~~DECORATION:12 color=#rrggbb~~, the tagthe tagujo-decoration--stain-12
Stat blockstatblock{{monster …}}, {{statblock,spell …}}[statblock], [monster], frame, wide, name=, subtitle=<statblock name="…" subtitle="…" frame wide>, <monster>the tagsthe tagsits blocks
Class tabletable, variant tune{{classTable …}}[classtable frame decoration]<classtable frame decoration>the tagthe tagits table, without the variant
Art creditcredit{{artist …}}[credit=Title], [artist]<credit title="…">, <artist>the tagsthe tagsujo-credit, its ujo-credit__title

Planned

The features below are part of the Markdown of PHIL and of every other format, and are not read yet: default attributes per block type, links to other sites (rel, target, the site's own domains), mentions @name and #ticket, an address alone on its line as an embed, smart punctuation through phil/typography, heading levels made consecutive, and an inline-only mode. BBCode, The wikis and HTML detail their columns.