The renderer code is [here](https://github.com/johnallsup/pt2_public/blob/master/root/.php/ptmd.php). # Specials There are two types of specials: *block* and *inline*. Inline extends the `[[inline link]]` notation, noting that an href containing a colon is invalid, and so if `:` occurs in it, it is a special. ## Inline Specials For example `[[youtube:N7GoTb5L5gM]]` embeds [this](https://www.youtube.com/watch?v=N7GoTb5L5gM) video thus: [[youtube:7QVWjNAPxbQ]] It removes leading and trailing spaces, so `[[youtube: 7QVWjNAPxbQ ]]` works. But it rejects invalid id's such as [[youtube:7QVWjNAPxbxQ]]. We add inline specials to PTMD by adding methods named ``` function special_inline_flibble($what,$args) {... ``` The `$what` in `[[flibble:hexvision]] is the `flibble` bit, essentially whatever is before the first `:`, and the `$args` is everything afterwards. Simples. ## Block Specials Here we reuse fenced code blocks. Ordinarily, a block fenced by backquotes ````random ```python like this ``` ```` will be formatted as a code block with in this case the language set to Python. By adding methods ``` function special_block_duolingo($what,$options,$content) {... ``` for example, we can then have blocks like ````random ```duolingo ... ``` ```` have some custom code turning them into HTML. The `$what` is the `duolingo`bit, the `$options` are whatever follows it on the `duolingo` line. Then the `$content` is everything else within the code block.