Skip to content

Commit 7baf876

Browse files
authored
Add list styling (#531)
* Add list styling * Cleanup
1 parent 2733263 commit 7baf876

File tree

3 files changed

+276
-11
lines changed

3 files changed

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