make babycode guide use generic class names
This commit is contained in:
@@ -4,46 +4,46 @@
|
||||
<div class=darkbg>
|
||||
<h1 class="thread-title">Babycode guide</h1>
|
||||
</div>
|
||||
<div class="babycode-guide-container">
|
||||
<div class="guide-container">
|
||||
<div class="guide-topics">
|
||||
{% set sections %}
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="what-is-babycode">What is babycode?</h2>
|
||||
<p>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.</p>
|
||||
<p>A <b>tag</b> is a short name enclosed in square brackets. Tags can be opening tags, like <code class="inline-code">[b]</code> or closing tags, like <code class="inline-code">[/b]</code>. Anything inserted between matching opening and closing tags is known as the tag's content.</p>
|
||||
<p>Some tags can provide more specific instructions using an <b>attribute</b>. An attribute is added to the opening tag with an equals sign (<code class="inline-code">=</code>). This allows you to specify details like a particular color or a link's address.</p>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="text-formatting-tags">Text formatting tags</h2>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>To make some text <strong>bold</strong>, enclose it in <code class="inline-code">[b][/b]</code>:<br>
|
||||
[b]Hello World[/b]<br>
|
||||
Will become<br>
|
||||
<strong>Hello World</strong>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>To <em>italicize</em> text, enclose it in <code class="inline-code">[i][/i]</code>:<br>
|
||||
[i]Hello World[/i]<br>
|
||||
Will become<br>
|
||||
<em>Hello World</em>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>To make some text <del>strikethrough</del>, enclose it in <code class="inline-code">[s][/s]</code>:<br>
|
||||
[s]Hello World[/s]<br>
|
||||
Will become<br>
|
||||
<del>Hello World</del>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>To <u>underline</u> some text, enclose it in <code class="inline-code">[u][/u]</code>:<br>
|
||||
[u]Hello World[/u]<br>
|
||||
Will become<br>
|
||||
<u>Hello World</u>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>To make some text {{ "[big]big[/big]" | babycode | safe }}, enclose it in <code class="inline-code">[big][/big]</code>:<br>
|
||||
[big]Hello World[/big]<br>
|
||||
Will become<br>
|
||||
@@ -54,7 +54,7 @@
|
||||
{{ "[small]Hello World[/small]" | babycode | safe }}
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>You can change the text color by using <code class="inline-code">[color][/color]</code>:<br>
|
||||
[color=red]Red text[/color]<br>
|
||||
[color=white]White text[/color]<br>
|
||||
@@ -65,7 +65,7 @@
|
||||
{{ "[color=#3b08f0]Blueish text[/color]" | babycode | safe }}<br>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class='babycode-guide-list'>
|
||||
<ul class='guide-list'>
|
||||
<li>You can center text by enclosing it in <code class="inline-code">[center][/center]</code>:<br>
|
||||
[center]Hello World[/center]<br>
|
||||
Will become<br>
|
||||
@@ -79,7 +79,7 @@
|
||||
Note: the center and right tags will break the paragraph. See <a href="#paragraph-rules">Paragraph rules</a> for more details.
|
||||
</ul>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="emoji">Emoji</h2>
|
||||
<p>There are a few emoji in the style of old forum emotes:</p>
|
||||
<table class="emoji-table">
|
||||
@@ -96,7 +96,7 @@
|
||||
</table>
|
||||
<p>Special thanks to the <a href="https://gh.vercte.net/forumoji/">Forumoji project</a> and its contributors for these graphics.</p>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="paragraph-rules">Paragraph rules</h2>
|
||||
<p>Line breaks in babycode work like Markdown: to start a new paragraph, use two line breaks:</p>
|
||||
{{ '[code]paragraph 1\n\nparagraph 2[/code]' | babycode | safe }}
|
||||
@@ -116,12 +116,12 @@
|
||||
<li><code class="inline-code">[quote]</code>.</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="links">Links</h2>
|
||||
<p>Loose links (starting with http:// or https://) will automatically get converted to clickable links. To add a label to a link, use<br><code class="inline-code">[url=https://example.com]Link label[/url]</code>:<br>
|
||||
<a href="https://example.com">Link label</a></p>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="attaching-an-image">Attaching an image</h2>
|
||||
<p>To add an image to your post, use the <code class="inline-code">[img]</code> tag:<br>
|
||||
<code class="inline-code">[img=https://forum.poto.cafe/avatars/default.webp]the Python logo with a cowboy hat[/img]</code>
|
||||
@@ -131,7 +131,7 @@
|
||||
<p>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.</p>
|
||||
<p>Multiple images attached to a post can be clicked to open a dialog to view them.</p>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="adding-code-blocks">Adding code blocks</h2>
|
||||
{% set code = 'func _ready() -> void:\n\tprint("hello world!")' %}
|
||||
<p>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 class="inline-code">[code]your code here[/code]</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:</p>
|
||||
@@ -142,12 +142,12 @@
|
||||
<p>Inline code tags look like this: {{ '[code]Inline code[/code]' | babycode | safe }}</p>
|
||||
<p>Babycodes are not parsed inside code blocks.</p>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="quoting">Quoting</h2>
|
||||
<p>Text enclosed within <code class="inline-code">[quote][/quote]</code> will look like a quote:</p>
|
||||
<blockquote>A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine.</blockquote>
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="lists">Lists</h2>
|
||||
{% set list = '[ul]\nitem 1\n\nitem 2\n\nitem 3 \nstill item 3 (break line without inserting a new item by using two spaces at the end of a line)\n[/ul]' %}
|
||||
<p>There are two kinds of lists, ordered (1, 2, 3, ...) and unordered (bullet points). Ordered lists are made with <code class="inline-code">[ol][/ol]</code> tags, and unordered with <code class="inline-code">[ul][/ul]</code>. Every new paragraph according to the <a href="#paragraph-rules">usual paragraph rules</a> will create a new list item. For example:</p>
|
||||
@@ -155,7 +155,7 @@
|
||||
Will produce the following list:
|
||||
{{ list | babycode | safe }}
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="spoilers">Spoilers</h2>
|
||||
{% set spoiler = "[spoiler=Major Metal Gear Spoilers]Snake dies[/spoiler]" %}
|
||||
<p>You can make a section collapsible by using the <code class="inline-code">[spoiler]</code> tag:</p>
|
||||
@@ -164,7 +164,7 @@
|
||||
{{ spoiler | babycode | safe }}
|
||||
All other tags are supported inside spoilers.
|
||||
</section>
|
||||
<section class="babycode-guide-section">
|
||||
<section class="guide-section">
|
||||
<h2 id="mentions">Mentioning users</h2>
|
||||
<p>You can mention users by their username (<em>not</em> their display name) by using <code class="inline-code">@username</code>. A user's username is always shown below their avatar and display name on their posts and their user page.</p>
|
||||
<p>A mention will show up on your post as a clickable box with the user's display name if they have one set or their username with an <code class="inline-code">@</code> symbol if they don't:</p>
|
||||
|
||||
@@ -984,14 +984,14 @@ textarea {
|
||||
margin-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-section {
|
||||
.guide-section {
|
||||
background-color: #c1ceb1;
|
||||
padding: 5px 20px;
|
||||
border: 1px solid black;
|
||||
padding-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-container {
|
||||
.guide-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 300px;
|
||||
grid-template-rows: 1fr;
|
||||
|
||||
@@ -984,14 +984,14 @@ textarea {
|
||||
margin-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-section {
|
||||
.guide-section {
|
||||
background-color: #231c23;
|
||||
padding: 5px 20px;
|
||||
border: 1px solid black;
|
||||
padding-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-container {
|
||||
.guide-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 300px;
|
||||
grid-template-rows: 1fr;
|
||||
|
||||
@@ -984,14 +984,14 @@ textarea {
|
||||
margin-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-section {
|
||||
.guide-section {
|
||||
background-color: #f27a5a;
|
||||
padding: 3px 12px;
|
||||
border: 1px solid black;
|
||||
padding-right: 25%;
|
||||
}
|
||||
|
||||
.babycode-guide-container {
|
||||
.guide-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 300px;
|
||||
grid-template-rows: 1fr;
|
||||
|
||||
@@ -861,24 +861,24 @@ $thread_info_post_preview_margin_right: $post_inner_padding_right !default;
|
||||
margin-right: $thread_info_post_preview_margin_right;
|
||||
}
|
||||
|
||||
$babycode_guide_section_background: $ACCENT_COLOR !default;
|
||||
$babycode_guide_section_padding: $SMALL_PADDING $BIG_PADDING !default;
|
||||
$babycode_guide_section_border: $DEFAULT_BORDER !default;
|
||||
$babycode_guide_section_padding_right: $post_inner_padding_right !default;
|
||||
.babycode-guide-section {
|
||||
background-color: $babycode_guide_section_background;
|
||||
padding: $babycode_guide_section_padding;
|
||||
border: $babycode_guide_section_border;
|
||||
padding-right: $babycode_guide_section_padding_right;
|
||||
$guide_section_background: $ACCENT_COLOR !default;
|
||||
$guide_section_padding: $SMALL_PADDING $BIG_PADDING !default;
|
||||
$guide_section_border: $DEFAULT_BORDER !default;
|
||||
$guide_section_padding_right: $post_inner_padding_right !default;
|
||||
.guide-section {
|
||||
background-color: $guide_section_background;
|
||||
padding: $guide_section_padding;
|
||||
border: $guide_section_border;
|
||||
padding-right: $guide_section_padding_right;
|
||||
}
|
||||
|
||||
$babycode_guide_toc_width: 300px !default;
|
||||
$babycode_guide_column_guide: $ZERO_PADDING !default;
|
||||
.babycode-guide-container {
|
||||
$guide_toc_width: 300px !default;
|
||||
$guide_column_guide: $ZERO_PADDING !default;
|
||||
.guide-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr $babycode_guide_toc_width;
|
||||
grid-template-columns: 1.5fr $guide_toc_width;
|
||||
grid-template-rows: 1fr;
|
||||
gap: $babycode_guide_column_guide;
|
||||
gap: $guide_column_guide;
|
||||
grid-auto-flow: row;
|
||||
grid-template-areas:
|
||||
"guide-topics guide-toc";
|
||||
@@ -889,21 +889,21 @@ $babycode_guide_column_guide: $ZERO_PADDING !default;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
$babycode_guide_toc_padding: $MEDIUM_PADDING !default;
|
||||
$babycode_guide_toc_background: $BUTTON_COLOR !default;
|
||||
$babycode_guide_toc_border_radius: 8px !default;
|
||||
$babycode_guide_toc_border: $DEFAULT_BORDER !default;
|
||||
$guide_toc_padding: $MEDIUM_PADDING !default;
|
||||
$guide_toc_background: $BUTTON_COLOR !default;
|
||||
$guide_toc_border_radius: 8px !default;
|
||||
$guide_toc_border: $DEFAULT_BORDER !default;
|
||||
.guide-toc {
|
||||
grid-area: guide-toc;
|
||||
position: sticky;
|
||||
top: 100px;
|
||||
align-self: start;
|
||||
padding: $babycode_guide_toc_padding;
|
||||
border-bottom-right-radius: $babycode_guide_toc_border_radius;
|
||||
background-color: $babycode_guide_toc_background;
|
||||
border-right: $babycode_guide_toc_border;
|
||||
border-top: $babycode_guide_toc_border;
|
||||
border-bottom: $babycode_guide_toc_border;
|
||||
padding: $guide_toc_padding;
|
||||
border-bottom-right-radius: $guide_toc_border_radius;
|
||||
background-color: $guide_toc_background;
|
||||
border-right: $guide_toc_border;
|
||||
border-top: $guide_toc_border;
|
||||
border-bottom: $guide_toc_border;
|
||||
}
|
||||
|
||||
.emoji-table tr td {
|
||||
|
||||
@@ -59,8 +59,8 @@ $br: 8px;
|
||||
|
||||
$post_accordion_content_background: #2d212d,
|
||||
|
||||
$babycode_guide_toc_background: #3c233c,
|
||||
$babycode_guide_section_background: $dark_accent,
|
||||
$guide_toc_background: #3c233c,
|
||||
$guide_section_background: $dark_accent,
|
||||
|
||||
$text_input_background: #371e37,
|
||||
$text_input_background_focus: #514151,
|
||||
|
||||
Reference in New Issue
Block a user