github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/demo/markdown_test/markdown.gno (about)

     1  package markdown
     2  
     3  // this package can be used to test markdown rendering engines.
     4  
     5  func Render(path string) string {
     6  	output := `_imported from https://github.com/markedjs/marked/blob/master/docs/demo/quickref.md_
     7  
     8  Markdown Quick Reference
     9  ========================
    10  
    11  This guide is a very brief overview, with examples, of the syntax that [Markdown] supports. It is itself written in Markdown and you can copy the samples over to the left-hand pane for experimentation. It's shown as *text* and not *rendered HTML*.
    12  
    13  [Markdown]: http://daringfireball.net/projects/markdown/
    14  
    15  
    16  Simple Text Formatting
    17  ======================
    18  
    19  First thing is first. You can use *stars* or _underscores_ for italics. **Double stars** and __double underscores__ for bold. ***Three together*** for ___both___.
    20  
    21  Paragraphs are pretty easy too. Just have a blank line between chunks of text.
    22  
    23  > This chunk of text is in a block quote. Its multiple lines will all be
    24  > indented a bit from the rest of the text.
    25  >
    26  > > Multiple levels of block quotes also work.
    27  
    28  Sometimes you want to include code, such as when you are explaining how ` + "`<h1>`" + ` HTML tags work, or maybe you are a programmer and you are discussing ` + "`someMethod()`" + `.
    29  
    30  If you want to include code and have new
    31  lines preserved, indent the line with a tab
    32  or at least four spaces:
    33  
    34      Extra spaces work here too.
    35      This is also called preformatted text and it is useful for showing examples.
    36      The text will stay as text, so any *markdown* or <u>HTML</u> you add will
    37      not show up formatted. This way you can show markdown examples in a
    38      markdown document.
    39  
    40  >     You can also use preformatted text with your blockquotes
    41  >     as long as you add at least five spaces.
    42  
    43  
    44  Headings
    45  ========
    46  
    47  There are a couple of ways to make headings. Using three or more equals signs on a line under a heading makes it into an "h1" style. Three or more hyphens under a line makes it "h2" (slightly smaller). You can also use multiple pound symbols (` + "`#`" + `) before and after a heading. Pounds after the title are ignored. Here are some examples:
    48  
    49  This is H1
    50  ==========
    51  
    52  This is H2
    53  ----------
    54  
    55  # This is H1
    56  ## This is H2
    57  ### This is H3 with some extra pounds ###
    58  #### You get the idea ####
    59  ##### I don't need extra pounds at the end
    60  ###### H6 is the max
    61  
    62  
    63  Links
    64  =====
    65  
    66  Let's link to a few sites. First, let's use the bare URL, like <https://www.github.com>. Great for text, but ugly for HTML.
    67  Next is an inline link to [Google](https://www.google.com). A little nicer.
    68  This is a reference-style link to [Wikipedia] [1].
    69  Lastly, here's a pretty link to [Yahoo]. The reference-style and pretty links both automatically use the links defined below, but they could be defined *anywhere* in the markdown and are removed from the HTML. The names are also case insensitive, so you can use [YaHoO] and have it link properly.
    70  
    71  [1]: https://www.wikipedia.org
    72  [Yahoo]: https://www.yahoo.com
    73  
    74  Title attributes may be added to links by adding text after a link.
    75  This is the [inline link](https://www.bing.com "Bing") with a "Bing" title.
    76  You can also go to [W3C] [2] and maybe visit a [friend].
    77  
    78  [2]: https://w3c.org (The W3C puts out specs for web-based things)
    79  [Friend]: https://facebook.com "Facebook!"
    80  
    81  Email addresses in plain text are not linked: test@example.com.
    82  Email addresses wrapped in angle brackets are linked: <test@example.com>.
    83  They are also obfuscated so that email harvesting spam robots hopefully won't get them.
    84  
    85  
    86  Lists
    87  =====
    88  
    89  * This is a bulleted list
    90  * Great for shopping lists
    91  - You can also use hyphens
    92  + Or plus symbols
    93  
    94  The above is an "unordered" list. Now, on for a bit of order.
    95  
    96  1. Numbered lists are also easy
    97  2. Just start with a number
    98  3738762. However, the actual number doesn't matter when converted to HTML.
    99  1. This will still show up as 4.
   100  
   101  You might want a few advanced lists:
   102  
   103  - This top-level list is wrapped in paragraph tags
   104  - This generates an extra space between each top-level item.
   105  
   106  - You do it by adding a blank line
   107  
   108  - This nested list also has blank lines between the list items.
   109  
   110  - How to create nested lists
   111    1. Start your regular list
   112    2. Indent nested lists with two spaces
   113    3. Further nesting means you should indent with two more spaces
   114      * This line is indented with four spaces.
   115  
   116  - List items can be quite lengthy. You can keep typing and either continue
   117  them on the next line with no indentation.
   118  
   119  - Alternately, if that looks ugly, you can also
   120    indent the next line a bit for a prettier look.
   121  
   122  - You can put large blocks of text in your list by just indenting with two spaces.
   123  
   124    This is formatted the same as code, but you can inspect the HTML
   125    and find that it's just wrapped in a ` + "`<p>`" + ` tag and *won't* be shown
   126    as preformatted text.
   127  
   128    You can keep adding more and more paragraphs to a single
   129    list item by adding the traditional blank line and then keep
   130    on indenting the paragraphs with two spaces.
   131  
   132    You really only need to indent the first line,
   133  but that looks ugly.
   134  
   135  - Lists support blockquotes
   136  
   137    > Just like this example here. By the way, you can
   138    > nest lists inside blockquotes!
   139    > - Fantastic!
   140  
   141  - Lists support preformatted text
   142  
   143        You just need to indent an additional four spaces.
   144  
   145  
   146  Even More
   147  =========
   148  
   149  Horizontal Rule
   150  ---------------
   151  
   152  If you need a horizontal rule you just need to put at least three hyphens, asterisks, or underscores on a line by themselves. You can also even put spaces between the characters.
   153  
   154  ---
   155  ****************************
   156  _ _ _ _ _ _ _
   157  
   158  Those three all produced horizontal lines. Keep in mind that three hyphens under any text turns that text into a heading, so add a blank like if you use hyphens.
   159  
   160  Images
   161  ------
   162  
   163  Images work exactly like links, but they have exclamation points in front. They work with references and titles too.
   164  
   165  ![Google Logo](https://www.google.com/images/errors/logo_sm.gif) and ![Happy].
   166  
   167  [Happy]: https://wpclipart.com/smiley/happy/simple_colors/smiley_face_simple_green_small.png ("Smiley face")
   168  
   169  
   170  Inline HTML
   171  -----------
   172  
   173  If markdown is too limiting, you can just insert your own <strike>crazy</strike> HTML. Span-level HTML <u>can *still* use markdown</u>. Block level elements must be separated from text by a blank line and must not have any spaces before the opening and closing HTML.
   174  
   175  <div style='font-family: "Comic Sans MS", "Comic Sans", cursive;'>
   176  It is a pity, but markdown does **not** work in here for most markdown parsers.
   177  [Marked] handles it pretty well.
   178  </div>`
   179  	return output
   180  }