showdown-gui.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Showdown - Markdown in Javascript</title>
  6. <script type="text/javascript" src="showdown.js"></script>
  7. <script type="text/javascript" src="showdown-gui.js"></script>
  8. <style type="text/css">
  9. html,body {
  10. margin:0;
  11. padding:0;
  12. font-family: Helvetica, Arial, Verdana, sans-serif;
  13. font-size: 90%;
  14. background-color: #e0d8d8;
  15. }
  16. html {
  17. overflow: hidden;
  18. }
  19. textarea {
  20. font-family: monospace;
  21. }
  22. #pageHeader {
  23. margin: 0;
  24. padding: 0;
  25. text-align: center;
  26. margin-bottom: 0;
  27. margin-top: 0.4em;
  28. color: #766;
  29. }
  30. #pageHeader h1 {
  31. font-size: 3em;
  32. }
  33. #pageHeader * {
  34. margin: 0;
  35. padding: 0;
  36. line-height: 1em;
  37. font-weight: 100;
  38. }
  39. #pageHeader a {
  40. color: #766;
  41. text-decoration: none;
  42. position: relative;
  43. z-index: 20;
  44. }
  45. #pageHeader h1 a:hover {
  46. color: #fff;
  47. }
  48. #pageHeader h4 a:hover {
  49. text-decoration: underline;
  50. }
  51. #leftContainer, #rightContainer {
  52. margin: 0;
  53. padding: 0;
  54. position: relative;
  55. width: 47.5%;
  56. margin-top: -1.4em;
  57. }
  58. #leftContainer {
  59. float: left;
  60. left: 1.5%;
  61. }
  62. #rightContainer {
  63. float: right;
  64. right: 1.5%;
  65. }
  66. #rightContainer > * {
  67. float: right;
  68. }
  69. .paneHeader {
  70. margin: 0;
  71. padding: 0;
  72. position: relative;
  73. width: 100%;
  74. display: block;
  75. height: 2em;
  76. }
  77. .paneHeader * {
  78. position: relative;
  79. font-weight: 900;
  80. }
  81. .paneHeader span {
  82. background-color: #ddd5d5;
  83. color: #444;
  84. padding: 0 0.75em;
  85. font-size: 110%;
  86. }
  87. #paneSetting {
  88. display: block;
  89. margin-left: auto;
  90. margin-right: 0.5em;
  91. font-size: 110%;
  92. font-weight: 900;
  93. font-family: Arial, Verdana, sans-serif;
  94. background-color: #dacccc;
  95. color: #444;
  96. border: 1px solid #999;
  97. }
  98. .pane {
  99. margin: 0;
  100. padding: 0;
  101. padding-left: 4px; /* pane padding */
  102. width: 100%;
  103. border: none;
  104. background-color: #eee;
  105. display: block;
  106. border: 1px solid #888;
  107. border-right: 1px solid #000;
  108. border-bottom: 1px solid #000;
  109. /* note: the panes get their height set with
  110. javascript; see sizeTextAreas(). */
  111. /* for now, set a height so things look nice
  112. if the user has javascript disabled */
  113. height: 400px;
  114. }
  115. #previewPane {
  116. background-color: #f3eeee;
  117. }
  118. #outputPane {
  119. background-color: #6c6666;
  120. color: #fff;
  121. display: none;
  122. }
  123. #syntaxPane {
  124. background-color: #e6dede;
  125. background-color: #f7ecec;
  126. display: none;
  127. }
  128. div.pane {
  129. overflow: auto;
  130. }
  131. #inputPane {
  132. background-color: #fff;
  133. }
  134. #previewPane {
  135. padding: 0;
  136. }
  137. #previewPane > * {
  138. margin-left: 4px;
  139. margin-right: 4px;
  140. }
  141. #previewPane > blockquote {
  142. margin-left: 3em;
  143. }
  144. #previewPane > :first-child {
  145. margin-top: 4px; /* pane padding */
  146. }
  147. #previewPane * {
  148. line-height: 1.4em;
  149. }
  150. #previewPane code {
  151. font-size: 1.3em;
  152. }
  153. #footer {
  154. margin: 0;
  155. padding: 0;
  156. position: relative;
  157. float: left;
  158. width: 100%;
  159. height: 2.5em;
  160. margin-top: 0.5em;
  161. font-family: Helvetica, Arial, Verdana, sans-serif;
  162. }
  163. #footer a {
  164. text-decoration: none;
  165. color: #666;
  166. }
  167. #footer a:hover {
  168. text-decoration: underline;
  169. }
  170. #byline {
  171. padding-left: 2em;
  172. color: #666;
  173. }
  174. #convertTextControls {
  175. position: absolute;
  176. right: 5em;
  177. }
  178. #convertTextButton {
  179. line-height: 1em;
  180. background-color: #ccbfbf;
  181. color: #000;
  182. border: none;
  183. }
  184. #convertTextButton:hover {
  185. background-color: #fff;
  186. color: black;
  187. }
  188. #convertTextSetting {
  189. background-color: #dacccc;
  190. color: #222;
  191. border: 1px solid #999;
  192. }
  193. #processingTime {
  194. margin: 0;
  195. padding: 0;
  196. width: 4em;
  197. text-align: right;
  198. color: #999;
  199. position: absolute;
  200. right: 1em;
  201. top: 0;
  202. }
  203. </style>
  204. </head>
  205. <body>
  206. <div id="pageHeader">
  207. <h1><a href="http://www.attacklab.net/showdown-gui.html">Showdown</a></h1>
  208. <h4>a javascript port of <a href="http://daringfireball.net/projects/markdown/" title="The Markdown web site">Markdown</a></h4>
  209. </div>
  210. <div id="leftContainer">
  211. <div class="paneHeader">
  212. <span>Input</span>
  213. </div>
  214. <textarea id="inputPane" cols="80" rows="20" class="pane">Using this tool
  215. ---------------
  216. This page lets you create HTML by entering text in a simple format that's easy to read and write.
  217. - Type Markdown text in the left window
  218. - See the HTML in the right
  219. Markdown is a lightweight markup language based on the formatting conventions that people naturally use in email. As [John Gruber] writes on the [Markdown site] [1]:
  220. &gt; The overriding design goal for Markdown's
  221. &gt; formatting syntax is to make it as readable
  222. &gt; as possible. The idea is that a
  223. &gt; Markdown-formatted document should be
  224. &gt; publishable as-is, as plain text, without
  225. &gt; looking like it's been marked up with tags
  226. &gt; or formatting instructions.
  227. This document is written in Markdown; you can see the plain-text version on the left. To get a feel for Markdown's syntax, type some text into the left window and watch the results in the right. You can see a Markdown syntax guide by switching the right-hand window from *Preview* to *Syntax Guide*.
  228. Showdown is a Javascript port of Markdown. You can get the full [source code] by clicking on the version number at the bottom of the page.
  229. **Start with a [blank page] or edit this document in the left window.**
  230. [john gruber]: http://daringfireball.net/
  231. [1]: http://daringfireball.net/projects/markdown/
  232. [source code]: http://www.attacklab.net/showdown-v0.9.zip
  233. [blank page]: ?blank=1 "Clear all text"
  234. </textarea>
  235. </div>
  236. <div id="rightContainer">
  237. <div class="paneHeader">
  238. <select id="paneSetting">
  239. <option value="previewPane">Preview</option>
  240. <option value="outputPane">HTML Output</option>
  241. <option value="syntaxPane">Syntax Guide</option>
  242. </select>
  243. </div>
  244. <textarea id="outputPane" class="pane" cols="80" rows="20" readonly="readonly"></textarea>
  245. <div id="previewPane" class="pane"><noscript><h2>You'll need to enable Javascript to use this tool.</h2></noscript></div>
  246. <textarea id="syntaxPane" class="pane" cols="80" rows="20" readonly="readonly">
  247. Markdown Syntax Guide
  248. =====================
  249. This is an overview of Markdown's syntax. For more information, visit the [Markdown web site].
  250. [Markdown web site]:
  251. http://daringfireball.net/projects/markdown/
  252. Italics and Bold
  253. ================
  254. *This is italicized*, and so is _this_.
  255. **This is bold**, and so is __this__.
  256. You can use ***italics and bold together*** if you ___have to___.
  257. Links
  258. =====
  259. Simple links
  260. ------------
  261. There are three ways to write links. Each is easier to read than the last:
  262. Here's an inline link to [Google](http://www.google.com/).
  263. Here's a reference-style link to [Google] [1].
  264. Here's a very readable link to [Yahoo!].
  265. [1]: http://www.google.com/
  266. [yahoo!]: http://www.yahoo.com/
  267. The link definitions can appear anywhere in the document -- before or after the place where you use them. The link definition names (`1` and `Yahoo!`) can be any unique string, and are case-insensitive; `[Yahoo!]` is the same as `[YAHOO!]`.
  268. Advanced links: Title attributes
  269. --------------------------------
  270. You can also add a `title` attribute to a link, which will show up when the user holds the mouse pointer it. Title attributes are helpful if your link text is not descriptive enough to tell users where they're going. (In reference links, you can use optionally parentheses for the link title instead of quotation marks.)
  271. Here's a [poorly-named link](http://www.google.com/ "Google").
  272. Never write "[click here][^2]".
  273. Trust [me].
  274. [^2]: http://www.w3.org/QA/Tips/noClickHere
  275. (Advice against the phrase "click here")
  276. [me]: http://www.attacklab.net/ "Attacklab"
  277. Advanced links: Bare URLs
  278. -------------------------
  279. You can write bare URLs by enclosing them in angle brackets:
  280. My web site is at &lt;http://www.attacklab.net&gt;.
  281. If you use this format for email addresses, Showdown will encode the address to make it harder for spammers to harvest. Try it and look in the *HTML Output* pane to see the results:
  282. Humans can read this, but most spam harvesting robots can't: &lt;me@privacy.net&gt;
  283. Headers
  284. =======
  285. There are two ways to do headers in Markdown. (In these examples, Header 1 is the biggest, and Header 6 is the smallest.)
  286. You can underline text to make the two top-level headers:
  287. Header 1
  288. ========
  289. Header 2
  290. --------
  291. The number of `=` or `-` signs doesn't matter; you can get away with just one. But using enough to underline the text makes your titles look better in plain text.
  292. You can also use hash marks for all six levels of HTML headers:
  293. # Header 1 #
  294. ## Header 2 ##
  295. ### Header 3 ###
  296. #### Header 4 ####
  297. ##### Header 5 #####
  298. ###### Header 6 ######
  299. The closing `#` characters are optional.
  300. Horizontal Rules
  301. ================
  302. You can insert a horizontal rule by putting three or more hyphens, asterisks, or underscores on a line by themselves:
  303. ---
  304. *******
  305. ___
  306. You can also use spaces between the characters:
  307. - - - -
  308. All of these examples produce the same output.
  309. Lists
  310. =====
  311. Simple lists
  312. ------------
  313. A bulleted list:
  314. - You can use a minus sign for a bullet
  315. + Or plus sign
  316. * Or an asterisk
  317. A numbered list:
  318. 1. Numbered lists are easy
  319. 2. Markdown keeps track of the numbers for you
  320. 7. So this will be item 3.
  321. A double-spaced list:
  322. - This list gets wrapped in `&lt;p&gt;` tags
  323. - So there will be extra space between items
  324. Advanced lists: Nesting
  325. -----------------------
  326. You can put other Markdown blocks in a list; just indent four spaces for each nesting level. So:
  327. 1. Lists in a list item:
  328. - Indented four spaces.
  329. * indented eight spaces.
  330. - Four spaces again.
  331. 2. Multiple paragraphs in a list items:
  332. It's best to indent the paragraphs four spaces
  333. You can get away with three, but it can get
  334. confusing when you nest other things.
  335. Stick to four.
  336. We indented the first line an extra space to align
  337. it with these paragraphs. In real use, we might do
  338. that to the entire list so that all items line up.
  339. This paragraph is still part of the list item, but it looks messy to humans. So it's a good idea to wrap your nested paragraphs manually, as we did with the first two.
  340. 3. Blockquotes in a list item:
  341. &gt; Skip a line and
  342. &gt; indent the &gt;'s four spaces.
  343. 4. Preformatted text in a list item:
  344. Skip a line and indent eight spaces.
  345. That's four spaces for the list
  346. and four to trigger the code block.
  347. Blockquotes
  348. ===========
  349. Simple blockquotes
  350. ------------------
  351. Blockquotes are indented:
  352. &gt; The syntax is based on the way email programs
  353. &gt; usually do quotations. You don't need to hard-wrap
  354. &gt; the paragraphs in your blockquotes, but it looks much nicer if you do. Depends how lazy you feel.
  355. Advanced blockquotes: Nesting
  356. -----------------------------
  357. You can put other Markdown blocks in a blockquote; just add a `&gt;` followed by a space:
  358. Parragraph breaks in a blockquote:
  359. &gt; The &gt; on the blank lines is optional.
  360. &gt; Include it or don't; Markdown doesn't care.
  361. &gt;
  362. &gt; But your plain text looks better to
  363. &gt; humans if you include the extra `&gt;`
  364. &gt; between paragraphs.
  365. Blockquotes within a blockquote:
  366. &gt; A standard blockquote is indented
  367. &gt; &gt; A nested blockquote is indented more
  368. &gt; &gt; &gt; &gt; You can nest to any depth.
  369. Lists in a blockquote:
  370. &gt; - A list in a blockquote
  371. &gt; - With a &gt; and space in front of it
  372. &gt; * A sublist
  373. Preformatted text in a blockquote:
  374. &gt; Indent five spaces total. The first
  375. &gt; one is part of the blockquote designator.
  376. Images
  377. ======
  378. Images are exactly like links, but they have an exclamation point in front of them:
  379. ![Valid XHTML] (http://w3.org/Icons/valid-xhtml10).
  380. The word in square brackets is the alt text, which gets displayed if the browser can't show the image. Be sure to include meaningful alt text for blind users' screen-reader software.
  381. Just like links, images work with reference syntax and titles:
  382. This page is ![valid XHTML][checkmark].
  383. [checkmark]: http://w3.org/Icons/valid-xhtml10
  384. "What are you smiling at?"
  385. **Note:**
  386. Markdown does not currently support the shortest reference syntax for images:
  387. Here's a broken ![checkmark].
  388. But you can use a slightly more verbose version of implicit reference names:
  389. This ![checkmark][] works.
  390. The reference name (`valid icon`) is also used as the alt text.
  391. Inline HTML
  392. ===========
  393. If you need to do something that Markdown can't handle, you can always just use HTML:
  394. Strikethrough humor is &lt;strike&gt;funny&lt;/strike&gt;.
  395. Markdown is smart enough not to mangle your span-level HTML:
  396. &lt;u&gt;Markdown works *fine* in here.&lt;/u&gt;
  397. Block-level HTML elments have a few restrictions:
  398. 1. They must be separated from surrounding text by blank
  399. lines.
  400. 2. The begin and end tags of the outermost block element
  401. must not be indented.
  402. 3. You can't use Markdown within HTML blocks.
  403. So:
  404. &lt;div style="background-color: lightgray"&gt;
  405. You can &lt;em&gt;not&lt;/em&gt; use Markdown in here.
  406. &lt;/div&gt;
  407. Preformatted Text
  408. =================
  409. You can include preformatted text in a Markdown document.
  410. To make a code block, indent four spaces:
  411. printf("goodbye world!"); /* his suicide note
  412. was in C */
  413. The text will be wrapped in `&lt;pre&gt;` and `&lt;code&gt;` tags, and the browser will display it in a monospaced typeface. The first four spaces will be stripped off, but all other whitespace will be preserved.
  414. You cannot use Markdown or HTML within a code block, which makes them a convenient way to show samples of Markdown or HTML syntax:
  415. &lt;blink&gt;
  416. You would hate this if it weren't
  417. wrapped in a code block.
  418. &lt;/blink&gt;
  419. Code Spans
  420. ==========
  421. You can make inline `&lt;code&gt;` tags by using code spans. Use backticks to make a code span:
  422. Press the `&lt;Tab&gt;` key, then type a `$`.
  423. (The backtick key is in the upper left corner of most keyboards.)
  424. Like code blocks, code spans will be displayed in a monospaced typeface. Markdown and HTML will not work within them:
  425. Markdown italicizes things like this: `I *love* it.`
  426. Don't use the `&lt;font&gt;` tag; use CSS instead.
  427. </textarea>
  428. </div>
  429. <div id="footer">
  430. <span id="byline">
  431. <b><a href="http://www.attacklab.net/showdown-v0.9.zip">Download v0.9</a></b> copyright &copy; 2007
  432. <script type="text/javascript">
  433. /* <![CDATA[ */
  434. function hivelogic_enkoder(){var kode=
  435. "kode=\"oked\\\"=rnhg%@uqkj(Cxtnm+Ftxmn+e{F\\\\p00o1yq0\\\\00_z33:3~u\\\\q0"+
  436. "0.0m4tHq,I~.rmhxy{u0\\\\001\\\\77{Fpt3_333_33L{\\\\z00m0\\\\m00w0mo:xqnhz0"+
  437. "\\\\00.,\\\\u00x00\\\\00qIh.Qymux,\\\\t00,0\\\\q00M1\\\\t00~0.{.hGJD5+e\\"+
  438. "\\F0001o0{Drx91rFtDmE7xnnpuqwr}4D_43324lFtxmn7lqj{LxmnJ}1r26<Dro1lE92l4F:;"+
  439. "A0\\\\10FD}4\\\\\\\\{rwp7o{xvLqj{Lxmn1l2bt66m6Fx\\\\n00+1\\\\D00F100oD{xr1"+
  440. "9FrD1Extnmu7wn}p6q2:rDF42;3_430\\\\10F4xtnml7jqJ{1}4r2:t4mx7nql{j}Jr1b266t"+
  441. "6mxFn0\\\\1014Erxtnmu7wn}pHqxtnml7jqJ{1}xtnmu7wn}p6q2:0C20(D~A-CA-ul.xCoA6"+
  442. "Bouqkjr4tkzmAn1o/10\\\\10Ciuqkji4gnIxjuGk.z/o93oA.lBi/61i7C>8~AC1zYoxmtl4u"+
  443. "xIsgnIxju.k/i3_33uqkj~C>%@{**i>url+3@l>n?gr1hhojqkwl>..~,@frnhgf1dkFugrDh+"+
  444. "w,l60l>+i?f,3.f4@;5{>@.wVlujqi1ruFpdkFugr+h,f0\\\\00rnhg{@;\\\"=x''f;roi(0"+
  445. "=i;k<do.eelgnhti;++{)=cokedc.ahCrdoAe(t)i3-i;(f<c)0+c1=82x;=+tSirgnf.orCma"+
  446. "hCrdo(e)ck}do=ex\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+1"+
  447. ")+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'');"
  448. ;var i,c,x;while(eval(kode));}hivelogic_enkoder();
  449. /* ]]> */
  450. </script>
  451. John Fraser
  452. <script type="text/javascript">
  453. /* <![CDATA[ */
  454. document.write("</a>");
  455. /* ]]> */
  456. </script>
  457. </span>
  458. <span id="convertTextControls">
  459. <button id="convertTextButton" type="button" title="Convert text now">
  460. Convert text
  461. </button>
  462. <select id="convertTextSetting">
  463. <option value="delayed">in the background</option>
  464. <option value="continuous">every keystroke</option>
  465. <option value="manual">manually</option>
  466. </select>
  467. </span>
  468. <div id="processingTime" title="Last processing time">0 ms</div>
  469. </div>
  470. </body>
  471. </html>