Skip to content

Commit 112a0de

Browse files
committed
Add list styling
1 parent a431832 commit 112a0de

File tree

3 files changed

+279
-11
lines changed

3 files changed

+279
-11
lines changed

docs/docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ toc:
6868
- file: file_inclusion.md
6969
- file: frontmatter.md
7070
- file: images.md
71+
- file: lists.md
7172
- file: line_breaks.md
7273
- file: links.md
7374
- file: passthrough.md

docs/syntax/lists.md

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# Lists
2+
3+
You can organize items into ordered and unordered lists.
4+
- because this
5+
- is a list
6+
- of items
7+
8+
## Basic Lists
9+
10+
### Unordered List
11+
12+
Unordered lists are created by starting each line with a hyphen `-`, asterisk `*`, or plus sign `+`.
13+
14+
::::{tab-set}
15+
16+
:::{tab-item} Output
17+
18+
- Item 1
19+
- Item 2
20+
- Item 3
21+
22+
:::
23+
24+
25+
:::{tab-item} Markdown
26+
27+
```markdown
28+
- Item 1
29+
- Item 2
30+
- Item 3
31+
```
32+
33+
:::
34+
35+
36+
::::
37+
38+
### Ordered List
39+
40+
Ordered lists are created by starting each line with a number followed by a period.
41+
42+
::::{tab-set}
43+
44+
:::{tab-item} Output
45+
46+
1. Item 1
47+
2. Item 2
48+
3. Item 3
49+
50+
:::
51+
52+
53+
:::{tab-item} Markdown
54+
55+
```markdown
56+
1. Item 1
57+
2. Item 2
58+
3. Item 3
59+
```
60+
61+
:::
62+
63+
64+
::::
65+
66+
67+
## Nested Lists
68+
69+
When you want to create a nested list within a list item, indent the nested list by four spaces.
70+
71+
### Nested Unordered List
72+
73+
::::{tab-set}
74+
75+
:::{tab-item} Output
76+
77+
- Item 1
78+
- Item 2
79+
- Subitem 1
80+
- Subitem 2
81+
- Subsubitem 1
82+
- Subsubitem 2
83+
- Item 3
84+
85+
:::
86+
87+
88+
:::{tab-item} Markdown
89+
90+
```markdown
91+
- Item 1
92+
- Item 2
93+
- Subitem 1
94+
- Subitem 2
95+
- Subsubitem 1
96+
- Subsubitem 2
97+
- Item 3
98+
```
99+
100+
:::
101+
102+
103+
::::
104+
105+
### Nested Ordered Lists
106+
107+
::::{tab-set}
108+
109+
:::{tab-item} Output
110+
111+
1. Item 1
112+
2. Item 2
113+
1. Subitem 1
114+
2. Subitem 2
115+
1. Subsubitem 1
116+
2. Subsubitem 2
117+
3. Item 3
118+
119+
:::
120+
121+
122+
:::{tab-item} Markdown
123+
124+
```markdown
125+
1. Item 1
126+
2. Item 2
127+
1. Subitem 1
128+
2. Subitem 2
129+
1. Subsubitem 1
130+
2. Subsubitem 2
131+
3. Item 3
132+
```
133+
134+
:::
135+
136+
137+
::::
138+
139+
### Nested Mixed Lists
140+
141+
::::{tab-set}
142+
143+
:::{tab-item} Output
144+
145+
1. Item 1
146+
2. Item 2
147+
- Subitem 1
148+
- Subitem 2
149+
1. Subsubitem 1
150+
2. Subsubitem 2
151+
1. Subsubsubitem 1
152+
2. Subsubsubitem 2
153+
3. Item 3
154+
- Subitem 1
155+
- Subitem 2
156+
- Subsubitem 1
157+
- Subsubitem 2
158+
- Subsubsubitem 1
159+
- Subsubsubitem 2
160+
161+
:::
162+
163+
164+
:::{tab-item} Markdown
165+
166+
```markdown
167+
1. Item 1
168+
2. Item 2
169+
- Subitem 1
170+
- Subitem 2
171+
1. Subsubitem 1
172+
2. Subsubitem 2
173+
1. Subsubsubitem 1
174+
2. Subsubsubitem 2
175+
3. Item 3
176+
- Subitem 1
177+
- Subitem 2
178+
- Subsubitem 1
179+
- Subsubitem 2
180+
- Subsubsubitem 1
181+
- Subsubsubitem 2
182+
```
183+
184+
:::
185+
186+
187+
::::
188+
189+
190+
## Content within a List Item
191+
192+
You can include any type of content within a list item, such as paragraphs, code blocks, or images.
193+
To include a paragraph of text within a list item, indent the content by four spaces.
194+
195+
::::::{tab-set}
196+
197+
::::{tab-item} Output
198+
199+
1. This is a list item with a paragraph of text.
200+
201+
This is a `paragraph` of text within a list item.
202+
203+
2. This is a list item with a code block:
204+
205+
```bash
206+
echo "Hello, World!"
207+
```
208+
209+
3. This is a list item with an image:
210+
211+
![Image](./img/apm.png)
212+
213+
4. This is a list item with an admonition:
214+
215+
:::{note}
216+
This is a note within a list item.
217+
:::
218+
219+
::::
220+
221+
::::{tab-item} Markdown
222+
```markdown
223+
1. This is a list item with a paragraph of text.
224+
225+
This is a `paragraph` of text within a list item.
226+
227+
2. This is a list item with a code block:
228+
229+
```bash
230+
echo "Hello, World!"
231+
```
232+
233+
3. This is a list item with an image:
234+
235+
![Image](./img/apm.png)
236+
237+
4. This is a list item with an admonition:
238+
239+
:::{note}
240+
This is a note within a list item.
241+
:::
242+
```
243+
::::
244+
245+
:::::
Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,47 @@
11
.markdown-content {
22
ol,ul {
33
font-family: "Inter", sans-serif;
4-
@apply text-base text-body mt-6;
4+
@apply mt-4;
55
line-height: 1.5em;
66
letter-spacing: 0;
77
margin-left: 1.5em;
8+
/*list-style-position: inside;*/
9+
li::marker {
10+
@apply font-mono text-grey-80;
11+
}
812
}
913

10-
ol {
11-
list-style-type: decimal;
14+
ul li {
15+
@apply pl-[.5ch];
1216
}
1317

14-
ul {
15-
list-style-type: disc;
18+
li>ul, li>ol {
19+
@apply mt-1;
1620
}
17-
21+
1822
li {
19-
@apply first:mt-0 mt-2;
20-
21-
p {
22-
margin-bottom: 0;
23-
}
23+
@apply first:mt-0 mt-1;
24+
}
25+
26+
ul {list-style-type: disc; }
27+
ul>li>ul { list-style-type: square; }
28+
ul>li>ul>li>ul { list-style-type: circle; }
29+
ul>li>ul>li>ul>li>ul { list-style-type: disc; }
30+
ul>li>ul>li>ul>li>ul>li>ul { list-style-type: square; }
31+
ul>li>ul>li>ul>li>ul>li>ul>li>ul { list-style-type: circle; }
32+
33+
ol { list-style-type: decimal; }
34+
ol>li>ol { list-style-type: lower-alpha; }
35+
ol>li>ol>li>ol { list-style-type: lower-roman; }
36+
ol>li>ol>li>ol>li>ol { list-style-type: decimal; }
37+
ol>li>ol>li>ol>li>ol>li>ol { list-style-type: lower-alpha; }
38+
ol>li>ol>li>ol>li>ol>li>ol>li>ol { list-style-type: lower-roman; }
39+
40+
/* Special handling of elements within a list item */
41+
li>p:nth-child(2),
42+
li>div>.highlight,
43+
li>.admonition
44+
{
45+
@apply mt-1;
2446
}
2547
}

0 commit comments

Comments
 (0)