Formatting
code blocks
Plain code block
Python import sys
for path in sys . path :
print ( path )
admonition or callout
see the documentation .
This is the admonition title of a note
body
Markdown !!! note "This is the admonition title of a `note` "
body
this is a info
admonition
This is the admonition body
Markdown !!! info "this is a `info` admonition"
This is the admonition body
collapsable admonition - closed by default
you can close me.
Markdown ??? note "collapsable admonition - closed by default"
you can close me.
collapsable admonition - opened by default
you can close me.
Markdown ???+ note "collapsable admonition - opened by default"
you can close me.
grid cards
see docs
HTML for content and structure
JavaScript for interactivity
CSS for text running out of boxes
Internet Explorer ... huh?
Run using:
Markdown <div class="grid cards" markdown>
- :fontawesome-brands-html5: __HTML__ for content and structure
- :fontawesome-brands-js: __JavaScript__ for interactivity
- :fontawesome-brands-css3: __CSS__ for text running out of boxes
- :fontawesome-brands-internet-explorer: __Internet Explorer__ ... huh?
</div>
Cards are not displayed in vscode editor, nor Obsidian.
linenums
For showing line numbers in code and for highlighting code lines.
See docs
Python def bubble_sort ( items ):
for i in range ( len ( items )):
for j in range ( len ( items ) - 1 - i ):
if items [ j ] > items [ j + 1 ]:
items [ j ], items [ j + 1 ] = items [ j + 1 ], items [ j ]
Rendered from this code:
Markdown ``` py linenums="1"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
Python def bubble_sort ( items ):
for i in range ( len ( items )):
for j in range ( len ( items ) - 1 - i ):
if items [ j ] > items [ j + 1 ]:
items [ j ], items [ j + 1 ] = items [ j + 1 ], items [ j ]
Rendered from this code:
Markdown ``` py hl_lines="2 3"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
Lines colors and numbers are not rendered in editor/obsidian.
tabbed
see docs
rendered from this markdown code:
Markdown 1
2
3
4
5
6
7
8
9
10
11
12
13
14 === "Source"
```python
from sandbox.calculations import Two_numbers
nums = Two_numbers ( 4 , 2 )
print ( f ' { nums . add () =} ' )
```
=== "Result"
```
nums.add()=6.0
```