{% extends 'base.html' %} {% block title %}babycode guide{% endblock %} {% block content %}
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.
[b][/b]
:[i][/i]
:[s][/s]
:[u][/u]
:[big][/big]
:[small][/small]
:[color][/color]
:[center][/center]
:[right][/right]
:There are a few emoji in the style of old forum emotes:
Short code | Emoji result |
---|---|
{{ ("[code]:%s:[/code]" % emoji) | babycode | safe }} | {{ __emoji[emoji] | safe }} |
Special thanks to the Forumoji project and its contributors for these graphics.
Line breaks in babycode work like Markdown: to start a new paragraph, use two line breaks:
{{ '[code]paragraph 1\n\nparagraph 2[/code]' | babycode | safe }} Will produce:To break a line without starting a new paragraph, end a line with two spaces:
{{ '[code]paragraph 1 \nstill paragraph 1[/code]' | babycode | safe }} That will produce:Additionally, the following tags will break into a new paragraph:
[code]
(code block, not inline);[img]
;[center]
;[right]
;[ul]
and [ol]
;[quote]
.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
To add an image to your post, use the [img]
tag:
[img=https://forum.poto.cafe/avatars/default.webp]the Python logo with a cowboy hat[/img]
{{ '[img=/static/avatars/default.webp]the Python logo with a cowboy hat[/img]' | babycode | safe }}
Text inside the tag becomes the alt text. The attribute is the image URL. The text inside the tag will become the image's alt text.
Images will always break up a paragraph and will get scaled down to a maximum of 400px. However, consecutive image tags will try to stay in one line, wrapping if necessary. Break the paragraph if you wish to keep images on their own paragraph.
Multiple images attached to a post can be clicked to open a dialog to view them.
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:
Inline code tags look like this: {{ '[code]Inline code[/code]' | babycode | safe }}
Babycodes are not parsed inside code blocks.
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.
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:
You can make a section collapsible by using the [spoiler]
tag: