{% extends "trix_student/base.django.html" %} {% load i18n %} {% block title %} {% trans "Markdown help" %} {% endblock title %} {% block pageheader-inner %}

{% trans "Markdown help" %}

{% endblock pageheader-inner %} {% block content %}

{% trans "Heading" %}

{% blocktranslate trimmed %} To create a heading, add one or more # symbols before your heading text. The number of # symbols will determine the heading size. One # symbol is the largest heading, and six # symbols is the smallest heading. {% endblocktranslate %}

{% trans "Example heading level 1" %}:

            # Heading 1
        

{% trans "Example heading level 3" %}:

            ### Heading 3
        

{% trans "Styling text" %}

{% blocktranslate trimmed %} You can style simple words or sentences with inlined bold or italic styling. {% endblocktranslate %}

{% trans "Bold" %}

{% blocktranslate trimmed %} Add two * symbols before and after the text you want bold formatting for. {% endblocktranslate %}

{% trans "Example" %}:

            **Bold text**
        

{% trans "Italic" %}

{% blocktranslate trimmed %} Add one _ symbol before and after the text you want italic formatting for. {% endblocktranslate %}

{% trans "Example" %}:

            _Italic text_
        

{% blocktranslate trimmed %} To format links, add a starting bracket symbol and a closing bracket symbol encapsulating the link-text. Directly follow this with a starting parantheses symbol and a closing parantheses symbol encapsulating the actual link address. {% endblocktranslate %}

{% trans "Example" %}:

            [My link text](https://www.devilry.test)
        

{% trans "Code" %}

{% blocktranslate trimmed %} Mark a short snippet of text to call it out as code with single backticks. The text encapsulated by the backticks will be formatted as a inline piece of code. {% endblocktranslate %}

{% trans "Example" %}:

            `ls -l`
        

{% blocktranslate trimmed %} To format code or text into its own distinct block, use three backticks instead. {% endblocktranslate %}

{% trans "Example" %}:

            ```
            ls -l
            cd /some/folder
            ls -l
            ````
        

{% blocktranslate trimmed %} To add syntax hilighting to the code block, add the language on the first line: {% endblocktranslate %}

```python
class Hello:
    def __init__(self, what):
        self.what = what

    def hello(self):
        print(f"Hello {what} world")
```

{% blocktranslate trimmed %} The available languages are those supported by the pygments python library. For most languages, you simply use the name of the language. The full list is available here: {% endblocktranslate %} https://pygments.org/docs/lexers/ ("Short names").

{% trans "Code diff" %}

{% blocktranslate trimmed %} Use the syntax shown in the example below to show code diffs. {% endblocktranslate %}

{% trans "Example" %}:

##<##
def Hello(self, x):
    print(f'Hello')
    print('World')
##>##
def hello(self, x):
    print(f'Hello {x}')
    print('World')
##<##

The result will be a diff view that can be used to show the difference between the two code snippets in 3 different diff layouts (simple, compact and side-by-side). By default, we show the simple style on "load", but you can tune this with a keyword at the end of the first line (the keyword can be: simple, compact or sidebyside):

### DIFF With the compact style by default:

##<## compact
def Hello(self, x):
    print(f'Hello')
    print('World')
##>##
def hello(self, x):
    print(f'Hello {x}')
    print('World')
##<##

### DIFF With the sidebyside style by default:

##<## sidebyside
def Hello(self, x):
    print(f'Hello')
    print('World')
##>##
def hello(self, x):
    print(f'Hello {x}')
    print('World')
##<##

{% trans "Warning:" %}{% trans "Switching diff styles does not work in markdown preview window/tab." %}

{% trans "Latex math" %}

{% blocktranslate trimmed %} You can add latex math using the $math$ $/math$ or $mathblock$ $/mathblock$ tags. {% endblocktranslate %}

{% trans "Example" %}:

### Inline latex math example
This is an inline latex example $math$c = \pm\sqrt{a^2 + b^2}$/math$ with some extra text behind!

### Block latex math example
This is a block latex example:
$mathblock$
c = \pm\sqrt{a^2 + b^2}
$/mathblock$
with some extra text below.

{% trans "Lists" %}

{% blocktranslate trimmed %} Make an unordered list by preceding one or more lines of text with * symbol. {% endblocktranslate %}

{% trans "Example" %}:

            - List item 1
            - List item 2
            - List item 3
        

{% blocktranslate trimmed %} If you want to order a list, precede each line with a number. {% endblocktranslate %}

{% trans "Example" %}:

            1. List item 1
            2. List item 2
            3. List item 3
        

{% trans "Nested lists" %}

{% blocktranslate trimmed %} A nested list can be created by indenting one or more list items below another item with 4 spaces. {% endblocktranslate %}

{% trans "Example" %}:

            1. List item 1
                * Nested item 1
                    * Nested item 2
        
{% endblock content %}