Babycode guide

<% local tocs = {} %>

What is babycode?

<% table.insert(tocs, {"What is babycode?", "what-is-babycode"}) %>

You may be familiar with BBCode, a loosely related family of markup languages popular on forums. Babycode is another, simplified, dialect of those languages. It is a way of formatting text by enclosing parts of it in special tags.

Text formatting tags

<% table.insert(tocs, {"Text formatting tags", "text-formatting-tags"}) %>
  • To make some text bold, enclose it in [b][/b]:
    [b]Hello World[/b]
    Will become
    Hello World
  • To italicize text, enclose it in [i][/i]:
    [i]Hello World[/i]
    Will become
    Hello World
  • To make some text strikethrough, enclose it in [s][/s]:
    [s]Hello World[/s]
    Will become
    Hello World

Emotes

<% table.insert(tocs, {"Emotes", "emoji"}) %>

There are a few emoji in the style of old forum emotes:

<% --[[ we'll pretend like i will totally refactor emojis and generate this table dynamically in the future. clown emoji ]]%>
Short code(s) Emoji result
:angry: angry
:(: frown
:D: grin
:imp: imp
:impangry: :angryimp: impangry
:lobster: lobster
:|: neutral
:pensive: pensive
:): smile
:smiletear: :crytear: smiletear
:,: :T: :cry: :sob: sob
:o: :O: surprised
:hmm: :think: :thinking: think
:P: :p: tongue
:weary: weary
:;: :wink: wink

Special thanks to the Forumoji project and its contributors for these graphics.

Paragraph rules

<% table.insert(tocs, {"Paragraph rules", "paragraph-rules"}) %>

Line breaks in babycode work like Markdown: to start a new paragraph, use two line breaks:

paragraph 1

paragraph 2
Will produce:
paragraph 1

paragraph 2

To break a line without starting a new paragraph, end a line with two spaces:

paragraph 1  
still paragraph 1
That will produce:
paragraph 1
still paragraph 1
<% table.insert(tocs, {"Links", "links"}) %>

Loose links (starting with http:// or https://) will automatically get converted to clickable links. To add a label to a link, use
[url=https://example.com]Link label[/url]:
Link label

Attaching an image

<% table.insert(tocs, {"Attaching an image", "attaching-an-image"}) %>

To add an image to your post, use the [img] tag:
[img=https://forum.poto.cafe/avatars/default.webp]the Lua logo with a cowboy hat[/img]

the Lua logo with a cowboy hat

Images will always break up a paragraph and will get scaled down to a maximum of 400px. The text inside the tag will become the image's alt text.

Adding code blocks

<% table.insert(tocs, {"Adding code blocks", "adding-code-blocks"}) %>

There are two kinds of code blocks recognized by babycode: inline and block. Inline code blocks do not break a paragraph. They can be added with [code]your code here[/code]. As long as there are no line breaks inside the code block, it is considered inline. If there are any, it will produce this:

<% local code = 'func _ready() -> void:\n\tprint("hello world!")' %>
<%= code %>

Babycodes are not parsed inside code blocks.

Quoting

<% table.insert(tocs, {"Quoting", "quoting"}) %>

Text enclosed within [quote][/quote] will look like a quote:

A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine.

Lists

<% table.insert(tocs, {"Lists", "lists"}) %>

There are two kinds of lists, ordered (1, 2, 3, ...) and unordered (bullet points). Ordered lists are made with [ol][/ol] tags, and unordered with [ul][/ul]. Every new paragraph according to the usual paragraph rules will create a new list item. For example:

[ul]
item 1

item 2

item 3  
still item 3 (break line without inserting a new item by using two spaces at the end of a line)
[/ul]

Will produce the following list:
  • item 1
  • item 2
  • item 3
    still item 3 (break line without inserting a new item by using two spaces at the end of a line)

Table of contents