NoteOnMe博客平台搭建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
4.4 KiB

3 years ago
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="jquery.min.js"></script>
  4. <script type="text/javascript" src="jquery.markdown.js"></script>
  5. <link rel="stylesheet" type="text/css" href="markdown.css" />
  6. </head>
  7. <h1 class="title">jQuery.Markdown.js</h1>
  8. <div class="markdown-wrapper">
  9. <div class="markdown-text">
  10. <textarea style="width: 330px; height: 500px;"># H1
  11. ## H2
  12. ### H3
  13. #### H4
  14. ##### H5
  15. ###### H6
  16. Alternatively, for H1 and H2, an underline-ish style:
  17. Alt-H1
  18. ======
  19. Alt-H2
  20. ------
  21. Emphasis, aka italics, with *asterisks* or _underscores_.
  22. Strong emphasis, aka bold, with **asterisks** or __underscores__.
  23. Combined emphasis with **asterisks and _underscores_**.
  24. Strikethrough uses two tildes. ~~Scratch this.~~
  25. 1. First ordered list item
  26. 2. Another item
  27. * Unordered sub-list.
  28. 1. Actual numbers don't matter, just that it's a number
  29. 1. Ordered sub-list
  30. 4. And another item.
  31. You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
  32. To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅
  33. Note that this line is separate, but within the same paragraph.⋅⋅
  34. (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
  35. * Unordered list can use asterisks
  36. - Or minuses
  37. + Or pluses
  38. [I'm an inline-style link](https://www.google.com)
  39. [I'm an inline-style link with title](https://www.google.com "Google's Homepage")
  40. [I'm a reference-style link][Arbitrary case-insensitive reference text]
  41. [I'm a relative reference to a repository file](../blob/master/LICENSE)
  42. [You can use numbers for reference-style link definitions][1]
  43. Or leave it empty and use the [link text itself]
  44. Some text to show that the reference links can follow later.
  45. [arbitrary case-insensitive reference text]: https://www.mozilla.org
  46. [1]: http://slashdot.org
  47. [link text itself]: http://www.reddit.com
  48. Here's our logo (hover to see the title text):
  49. Inline-style:
  50. ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")
  51. Reference-style:
  52. ![alt text][logo]
  53. [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"
  54. Inline `code` has `back-ticks around` it.
  55. ```javascript
  56. var s = "JavaScript syntax highlighting";
  57. alert(s);
  58. ```
  59. ```python
  60. s = "Python syntax highlighting"
  61. print s
  62. ```
  63. ```
  64. No language indicated, so no syntax highlighting.
  65. But let's throw in a <b>tag</b>.
  66. ```
  67. Colons can be used to align columns.
  68. | Tables | Are | Cool |
  69. | ------------- |:-------------:| -----:|
  70. | col 3 is | right-aligned | $1600 |
  71. | col 2 is | centered | $12 |
  72. | zebra stripes | are neat | $1 |
  73. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
  74. Markdown | Less | Pretty
  75. --- | --- | ---
  76. *Still* | `renders` | **nicely**
  77. 1 | 2 | 3
  78. > Blockquotes are very handy in email to emulate reply text.
  79. > This line is part of the same quote.
  80. Quote break.
  81. > This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
  82. <dl>
  83. <dt>Definition list</dt>
  84. <dd>Is something people use sometimes.</dd>
  85. <dt>Markdown in HTML</dt>
  86. <dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
  87. </dl>
  88. Three or more...
  89. ---
  90. Hyphens
  91. ***
  92. Asterisks
  93. ___
  94. Underscores
  95. Here's a line for us to start with.
  96. This line is separated from the one above by two newlines, so it will be a *separate paragraph*.
  97. This line is also a separate paragraph, but...
  98. This line is only separated by a single newline, so it's a separate line in the *same paragraph*.</textarea>
  99. </div>
  100. <div class="markdown"></div>
  101. </div>
  102. <footer>
  103. <span class="main-logo">Neutrinoboy</span>
  104. <a href="https://github.com/taknakamu/jquery-markdown">GitHub: taknakamu / jquery-markdown</a>
  105. <span class="close"></span>
  106. </footer>
  107. </html>
  108. <script>
  109. jQuery(document).ready(function(){
  110. $(".markdown-text > textarea").markdown({
  111. target_form : ".markdown"
  112. });
  113. $(".markdown-text > textarea").on("keyup", function() {
  114. $(this).markdown({
  115. target_form : ".markdown"
  116. });
  117. });
  118. $(".close").on("click", function() {
  119. $(this).closest('footer').fadeOut();
  120. });
  121. });
  122. </script>