markdown.gno
26.60 Kb · 914 lines
1package markdown
2
3import "strings"
4
5// this package can be used to test markdown rendering engines.
6
7func Render(path string) string {
8 output := `# Markdown on Gno
9
10## Introduction
11
12Markdown on Gno is based on standard markdown, but also has some unique features, making it the Gno Flavored Markdown. This document describes the current markdown support in Gno, demonstrating both the syntax and its rendered output.
13
14> [!NOTE]
15> Markdown support in Gno is still evolving. New features and improvements will be added in future releases.
16
17## Basic Syntax
18
19### Headings
20
21Headings are created using hash symbols (#). The number of hash symbols indicates the heading level.
22
23±±±markdown
24# Heading 1
25## Heading 2
26### Heading 3
27#### Heading 4
28##### Heading 5
29###### Heading 6
30±±±
31
32# Heading 1
33## Heading 2
34### Heading 3
35#### Heading 4
36##### Heading 5
37###### Heading 6
38
39### Text Formatting
40
41You can format text using the following syntax:
42
43±±±markdown
44**Bold text**
45*Italic text*
46~~Strikethrough text~~
47**Bold and _nested italic_**
48***All bold and italic***
49±±±
50
51**Bold text**
52*Italic text*
53~~Strikethrough text~~
54**Bold and _nested italic_**
55***All bold and italic***
56
57### Links
58
59Links can be created using the following syntax:
60
61±±±markdown
62[Link text](https://example.com)
63[Link with title](https://example.com "Link title")
64±±±
65
66[Link text](https://example.com)
67[Link with title](https://example.com "Link title")
68
69### Lists
70
71Unordered lists use asterisks, plus signs, or hyphens:
72
73±±±markdown
74* Item 1
75* Item 2
76 * Nested item 1
77 * Nested item 2
78±±±
79
80* Item 1
81* Item 2
82 * Nested item 1
83 * Nested item 2
84
85Ordered lists use numbers:
86
87±±±markdown
881. First item
892. Second item
90 1. Nested item 1
91 2. Nested item 2
92±±±
93
941. First item
952. Second item
96 1. Nested item 1
97 2. Nested item 2
98
99### Blockquotes
100
101Blockquotes are created using the > character:
102
103±±±markdown
104> This is a blockquote
105>
106>> It can span multiple lines
107±±±
108
109> This is a blockquote
110>
111>> It can span multiple lines
112
113### Code
114
115Inline code uses single backticks:
116
117±±±markdown
118Use ±func main()± to define the entry point.
119±±±
120
121Use ±func main()± to define the entry point.
122
123Code blocks use triple backticks with an optional language identifier:
124
125<!-- XXX: make the example with 'gno' instead of 'go' -->
126
127±±±markdown
128±±±go
129package main
130
131func main() {
132 println("Hello, Gno!")
133}
134±±±
135
136±±±go
137package main
138
139func main() {
140 println("Hello, Gno!")
141}
142±±±
143
144### Horizontal Rules
145
146Horizontal rules are created using three or more asterisks, hyphens, or underscores:
147
148±±±markdown
149---
150±±±
151
152---
153
154### Task Lists
155
156Gno supports task lists for tracking to-do items:
157
158±±±markdown
159- [x] Completed task
160- [ ] Pending task
161- [ ] Another pending task
162- [x] Another completed task
163±±±
164
165- [x] Completed task
166- [ ] Pending task
167- [ ] Another pending task
168- [x] Another completed task
169
170### Footnotes
171
172Gno supports footnotes for adding references and citations:
173
174±±±markdown
175Here is a sentence with a footnote[^1].
176
177[^1]: This is the footnote content.
178±±±
179
180Here is a sentence with a footnote[^1].
181
182[^1]: This is the footnote content.
183
184You can also use multiple footnotes in the same document:
185
186±±±markdown
187This is the first sentence with a footnote[^1].
188This is another sentence with a different footnote[^2].
189
190[^1]: First footnote content.
191[^2]: Second footnote content with more details.
192±±±
193
194This is the first sentence with a footnote[^1].
195This is another sentence with a different footnote[^2].
196
197[^1]: First footnote content.
198[^2]: Second footnote content with more details.
199
200## Tables
201
202Tables are created using pipes and hyphens:
203
204±±±markdown
205| Header 1 | Header 2 |
206| -------- | -------- |
207| Cell 1 | Cell 2 |
208| Cell 3 | Cell 4 |
209±±±
210
211| Header 1 | Header 2 |
212| -------- | -------- |
213| Cell 1 | Cell 2 |
214| Cell 3 | Cell 4 |
215
216## Images
217
218Images can be included using the following syntax:
219
220±±±markdown
221
222±±±
223
224
225
226Currently, only a short list of content providers are supported:
227
228±±±markdown
229// Gno-related hosts
230"https://gnolang.github.io"
231"https://assets.gnoteam.com"
232"https://sa.gno.services"
233
234// Other providers should respect DMCA guidelines
235// NOTE: Feel free to open a PR to add more providers here :)
236
237// imgur
238"https://imgur.com"
239"https://*.imgur.com"
240
241// GitHub
242"https://*.github.io"
243"https://github.com"
244"https://*.githubusercontent.com"
245
246// IPFS
247"https://ipfs.io"
248"https://cloudflare-ipfs.com"
249±±±
250
251
252## Gno-Specific Features
253
254### HTML Support
255
256By design, most typical HTML support is disabled in Gno's markdown implementation. This is an intentional decision for both security and ecosystem cohesion.
257
258While traditional markdown often allows arbitrary HTML tags, Gno Flavored Markdown takes a more controlled approach:
259
260- We may progressively whitelist certain HTML components or add custom ones over time
261- Our priority is to enhance our flavored markdown to natively support all essential components
262- We aim to eventually support all the initially HTML-supported features, but with syntax that is:
263 - More readable when viewing the source directly
264 - More integrable with custom browsers such as gnobro in CLI
265
266This approach allows for a more consistent rendering experience across different Gno interfaces while maintaining security and readability as core principles.
267
268### Columns
269
270Gno-Flavored Markdown introduces a column layout system that uses special tags. You can create columns with
271±<gno-columns>± blocks and separate the content with ±|||±.
272
273#### Basic Syntax
274±±±markdown
275<gno-columns>
276Left content
277
278|||
279
280Right content
281</gno-columns>
282±±±
283
284- Renders as:
285
286---
287
288<gno-columns>
289Left content
290
291|||
292
293Right content
294</gno-columns>
295
296---
297
298#### Key Features
299
3001. **Multiple Columns**:
301
302Depending on the screen size. A maximum of four rows can be displayed in
303one row.
304
305***Note**: Any overflow will result in items being displayed in the next row. Also, keep in mind that on smaller screens
306(e.g., phones), this overflow may occur with fewer elements.*
307
308±±±markdown
309<gno-columns>
310First column
311
312|||
313
314Second column
315
316|||
317
318Third column
319
320|||
321
322Fourth column
323
324|||
325
326Fifth column
327</gno-columns>
328±±±
329
330- Renders as:
331
332---
333
334<gno-columns>
335First column
336
337|||
338
339Second column
340
341|||
342
343Third column
344
345|||
346
347Fourth column
348
349|||
350
351Fifth column
352</gno-columns>
353
354---
355
3562. **Mixed Content**:
357
358Columns can be mixed with any markdown content
359
360***Note**: Nested columns are currently not possible*
361
362±±±markdown
363<gno-columns>
364### Text Section
365Paragraph with _formatting_
366
367|||
368
369My Image 
370</gno-columns>
371±±±
372
373- Renders as:
374
375---
376
377<gno-columns>
378### Text Section
379Paragraph with _formatting_
380
381|||
382
383My Image 
384</gno-columns>
385
386---
387
388### Forms
389
390Gno-Flavored Markdown introduces a secure form system that integrates directly with realms. The system uses custom HTML-like tags that are rendered with proper styling and validation.
391
392#### Basic Usage
393
394Create a form using the ±<gno-form>± tag and add inputs with ±<gno-input>±:
395
396±±±markdown
397<gno-form>
398 <gno-input name="name" placeholder="Enter your name" />
399 <gno-input name="email" placeholder="Enter your email" />
400</gno-form>
401±±±
402
403<gno-form>
404 <gno-input name="name" placeholder="Enter your name" />
405 <gno-input name="email" placeholder="Enter your email" />
406</gno-form>
407
408#### Form Structure
409
4101. **Form Container**
411 - Must start with ±<gno-form>± and end with ±</gno-form>±
412 - Optional attributes:
413 - ±path±: Render path after form submission (e.g. ±path="user"± will redirect to ±:user?[params]±)
414 - ±exec±: Specify a realm function to execute (e.g. ±exec="CreatePost"±).
415 When set, fields must be defined manually and their ±name± attributes must match the function's parameter names in the same order they appear in the function signature.
416 - Form data is always sent as query parameters
417 - Cannot be nested (forms inside forms are not allowed)
418 - Automatically includes a header showing the realm name
419
4202. **Input Fields**
421 - Created with ±<gno-input>± tag
422 - Attributes:
423 - ±name±: Unique identifier for the input (required)
424 - ±type±: Type of input (optional, defaults to "text")
425 - ±placeholder±: Hint text shown in the input (optional, defaults to "Enter value")
426 - ±value±: Default value for non-selectable inputs (optional)
427 - ±description±: Description of the input as title (optional - can be used as title for group of one or multiple inputs)
428 - Supported input types:
429 - ±type="text"± (default): For text input
430 - ±type="number"±: For numeric values only (with browser validation)
431 - ±type="email"±: For email addresses (with basic browser validation)
432 - ±type="tel"±: For phone numbers (no specific validation)
433 - ±type="password"±: For password input (masked characters)
434 - ±type="radio"±: For single selection from a group (requires ±value± attribute)
435 - ±type="checkbox"±: For multiple selections (requires ±value± attribute)
436 - Additional attributes for radio/checkbox:
437 - ±value±: The value to submit when selected (required for radio/checkbox)
438 - ±checked±: Set to "true" to pre-select the option (optional)
439 - Note: Input validation is handled by the browser's HTML5 validation
440 - Any other type will default to "text"
441 - Each input must have a unique name
442 - Inputs are rendered with labels and proper styling
443
4443. **Textarea Fields**
445 - Created with ±<gno-textarea>± tag
446 - Required attributes:
447 - ±name±: Unique identifier for the textarea (required)
448 - ±placeholder±: Hint text shown in the textarea (optional, defaults to "Enter value")
449 - Optional attributes:
450 - ±value±: Default content for the textarea (optional)
451 - ±rows±: Number of visible rows (2-10, defaults to 4)
452 - Perfect for longer text input like messages, descriptions, or comments
453 - Each textarea must have a unique name
454 - Textareas are rendered with labels and proper styling
455
4564. **Select Fields**
457 - Created with ±<gno-select>± tag (similar to radio buttons)
458 - Required attributes:
459 - ±name±: Unique identifier for the select group (required). Use underscores to separate words.
460 - ±value±: The value to submit and display text (required)
461 - Optional attributes:
462 - ±description±: Description of the select group (optional)
463 - ±selected±: Set to "true" to pre-select the option (optional)
464 - Multiple ±<gno-select>± elements with the same ±name± form a select group
465 - All options with the same ±name± form a group where only one can be selected
466 - The ±value± attribute serves both as the submitted value and the displayed text
467
468#### Example Use Cases
469
4701. Form with Path and Query Parameters
471±±±markdown
472<gno-form path="user">
473 <gno-input name="username" type="text" placeholder="Enter username" />
474 <gno-input name="age" type="number" placeholder="Your age" />
475</gno-form>
476±±±
477
478<gno-form path="user">
479 <gno-input name="username" type="text" placeholder="Enter username" />
480 <gno-input name="age" type="number" placeholder="Your age" />
481</gno-form>
482
483This form will submit to ±:user?username=value&age=value± on the same realm.
484
4852. Form with Query Parameters Only
486±±±markdown
487<gno-form>
488 <gno-input name="recipient" type="text" placeholder="Enter recipient address" description="Recipient Information" />
489 <gno-input name="email" type="email" placeholder="Your email" />
490 <gno-input name="pswd" type="password" placeholder="Your password" />
491</gno-form>
492±±±
493
494<gno-form>
495 <gno-input name="recipient" type="text" placeholder="Enter recipient address" description="Recipient Information" />
496 <gno-input name="email" type="email" placeholder="Your email" />
497 <gno-input name="pswd" type="password" placeholder="Your password" />
498</gno-form>
499
500This form will submit to ±?recipient=value&email=value&pswd=value± on the same realm.
501
5023. Form with Radio Buttons
503±±±markdown
504<gno-form>
505 <gno-input name="color" type="radio" value="blue" description="What is your favorite color?" />
506 <gno-input name="color" type="radio" value="red" />
507 <gno-input name="color" type="radio" value="green" />
508</gno-form>
509±±±
510
511<gno-form>
512 <gno-input name="color" type="radio" value="blue" description="What is your favorite color?" />
513 <gno-input name="color" type="radio" value="red" />
514 <gno-input name="color" type="radio" value="green" />
515</gno-form>
516
517Radio buttons allow users to select one option from a group. All radio buttons with the same ±name± form a group where only one can be selected.
518
5194. Form with Checkboxes
520±±±markdown
521<gno-form>
522 <gno-input name="interests" type="checkbox" value="coding" description="What do you like to do?"/>
523 <gno-input name="interests" type="checkbox" value="gaming" />
524 <gno-input name="interests" type="checkbox" value="reading" />
525 <gno-input name="newsletter" type="checkbox" value="subscribe" description="Subscribe to newsletter" placeholder="To get the latest news" checked="true" />
526</gno-form>
527±±±
528
529<gno-form>
530 <gno-input name="interests" type="checkbox" value="coding" description="What do you like to do?" />
531 <gno-input name="interests" type="checkbox" value="gaming" />
532 <gno-input name="interests" type="checkbox" value="reading" />
533 <gno-input name="newsletter" type="checkbox" value="subscribe" description="Subscribe to newsletter" placeholder="To get the latest news" checked="true" />
534</gno-form>
535
536Checkboxes allow users to select multiple options. Use ±checked="true"± to pre-select a checkbox.
537
5385. Form with Textarea
539±±±markdown
540<gno-form>
541 <gno-input name="message" type="text" placeholder="Subject" />
542 <gno-textarea name="content" placeholder="Enter your message here" rows="6" />
543</gno-form>
544±±±
545
546<gno-form>
547 <gno-input name="message" type="text" placeholder="Subject" />
548 <gno-textarea name="content" placeholder="Enter your message here" rows="6" />
549</gno-form>
550
551Textareas are perfect for longer text input. The ±rows± attribute controls the height (4-10 rows, default is 4).
552
5536. Form with Select Options
554±±±markdown
555<gno-form>
556 <gno-select name="country" value="United States" description="Select your country" />
557 <gno-select name="country" value="France" />
558 <gno-select name="country" value="Germany" />
559</gno-form>
560±±±
561
562<gno-form>
563 <gno-select name="country" value="United States" description="Select your country" selected="true" />
564 <gno-select name="country" value="France" />
565 <gno-select name="country" value="Germany" />
566</gno-form>
567
568Select options work like radio buttons but with a more semantic meaning. All ±<gno-select>± elements with the same ±name± form a group where only one can be selected. Use ±selected="true"± to pre-select an option. The ±value± attribute serves both as the submitted value and the displayed text.
569
5707. Complex Form with Mixed Elements
571±±±markdown
572<gno-form path="contact">
573 <gno-input name="name" type="text" placeholder="Your full name" description="Your Information" />
574 <gno-input name="email" type="email" placeholder="Your email address" />
575 <gno-input name="age" type="number" placeholder="Your age" />
576
577 <gno-input name="color" type="radio" value="blue" description="What is your favorite color?" />
578 <gno-input name="color" type="radio" value="red" />
579 <gno-input name="color" type="radio" value="green" />
580
581 <gno-input name="interests" type="checkbox" value="tech" description="What do you like to do?" />
582 <gno-input name="interests" type="checkbox" value="sports" />
583 <gno-input name="interests" type="checkbox" value="music"/>
584
585 <gno-select name="country" value="us" text="United States" description="Select your country" />
586 <gno-select name="country" value="fr" text="France" />
587 <gno-select name="country" value="de" text="Germany" />
588
589 <gno-textarea name="message" placeholder="Tell us about yourself" rows="5" />
590</gno-form>
591±±±
592
593<gno-form path="contact">
594 <gno-input name="name" type="text" placeholder="Your full name" description="Your Information" />
595 <gno-input name="email" type="email" placeholder="Your email address" />
596 <gno-input name="age" type="number" placeholder="Your age" />
597
598 <gno-input name="color" type="radio" value="blue" description="What is your favorite color?" />
599 <gno-input name="color" type="radio" value="red" />
600 <gno-input name="color" type="radio" value="green" />
601
602 <gno-input name="interests" type="checkbox" value="tech" description="What do you like to do?" />
603 <gno-input name="interests" type="checkbox" value="sports" />
604 <gno-input name="interests" type="checkbox" value="music"/>
605
606 <gno-select name="country" value="us" text="United States" description="Select your country" />
607 <gno-select name="country" value="fr" text="France" />
608 <gno-select name="country" value="de" text="Germany" />
609
610 <gno-textarea name="message" placeholder="Tell us about yourself" rows="5" />
611</gno-form>
612
613This example shows how to combine all form element types in a single form.
614
6158. Form with Default Values
616±±±markdown
617<gno-form>
618 <gno-input name="username" type="text" placeholder="Enter username" value="Alice" />
619 <gno-input name="age" type="number" placeholder="Your age" value="42" />
620 <gno-textarea name="bio" placeholder="Short bio" rows="4" value="Super builder" />
621</gno-form>
622±±±
623
624<gno-form>
625 <gno-input name="username" type="text" placeholder="Enter username" value="Alice" />
626 <gno-input name="age" type="number" placeholder="Your age" value="42" />
627 <gno-textarea name="bio" placeholder="Short bio" rows="4" value="Super builder" />
628</gno-form>
629
6309. Exec Form with Manual Fields
631When using the ±exec± attribute, a command preview appears for the specified function. You must manually define form fields whose ±name± attributes match the function's parameter names, placed in the same order as they appear in the function signature.
632
633±±±markdown
634<gno-form exec="CreatePost">
635 <gno-input name="title" type="text" placeholder="Post title" />
636 <gno-textarea name="content" rows="5" placeholder="Post content"></gno-textarea>
637 <gno-input name="tags" type="text" placeholder="Comma-separated tags" />
638</gno-form>
639±±±
640
641<gno-form exec="CreatePost">
642 <gno-input name="title" type="text" placeholder="Post title" />
643 <gno-textarea name="content" rows="5" placeholder="Post content"></gno-textarea>
644 <gno-input name="tags" type="text" placeholder="Comma-separated tags" />
645</gno-form>
646
647The command preview shows the full gnokey command with placeholders for each field value.
648
64910. Exec Form with All Field Types
650Here's an example demonstrating all supported field types in a single exec form:
651
652±±±markdown
653<gno-form exec="CreateProfile">
654 <gno-input name="username" placeholder="Your username" description="Profile Information" />
655 <gno-input name="age" type="number" placeholder="Your age" />
656 <gno-textarea name="bio" placeholder="Tell us about yourself" rows="4" />
657 <gno-select name="country" value="USA" description="Select your country" />
658 <gno-select name="country" value="France" />
659 <gno-select name="country" value="Germany" />
660 <gno-input name="visibility" type="radio" value="public" description="Profile visibility" checked="true" />
661 <gno-input name="visibility" type="radio" value="private" />
662 <gno-input name="notifications" type="checkbox" value="email" description="Notifications" checked="true" />
663 <gno-input name="notifications" type="checkbox" value="sms" />
664</gno-form>
665±±±
666
667<gno-form exec="CreateProfile">
668 <gno-input name="username" placeholder="Your username" description="Profile Information" value="alice" />
669 <gno-input name="age" type="number" placeholder="Your age" />
670 <gno-textarea name="bio" placeholder="Tell us about yourself" rows="4" />
671 <gno-select name="country" value="USA" description="Select your country" />
672 <gno-select name="country" value="France" />
673 <gno-select name="country" value="Germany" />
674 <gno-input name="visibility" type="radio" value="public" description="Profile visibility" checked="true" />
675 <gno-input name="visibility" type="radio" value="private" />
676 <gno-input name="notifications" type="checkbox" value="email" description="Notifications" checked="true" />
677 <gno-input name="notifications" type="checkbox" value="sms" />
678</gno-form>
679
680All field types update the command preview in real-time as you interact with them.
681
68211. Form with Readonly Fields
683The ±readonly="true"± attribute makes fields non-editable while displaying their values. This is useful for showing fixed values that users should see but cannot modify.
684
685±±±markdown
686<gno-form>
687 <gno-input name="username" value="alice" readonly="true" description="Your fixed username" />
688 <gno-input name="role" type="text" value="admin" readonly="true" />
689 <gno-input name="status" type="radio" value="active" checked="true" readonly="true" description="Account status" />
690 <gno-input name="status" type="radio" value="inactive" readonly="true" />
691 <gno-input name="verified" type="checkbox" value="yes" checked="true" readonly="true" />
692 <gno-textarea name="terms" value="Terms and conditions text..." rows="3" readonly="true" />
693 <gno-select name="plan" value="premium" selected="true" readonly="true" description="Your subscription" />
694 <gno-select name="plan" value="basic" readonly="true" />
695</gno-form>
696±±±
697
698<gno-form>
699 <gno-input name="username" value="alice" readonly="true" description="Your fixed username" />
700 <gno-input name="role" type="text" value="admin" readonly="true" />
701 <gno-input name="status" type="radio" value="active" checked="true" readonly="true" description="Account status" />
702 <gno-input name="status" type="radio" value="inactive" readonly="true" />
703 <gno-input name="verified" type="checkbox" value="yes" checked="true" readonly="true" />
704 <gno-textarea name="terms" value="Terms and conditions text..." rows="3" readonly="true" />
705 <gno-select name="plan" value="premium" selected="true" readonly="true" description="Your subscription" />
706 <gno-select name="plan" value="basic" readonly="true" />
707</gno-form>
708
709**Note**: For text-based inputs and textareas, the HTML ±readonly± attribute is used. For radio buttons, checkboxes, and select dropdowns, ±disabled± is used instead since ±readonly± doesn't work on these elements in HTML.
710
711#### Important Rules
712
7131. **Validation Rules**:
714 - Every ±<gno-input>± must have a ±name± attribute
715 - Every ±<gno-textarea>± must have a ±name± attribute
716 - Every ±<gno-select>± must have a ±name± and ±value± attribute
717 - Duplicate attribute names are not allowed (except for radio, checkbox, and select groups)
718 - Forms must be properly closed
719 - Nested forms will not render
720 - Radio and checkbox inputs must have a ±value± attribute
721 - The ±checked± attribute is only valid for radio and checkbox inputs
722 - The ±selected± attribute is only valid for ±<gno-select>± elements
723 - The ±readonly="true"± attribute makes fields non-editable (works on all field types)
724 - Textarea ±rows± attribute must be between 2 and 10 (defaults to 4 if invalid or not specified)
725
7262. **Security Features**:
727 - Forms are processed on the realm where they are defined
728 - Each form submission is associated with its realm
729 - The realm name is displayed in the form header
730 - Input validation is handled by the realm's smart contract
731
732---
733
734### Alerts
735
736Alerts are a way to highlight important information in your markdown.
737
738There are five types of alerts:
739
740- INFO
741- NOTE
742- TIP
743- SUCCESS
744- WARNING
745- CAUTION
746
747**NOTE**: The default alert type is INFO (if a wrong alert type is used).
748
749The alert boxes are expandable/collapsible and can have a title.
750By default, the alert boxes are opened. The title is optional and if not provided, the alert type will be used as the title.
751
752±±±markdown
753> [!NOTE]
754> This is a note
755±±±
756
757> [!NOTE]
758> This is a note
759
760±±±markdown
761> [!NOTE]-
762> This is a closed note
763±±±
764
765> [!NOTE]-
766> This is a closed note
767
768±±±markdown
769> [!NOTE] This is a note with title
770> This is a note with title
771±±±
772
773> [!NOTE] This is a note with title
774> This is a note with title
775
776±±±markdown
777> [!INFO]
778> This is an info
779±±±
780
781> [!INFO]
782> This is an info
783
784±±±markdown
785> [!TIP]
786> This is a tip
787±±±
788
789> [!TIP]
790> This is a tip
791
792±±±
793> [!SUCCESS]
794> This is a success
795±±±
796
797> [!SUCCESS]
798> This is a success
799
800±±±
801> [!WARNING]
802> This is a warning
803±±±
804
805> [!WARNING]
806> This is a warning
807
808±±±
809> [!CAUTION]
810> This is a caution
811±±±
812
813> [!CAUTION]
814> This is a caution
815
816±±±markdown
817> [!FOO]
818> The default alert if a wrong alert type is used
819±±±
820
821> [!FOO]
822> This is the default alert
823
824±±±markdown
825> [!NOTE]
826> This is a note
827> > [!NOTE]
828> > This is a scoped note
829±±±
830
831> [!NOTE]
832> This is a note
833> > [!NOTE]
834> > This is a scoped note
835
836### User Mentions and Bech32 Addresses
837
838Gno markdown automatically recognizes and renders user mentions and Bech32 addresses as clickable links.
839
840#### User Mentions
841
842// You can mention users using the "@" symbol followed by a username. The username can contain letters, numbers, and underscores.
843
844±±±markdown
845Hello @alice, how are you doing?
846
847This is a mention of @bob_user and @test-123.
848
849You can also mention users like @user_name_123.
850±±±
851
852
853Hello @alice, how are you doing?
854
855This is a mention of @bob_user.
856
857You can also mention users like @user_name_123.
858
859#### Bech32 Addresses
860
861Gno markdown can automatically recognize and render valid Bech32 addresses as clickable links.
862
863±±±markdown
864This is a GNO address: g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
865
866You can also reference g1abc123def456ghi789jkl012mno345pqr678stu901vwx234yz5.
867±±±
868
869This is a GNO address: g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5
870
871You can also reference g1abc123def456ghi789jkl012mno345pqr678stu901vwx234yz5.
872
873### Smart Contract Integration
874
875XXX: TODO
876
877±±±markdown
878gno.land/r/boards
879gno.land/r/boards:foo/bar
880gno.land/r/docs/markdown$source
881±±±
882
883gno.land/r/boards
884gno.land/r/boards:foo/bar
885gno.land/r/docs/markdown$source
886
887### And more...
888
889XXX: TODO
890
891## Future Enhancements
892
893The markdown support in Gno is being actively developed. Future enhancements may include:
894
895- Extended support for custom components
896- Interactive elements specific to blockchain functions
897- Rich rendering of on-chain data
898- Better integration with Gno's package system
899
900[Read more](https://github.com/gnolang/gno/issues/3255)
901
902## Conclusion
903
904Markdown on Gno provides a familiar syntax for developers who have experience with GitHub Flavored Markdown, while adding blockchain-specific extensions that make it more powerful in the context of the Gno platform.
905
906As the Gno ecosystem grows, expect the markdown capabilities to expand accordingly, providing even richer formatting and interactive elements for documentation and user interfaces.
907
908## See Also
909
910For programmatic markdown generation using Go code, check out the [±p/moul/md± demo](/r/docs/moul_md) which demonstrates how to use the ±p/moul/md± package to generate markdown content in your Gno realms.
911`
912 output = strings.ReplaceAll(output, "±", "`")
913 return output
914}