Permalink
Browse files

Removed Markdown.

  • Loading branch information...
1 parent 1fac7b2 commit 60dfffe7cc2bdd5a326ff5274dc37ef710f53a90 @richard-lyman committed Aug 4, 2012
Showing with 1 addition and 3,943 deletions.
  1. +1 −1 src/com/lithinos/amotoen/core.clj
  2. +0 −169 src/com/lithinos/amotoen/grammars/markdown.clj
  3. +0 −17 test/MarkdownTests/Amps and angle encoding.html
  4. +0 −21 test/MarkdownTests/Amps and angle encoding.text
  5. +0 −18 test/MarkdownTests/Auto links.html
  6. +0 −13 test/MarkdownTests/Auto links.text
  7. +0 −118 test/MarkdownTests/Backslash escapes.html
  8. +0 −120 test/MarkdownTests/Backslash escapes.text
  9. +0 −15 test/MarkdownTests/Blockquotes with code blocks.html
  10. +0 −11 test/MarkdownTests/Blockquotes with code blocks.text
  11. +0 −18 test/MarkdownTests/Code Blocks.html
  12. +0 −14 test/MarkdownTests/Code Blocks.text
  13. +0 −5 test/MarkdownTests/Code Spans.html
  14. +0 −5 test/MarkdownTests/Code Spans.text
  15. +0 −8 test/MarkdownTests/Hard-wrapped paragraphs with list-like lines.html
  16. +0 −8 test/MarkdownTests/Hard-wrapped paragraphs with list-like lines.text
  17. +0 −71 test/MarkdownTests/Horizontal rules.html
  18. +0 −67 test/MarkdownTests/Horizontal rules.text
  19. +0 −15 test/MarkdownTests/Inline HTML (Advanced).html
  20. +0 −15 test/MarkdownTests/Inline HTML (Advanced).text
  21. +0 −72 test/MarkdownTests/Inline HTML (Simple).html
  22. +0 −69 test/MarkdownTests/Inline HTML (Simple).text
  23. +0 −13 test/MarkdownTests/Inline HTML comments.html
  24. +0 −13 test/MarkdownTests/Inline HTML comments.text
  25. +0 −11 test/MarkdownTests/Links, inline style.html
  26. +0 −12 test/MarkdownTests/Links, inline style.text
  27. +0 −52 test/MarkdownTests/Links, reference style.html
  28. +0 −71 test/MarkdownTests/Links, reference style.text
  29. +0 −9 test/MarkdownTests/Links, shortcut references.html
  30. +0 −20 test/MarkdownTests/Links, shortcut references.text
  31. +0 −3 test/MarkdownTests/Literal quotes in titles.html
  32. +0 −7 test/MarkdownTests/Literal quotes in titles.text
  33. +0 −314 test/MarkdownTests/Markdown Documentation - Basics.html
  34. +0 −306 test/MarkdownTests/Markdown Documentation - Basics.text
  35. +0 −942 test/MarkdownTests/Markdown Documentation - Syntax.html
  36. +0 −888 test/MarkdownTests/Markdown Documentation - Syntax.text
  37. +0 −9 test/MarkdownTests/Nested blockquotes.html
  38. +0 −5 test/MarkdownTests/Nested blockquotes.text
  39. +0 −148 test/MarkdownTests/Ordered and unordered lists.html
  40. +0 −131 test/MarkdownTests/Ordered and unordered lists.text
  41. +0 −7 test/MarkdownTests/Strong and em together.html
  42. +0 −7 test/MarkdownTests/Strong and em together.text
  43. +0 −25 test/MarkdownTests/Tabs.html
  44. +0 −21 test/MarkdownTests/Tabs.text
  45. +0 −8 test/MarkdownTests/Tidyness.html
  46. +0 −5 test/MarkdownTests/Tidyness.text
  47. +0 −46 test/com/lithinos/amotoen/test/markdown.clj
@@ -154,7 +154,7 @@
(defn- list-of-one-element
"Check to find lists containing only a single element.
- Significantly faster than 'count'."
+ Significantly faster than 'count' in the worst-case."
[r]
(and
(seq? r)
@@ -1,169 +0,0 @@
-; Copyright (c) Richard Lyman. All rights reserved.
-; The use and distribution terms for this software are covered by the
-; Eclipse Public License 1.0 (http://www.eclipse.org/legal/epl-v10.html)
-; which can be found in the file epl-v10.html at the root of this distribution.
-; By using this software in any fashion, you are agreeing to be bound by
-; the terms of this license.
-; You must not remove this notice, or any other, from this software.
-
-(ns com.lithinos.amotoen.grammars.markdown)
-
-(def grammar {
- :Start {:Document #(let [ast (first (:Document %))]
- (loop [result '()
- r ast
- in-code-block false]
- (if (not (empty? r))
- (let [el (:LinePart (first r))
- k (first (keys el))
- is-span? (= :Span k)
- process (if is-span?
- (contains? #{:BlankLine} (first (keys (:Span el))))
- (contains? #{:CodeIndent} k))]
- (when process
- (println (if is-span? (first (keys (:Span el))) k)))
- (recur
- (cons result (first r))
- (rest r)
- false))
- (reverse result))))}
- :Document ['(+ :LinePart) :$]
- :LinePart '(| :EscapedChar :Span :CodeIndent :RegularChar)
- :RegularChar #"^(?s)."
- :CodeIndent [:Enter '(| " " "\t")]
- :EscapedChar ["\\" :EscapableChar]
- :EscapableChar '(| "\\" "`" "*" "_" "{" "}" "[" "]" "(" ")" "#" "+" "-" "." "!")
- ; Done - as long as regexs like :LinkTextOrLabel consume chars like newline
- :Span '(| :Link :LiteralAsterisk :LiteralUnderscore :Emphasis :Code :Image :AutomaticLink :BlankLine)
- ; Done
- :LiteralAsterisk "* "
- :LiteralUnderscore "_ "
- ; Done
- :Link ["[" :LinkTextOrLabel "]" '(| :InlineLink :ReferenceLink)]
- :LinkTextOrLabel #"^[^]]+"
- :InlineLink ["(" :LinkURL '(? [" " "\"" :LinkTitle "\""]) ")"]
- :ReferenceLink '(| :ImplicitRefLink ['(? " ") "[" :LinkLabel "]"])
- :ImplicitRefLink ['(? " ") "[]"]
- ; Done
- :Emphasis '(| :StrongEmphasis :EMEmphasis)
- :StrongEmphasis '(| :StrongEmphasis** :StrongEmphasis__)
- :StrongEmphasis** ["**" '(+ [(! "**") #"^(?s)."]) "**"]
- :StrongEmphasis__ ["__" '(+ [(! "__") #"^(?s)."]) "__"]
- :EMEmphasis '(| :EMEmphasis* :EMEmphasis_)
- :EMEmphasis* ["*" #"^[^*]+" "*"]
- :EMEmphasis_ ["_" #"^[^_]+" "_"]
- ; Done-ish
- :Code '(| :SingleBacktick :DoubleBacktick); :SpacedBacktick)
- :SingleBacktick ["`" '(? " ") #"^[^`]+" '(? " ") "`"]
- :DoubleBacktick ["``" '(? " ") '(+ [(! "``") #"^(?s)."]) '(? " ") "``"]
- ; Done
- :Image ["!" :Link]
- ; Done
- :AutomaticLink ["<" :LinkText ">"]
- :LinkText #"^[^>]+"
- :BlankLine [:Enter #"^[ \t]*" :Enter]
- :Enter (System/getProperty "line.separator")
-})
-
-
-
-;(def grammar {
-; :Start :Document
-; :Enter (System/getProperty "line.separator")
-; :Line ['(+ (| :EscapedChar :Span #"^.")) '(| :Enter :$)]
-; :Document ['(+ (| :BlankLine :Block :Line)) :$]
-; :EscapedChar ["\\" :EscapableChar]
-; :EscapableChar '(| "\\" "`" "*" "_" "{" "}" "[" "]" "(" ")" "#" "+" "-" "." "!")
-; :Span '(| :Link :LiteralAsterisk :LiteralUnderscore :Emphasis :Code :Image :AutomaticLink)
-; :LiteralAsterisk "* "
-; :LiteralUnderscore "_ "
-; :Link ["[" :LinkTextOrLabel "]" '(| :InlineLink :ReferenceLink)]
-; :LinkTextOrLabel #"^[^]]+"
-; :InlineLink ["(" :LinkURL '(? [" " "\"" :LinkTitle "\""]) ")"]
-; :ReferenceLink '(| :ImplicitRefLink ['(? " ") "[" :LinkLabel "]"])
-; :ImplicitRefLink ['(? " ") "[]"]
-; :Emphasis '(| :StrongEmphasis :EMEmphasis)
-; :StrongEmphasis '(| :StrongEmphasis** :StrongEmphasis__)
-; :StrongEmphasis** ["**" '(+ [(! "**") #"^(?s)."]) "**"]
-; :StrongEmphasis__ ["__" '(+ [(! "__") #"^(?s)."]) "__"]
-; :EMEmphasis '(| :EMEmphasis* :EMEmphasis_)
-; :EMEmphasis* ["*" #"^[^*]+" "*"]
-; :EMEmphasis_ ["_" #"^[^_]+" "_"]
-; :Code '(| :SingleBacktick :DoubleBacktick :SpacedBacktick)
-; :SingleBacktick ["`" '(? " ") #"^[^`]+" '(? " ") "`"]
-; :DoubleBacktick ["``" '(? " ") '(+ [(! "``") #"^(?s)."]) '(? " ") "``"]
-; :Image ["!" :Link]
-; :AutomaticLink ["<" :LinkText ">"]
-; :LinkText #"^[^>]+"
-; :Block '(| :Paragraph :Header :Blockquote :List :Codeblock :HRule :LinkLabelDefinition)
-; :Paragraph ['(+ :LineOfText) '(& (| :BlankLine :$))]
-; :BlankLine [#"^[ \t]*$" :Enter]
-; :LineOfText '(| :BreakEndedLine :Line)
-; :BreakEndedLine ['(& #"^.+[ ][ ]+$") :Line]
-; :Header '(| :SetextHeader :ATXHeader)
-; :SetextHeader [:HeaderText :Enter '(| (+ "=") (+ "-"))]
-; :ATXHeader '(| :ATXHeader1 :ATXHeader2 :ATXHeader3 :ATXHeader4 :ATXHeader5 :ATXHeader6)
-; :ATXHeader1 ["#" :HeaderText '(* "#")]
-; :ATXHeader2 ["##" :HeaderText '(* "#")]
-; :ATXHeader3 ["###" :HeaderText '(* "#")]
-; :ATXHeader4 ["####" :HeaderText '(* "#")]
-; :ATXHeader5 ["#####" :HeaderText '(* "#")]
-; :ATXHeader6 ["######" :HeaderText '(* "#")]
-; :Blockquote [:BlockquoteFirstLine '(* (| :BlockquoteFirstLine :Line))]
-; :BlockquoteFirstLine ['(+ "> ") :Line]
-; :List '(| :OrderedList :UnorderedList)
-; :OrderedList '(+ [:OrderedMarker :ListLine])
-; :UnorderedList '(+ [:UnorderedMarker :ListLine])
-; :OrderedMarker [:ListIndent #"^\d+\." :ListSpace]
-; :UnorderedMarker [:ListIndent '(| "*" "+" "-") :ListSpace]
-; :ListIndent #"^[ ]{0,3}"
-; :ListSpace '(| #"^[ ]+" "\t")
-; :ListLine :Line
-; :Codeblock [:CodeIndent :Line]
-; :CodeIndent '(| " " "\t")
-; :HRule '(| #"^(-|- ){3,}" #"^(\*|\* ){3,}" #"^(_|_ ){3,}")
-; :LinkLabelDefinition [#"^[ ]{0,3}" "[" :LinkLabel "]:" #"^[ \t]+" :LinkLabelURL '(? (| :SingleLineLLDTitle :DblLineLLDTitle))]
-; :LinkLabel #"^[^]]+"
-; :LinkLabelURL '(| :AngleLinkLabelURI :LinkURI)
-; :AngleLinkLabelURI ["<" :LinkURI ">"]
-; :SingleLineLLDTitle :LLDTitle
-; :DblLineLLDTitle [#"[ \t]+\n[ \t]+" :LLDTitle]
-; :LLDTitle '(| :DblQuoteLLDT :SnglQuoteLLDT :ParenLLDT)
-; :DblQuoteLLDT ["\"" :LinkTitle "\""]
-; :SnglQuoteLLDT ["'" :LinkTitle "'"]
-; :ParenLLDT ["(" :LinkTitle ")"]})
-
-(defn AutomaticLink-to-html [ast]
- (println ast)
- (let [ast (:AutomaticLink ast)]
- ast))
-
-(defn BlankLine-to-html [ast]
- "\n\n")
-
-(defn Span-to-html [ast]
- (let [ast (:Span ast)
- k (first (keys ast))]
- (cond
- (= k :BlankLine) (BlankLine-to-html ast)
- (= k :AutomaticLink) (AutomaticLink-to-html ast)
- true (do (println "\n\nSpan" k) ast))))
-
-(defn RegularChar-to-html [ast]
- (:RegularChar ast))
-
-(defn CodeIndent-to-html [ast]
- ast)
-
-(defn LinePart-to-html [ast]
- (let [ast (:LinePart ast)
- k (first (keys ast))]
- (cond
- (= k :RegularChar) (RegularChar-to-html ast)
- (= k :Span) (Span-to-html ast)
- (= k :CodeIndent) (CodeIndent-to-html ast)
- true (do (println "\n\nLinePart" k) ast))))
-
-(defn markdown-to-html [ast]
- (let [ast (first (:Document ast))]
- (reduce (fn [a b] (str a (LinePart-to-html b))) "" ast)))
@@ -1,17 +0,0 @@
-<p>AT&amp;T has an ampersand in their name.</p>
-
-<p>AT&amp;T is another way to write it.</p>
-
-<p>This &amp; that.</p>
-
-<p>4 &lt; 5.</p>
-
-<p>6 > 5.</p>
-
-<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an ampersand in the URL.</p>
-
-<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
-
-<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
-
-<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
@@ -1,21 +0,0 @@
-AT&T has an ampersand in their name.
-
-AT&amp;T is another way to write it.
-
-This & that.
-
-4 < 5.
-
-6 > 5.
-
-Here's a [link] [1] with an ampersand in the URL.
-
-Here's a link with an amersand in the link text: [AT&T] [2].
-
-Here's an inline [link](/script?foo=1&bar=2).
-
-Here's an inline [link](</script?foo=1&bar=2>).
-
-
-[1]: http://example.com/?foo=1&bar=2
-[2]: http://att.com/ "AT&T"
@@ -1,18 +0,0 @@
-<p>Link: <a href="http://example.com/">http://example.com/</a>.</p>
-
-<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
-
-<ul>
-<li>In a list?</li>
-<li><a href="http://example.com/">http://example.com/</a></li>
-<li>It should.</li>
-</ul>
-
-<blockquote>
- <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
-</blockquote>
-
-<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
-
-<pre><code>or here: &lt;http://example.com/&gt;
-</code></pre>
@@ -1,13 +0,0 @@
-Link: <http://example.com/>.
-
-With an ampersand: <http://example.com/?foo=1&bar=2>
-
-* In a list?
-* <http://example.com/>
-* It should.
-
-> Blockquoted: <http://example.com/>
-
-Auto-links should not occur here: `<http://example.com/>`
-
- or here: <http://example.com/>
@@ -1,118 +0,0 @@
-<p>These should all get escaped:</p>
-
-<p>Backslash: \</p>
-
-<p>Backtick: `</p>
-
-<p>Asterisk: *</p>
-
-<p>Underscore: _</p>
-
-<p>Left brace: {</p>
-
-<p>Right brace: }</p>
-
-<p>Left bracket: [</p>
-
-<p>Right bracket: ]</p>
-
-<p>Left paren: (</p>
-
-<p>Right paren: )</p>
-
-<p>Greater-than: ></p>
-
-<p>Hash: #</p>
-
-<p>Period: .</p>
-
-<p>Bang: !</p>
-
-<p>Plus: +</p>
-
-<p>Minus: -</p>
-
-<p>These should not, because they occur within a code block:</p>
-
-<pre><code>Backslash: \\
-
-Backtick: \`
-
-Asterisk: \*
-
-Underscore: \_
-
-Left brace: \{
-
-Right brace: \}
-
-Left bracket: \[
-
-Right bracket: \]
-
-Left paren: \(
-
-Right paren: \)
-
-Greater-than: \&gt;
-
-Hash: \#
-
-Period: \.
-
-Bang: \!
-
-Plus: \+
-
-Minus: \-
-</code></pre>
-
-<p>Nor should these, which occur in code spans:</p>
-
-<p>Backslash: <code>\\</code></p>
-
-<p>Backtick: <code>\`</code></p>
-
-<p>Asterisk: <code>\*</code></p>
-
-<p>Underscore: <code>\_</code></p>
-
-<p>Left brace: <code>\{</code></p>
-
-<p>Right brace: <code>\}</code></p>
-
-<p>Left bracket: <code>\[</code></p>
-
-<p>Right bracket: <code>\]</code></p>
-
-<p>Left paren: <code>\(</code></p>
-
-<p>Right paren: <code>\)</code></p>
-
-<p>Greater-than: <code>\&gt;</code></p>
-
-<p>Hash: <code>\#</code></p>
-
-<p>Period: <code>\.</code></p>
-
-<p>Bang: <code>\!</code></p>
-
-<p>Plus: <code>\+</code></p>
-
-<p>Minus: <code>\-</code></p>
-
-
-<p>These should get escaped, even though they're matching pairs for
-other Markdown constructs:</p>
-
-<p>*asterisks*</p>
-
-<p>_underscores_</p>
-
-<p>`backticks`</p>
-
-<p>This is a code span with a literal backslash-backtick sequence: <code>\`</code></p>
-
-<p>This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.</p>
-
-<p>This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.</p>
Oops, something went wrong.

0 comments on commit 60dfffe

Please sign in to comment.