Skip to content

Commit c430d3d

Browse files
committed
Enhance code block documentation in Typography.md and update mkdocs.yml for improved features
1 parent ab2f900 commit c430d3d

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

docs/Typography.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,41 @@ Term 2
5050

5151

5252
# Code Block
53+
54+
## Regular
5355
```python
5456
# This is a code block
5557
print("Hello, World!")
5658
```
5759

60+
## With Title
61+
``` py title="bubble_sort.py"
62+
def bubble_sort(items):
63+
for i in range(len(items)):
64+
for j in range(len(items) - 1 - i):
65+
if items[j] > items[j + 1]:
66+
items[j], items[j + 1] = items[j + 1], items[j]
67+
```
68+
69+
## Line Numbers
70+
With line numbers
71+
``` py linenums="1"
72+
def bubble_sort(items):
73+
for i in range(len(items)):
74+
for j in range(len(items) - 1 - i):
75+
if items[j] > items[j + 1]:
76+
items[j], items[j + 1] = items[j + 1], items[j]
77+
```
78+
79+
## Highlight specific lines
80+
``` py hl_lines="2 3"
81+
def bubble_sort(items):
82+
for i in range(len(items)):
83+
for j in range(len(items) - 1 - i):
84+
if items[j] > items[j + 1]:
85+
items[j], items[j + 1] = items[j + 1], items[j]
86+
```
87+
5888
# Links
5989
- [GitHub](https://github.com)
6090
- [Youtube](https://github.com)

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ theme:
3333
icon: material/brightness-7
3434
name: Switch to dark mode
3535
features:
36-
- content.action.edit
37-
- content.action.view
36+
- content.action.edit # Allows "Edit on GitHub" links
37+
- content.action.view # Allows "View on GitHub" links
38+
- content.code.copy # Allows code blocks to have a copy button
3839
icon:
3940
repo: fontawesome/brands/git-alt
4041
edit: material/pencil

0 commit comments

Comments
 (0)