You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addresses #3255
This PR implements column extension into `gnoweb` following this format:
```
-- input.md --
<gno-columns>
## Title 1
content 1
## Title 2
content 2
</gno-columns>
```
### Notes
- Check `testdatas` files for example of input/output
- i've also added an example in `/r/demo/mardown_test` that need to be
improved with usage, example and description (cc @leohhhn)
### Preview
#### example output code

#### example with images (empty heading)

### TODO
- [x] In order to support headings without creating columns, we probably
want to use the first heading as a reference for column separator
- [x] More edge cases for tests
- [x] Add css to correctly render column in gnoweb (cc @alexiscolin )
---------
Signed-off-by: gfanton <[email protected]>
Co-authored-by: alexiscolin <[email protected]>
Copy file name to clipboardExpand all lines: examples/gno.land/r/docs/markdown/markdown.gno
+161-7
Original file line number
Diff line number
Diff line change
@@ -48,11 +48,11 @@ You can format text using the following syntax:
48
48
***All bold and italic***
49
49
±±±
50
50
51
-
**Bold text**
52
-
*Italic text*
53
-
~~Strikethrough text~~
54
-
**Bold and _nested italic_**
55
-
***All bold and italic***
51
+
**Bold text**
52
+
*Italic text*
53
+
~~Strikethrough text~~
54
+
**Bold and _nested italic_**
55
+
***All bold and italic***
56
56
57
57
### Links
58
58
@@ -63,7 +63,7 @@ Links can be created using the following syntax:
63
63
[Link with title](https://example.com "Link title")
64
64
±±±
65
65
66
-
[Link text](https://example.com)
66
+
[Link text](https://example.com)
67
67
[Link with title](https://example.com "Link title")
68
68
69
69
XXX: custom CSS for internal/external links and if possible for "in the same realm/namespace".
@@ -212,7 +212,161 @@ This approach allows for a more consistent rendering experience across different
212
212
213
213
### Columns
214
214
215
-
XXX: in progress in https://github.com/gnolang/gno/pull/3763
215
+
Gno Flavored Markdown introduces a column layout system using special HTML-like tags. This system allows content to be organized into multiple vertical columns using heading elements as separators.
216
+
On GnoWeb, up to four columns can be displayed in a single row; exceeding this limit will transfer additional columns to another row, and so on.
217
+
218
+
#### Basic Syntax
219
+
Wrap your column content in ±<gno-columns>± tags and use standard markdown headings (from h1 ±#± to h6 ±######±) to define column breaks:
220
+
221
+
±±±markdown
222
+
<gno-columns>
223
+
## Column 1 Title
224
+
225
+
Column 1 content
226
+
227
+
## Column 2 Title
228
+
229
+
Column 2 content
230
+
</gno-columns>
231
+
±±±
232
+
233
+
This will render as:
234
+
235
+
<gno-columns>
236
+
## Column 1 Title
237
+
238
+
Column 1 content
239
+
240
+
## Column 2 Title
241
+
242
+
Column 2 content
243
+
</gno-columns>
244
+
---
245
+
246
+
#### Key Features
247
+
248
+
1. **Heading Levels**: Any heading level from ±#± (h1) to ±######± (h6) can be used as column separators. The first one will be the reference for subsequent separator.
249
+
250
+
±±±markdown
251
+
<gno-columns>
252
+
# Main Section
253
+
254
+
Content
255
+
256
+
## Subsection
257
+
258
+
More content
259
+
260
+
# Second section
261
+
262
+
Content
263
+
264
+
## Subsection
265
+
266
+
More content
267
+
</gno-columns>
268
+
±±±
269
+
270
+
<gno-columns>
271
+
## Main Section
272
+
Content
273
+
### Subsection
274
+
More content
275
+
## Second section
276
+
Content
277
+
### Subsection
278
+
More content
279
+
</gno-columns>
280
+
281
+
---
282
+
283
+
2. **Empty Headings**: Use empty headings to create columns without titles:
0 commit comments