This page will explain how to format your content to fit the standard used by this website.
:::important
iR Engine documentation uses a very restricted set of GitHub Markdown for formatting its content.
Multitude of otherwise perfectly legal markdown rules are strictly forbidden by this standard.
Please make sure to pay extra attention to these rules if you are already accustomed to markdown syntax. :::
Markdown is a really powerful and easy to use alternative to html.
It has a very intuitive and easy to understand syntax that can also give format to text in a similar level to how html can.
One of its key features is how flexible it is.
But, at the same time, this flexibility is also its biggest problem.
Maintaining a cohesive format across a team with different users/writers that all have their own unique quirks and style for writing markdown, and all contribute to a project of the size of iR Engine's Documentation (this website), is extremely challenging without having a single and unified standard.
Compressing the wide range of styling and formatting options that Markdown offers, down into a very minimal and simplified ruleset, pretty much solves the problem altogether.
As such, this standard aims to be as minimal, simple and intuitive to use as possible.
Markdown itself is very simple, but this standard simplifies it even further.
Every syntax rule will allow for only one single and unified way of using it.
:::note This ruleset aims to achieve a clean and cohesive codebase that won't look internally messy, and/or have to be refactored to fit the website's quality standard every time a different contributor pushes new content into the site.
It might feel very limiting and restricting if you already have developed your own workflow or quirks on how to write markdown syntax. But please remember how important it is to have a cohesive ruleset when working on a project of the size of this website. :::
This website uses a very restricted and minimal subset of GitHub Markdown (GFM).
Writing markdown with the standard explaned in this article will feel a lot stricter than usual.
Because of this, every rule will have a tab listing the (otherwise legal) syntax alternatives that GFM permits but we don't use.
Every <
character MUST be escaped (like \<
).
Reason: Docusaurus interprets .md
files as MDX.
This means that all instances of <Something>
will be interpreted as a JSX/TSX component.
:::danger
Not respecting this rule will make Docusaurus completely fail at compiling the website.
This is the most likely cause of CI errors when pushing your content for the first time.
:::
Use admonitions for giving side notes, tips and/or warning the user about things that could cause problems for them.
Here is the complete list of Admonition types and how to use them.
:::note
This note contains side information that is useful for the user, but shouldn't distract them from the main body of content.
:::
:::important
This block contains information of high importance that the user should pay attention to.
:::
:::tip
This block contains information that the user COULD be informed about, as it might make their life easier when followed.
:::
:::warning
This block contains information that the user SHOULD be warned about, as it might create problems for them.
:::
:::danger
This block contains information that the user MUST be warned about, as it will create problems for them when ignored.
:::
Custom Admonitions:
:::note[Admonitions can have custom titles and even Links]
Remember that admonitions can have custom titles that accept markdown syntax as usual.
Don't overuse this feature, but remember that it can be very helpful depending on the situation.
:::
:::note[Admonitions can have custom titles and even [Links](https://www.etheralengine.com)]
Remember that admonitions can have custom titles that accept markdown syntax as usual.
Don't overuse this feature, but remember that it can be very helpful depending on the situation.
:::
Note:
> ```Note:``` This note contains side information that is useful for the user, but that shouldn't distract them from the main body of the content.
Note:
This note contains side information that is useful for the user, but that shouldn't distract them from the main body of the content.
Important:
> ```Important:``` This block contains information of high importance that the user **should** pay attention to.
Important:
This block contains information of high importance that the user should pay attention to.
Tip:
> ```Tip:``` This block contains information that the user COULD be informed about, as it **might** make their life easier when followed.
Tip:
This block contains information that the user COULD be informed about, as it might make their life easier when followed.
Warning:
> ```Warning:``` This block contains information that the user SHOULD be warned about, as it **might** create problems for them.
Warning:
This block contains information that the user SHOULD be warned about, as it might create problems for them.
Danger:
> ```Danger:``` This block contains information that the user MUST be warned about, as it **will** create problems for them when ignored.
Danger:
This block contains information that the user MUST be warned about, as it will create problems for them when ignored.
Pages must start their first title with # Title
, not ## Title
or ### Title
.
Reasoning:
Title1
======
Title2
------
:::note
Our configuration stops listing sub-sections in its Table of Contents sidebar at <h5>
.
:::
Align the first line of a section right up next to its title.
Separating sections with two empty lines between them is preferrable.
Reasoning:
# Title1
Each section's first line must be close to its title.
Second line of this section.
## Title2
This line is also close to its title.
We also separated the sections with two empty lines, which is not mandatory but useful.
# Title1
This section's first line has a space separating the line from its title.
Second line of this section.
## Title2
This line is also not close to its title.
Too many line separations make the page less readable in markdown format.
Titles can have a Heading ID different than its default.
Use them only when you know the id will be linked to in multiple other places and:
- Its default ID is prone to typing errors
(eg: the title contains strange characters, its name is misleading, etc) - The ID is an important reference that could be memorized
- The ID is temporary and will change (not might change)
- The ID is very long, and cannot be shorter / more concise
`### Very Long Title Name {#short-id}`
This title will have its direct link as `URL/path/to/page#short-id`
`### Very Long Title Name`
This title will be linked by default as `URL/path/to/page#very-long-title-name`
End lines with double space
for newline breaks within the same paragraph.
Reasoning:
`_ :::
This is a line in another paragraph, separated from the other lines by leaving an empty line in between.
This is a line that does not end with
.
This second line will be appended to the previous one, without any <br>
line breaks between them.
This line is separate from the other lines. It is not affected by the
rule.
All.
of.
these.
words.
are.
written.
in.
separate.
lines.
This is a clear and simple sentence.
This is another sentence that is also clear and simple.
This third sentence is also clear, simple, and should also be a separate line.
This fourth sentence already becomes really hard to conceptually separate from the others, just because line breaks were not used.
By this sentence, if the concepts were important to remember, you are already struggling to pay attention to this block of text and remember each individual concept, even if each sentence was clear, simple and easy to read individually.
All of the sentences in this block of code were written in separate lines without using
at the end of each.
All.
of.
these.
words.
are.
written.
in.
separate.
lines.
This is a clear and simple sentence.
This is another sentence that is also clear and simple.
This third sentence is also clear, simple, and should also be a separate line.
This fourth sentence already becomes really hard to conceptually separate from the others, just because line breaks were not used.
By this sentence, if the concepts were important to remember, you are already struggling to pay attention to this block of text and remember each individual concept, even if each sentence was clear, simple and easy to read individually.
All of the sentences in this block of code were written in separate lines without using ` ` at the end of each.
Reasoning:
Reasoning:
` in html. Makes more sense to already format them that way with markdown syntax. - **Bold Titles**: formatted with `:` outside bold is a small adjustment with apparently little gain. Its goal is to make titles a bit cleaner and more readable in both markdown and rendered html.
- Code blocks must always define a language, even if that language is just ```text.
- Code blocks for programming languages must always add the
showLineNumbers
directive on their title. - Code blocks should define a
title="/path/to/file.ext"
if possible.
/**
- @description This is a documentation comment.
- @note JSdoc/TSdoc tags are also syntax hightlighted. */ function someFunction(arg1 :Type1, arg2 :Type2) :void { const one :string= 'This is a thing' return; }
</TabItem>
<TabItem value="incorrect-codeblock" label="Valid but Not-Allowed">
// This codeblock does not define a title, so it doesn't get a label.
// It does not define the showLineNumbers
directive, so lines are not numbered.
// It also gets no highlighting because it didn't define a language
/**
- @description This is a documentation comment.
- @note JSdoc/TSdoc tags are also syntax hightlighted. */ function someFunction(arg1 :Type1, arg2 :Type2) :void { const one :string= 'This is a thing' return; }
</TabItem>
</Tabs>
<details>
<summary>Reasoning:</summary>
<div>
Single and simple rule: Always add a language to any block of code.
- Syntax highlighting makes code a lot easier to read.
- Giving a language, even when its just `text`, makes the writing workflow more consistent across the entire codebase.
Giving a title and adding line numbers to codeblocks makes their presentation look a lot better and easier to understand and/or reference.
</div>
</details>
<br></br>
### Code: Inline
- Inline code should be avoided as much as possible.
A proper syntax-highlighed codeblock should be used instead.
Only use inline code for highlighting text with a monospaced font.
- Inline code syntax must use single \` characters.
_Example_: \`this-is-code\` turns into `this-is-code`
- Triple \`\`\` inline syntax is not allowed.
<details>
<summary>Reasoning:</summary>
<div>
- Proper \`\`\`bash codeblocks, as those mentioned in the [previous section](#codeblock), are much more readable and clear.
- The syntax \`\`\`some bash command\`\`\` is unnecessarily complex for achieving the exact same result as single \` characters does.
- Triple \`\`\` syntax is strictly reserved for codeblocks.
</div>
</details>
<br></br>
### #todo lists
<Tabs>
<TabItem value="todo-html" label="Rendered">
- [ ] Task 1
- [x] Task 1.1
- [ ] Task 1.2
- [ ] Task 2
</TabItem>
<TabItem value="todo-md" label="Markdown">
```md
- [ ] Task 1
- [x] Task 1.1
- [ ] Task 1.2
- [ ] Task 2
Reasoning:
:::note[rule overlap]
*
could be changed for use in bullet points, which would free -
to be used just for todo lists.
But *
is reserved for bold with **
for simplicity, since bold text is used a lot more often.
That leaves us with this overlap of -
being used for todo-lists and also for bullet point entries.
:::