-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Move Markdown to inside the compiler. (#8115)"
This reverts commit 491f26b.
- Loading branch information
Showing
10 changed files
with
42 additions
and
50 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
...mpiler/crystal/tools/doc/markdown_spec.cr → spec/std/markdown/markdown_spec.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
...rystal/tools/doc/markdown/doc_renderer.cr → ...rystal/tools/doc/markdown_doc_renderer.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Markdown library parses Markdown text. It supports rendering to HTML text. | ||
# | ||
# Usage: | ||
# | ||
# ``` | ||
# require "markdown" | ||
# | ||
# text = "## This is title \n This is a [link](http://crystal-lang.org)" | ||
# | ||
# Markdown.to_html(text) | ||
# # => <h2>This is title</h2> | ||
# # => <p>This is a <a href="http://crystal-lang.org">link</a></p> | ||
# ``` | ||
# | ||
# NOTE: This library is in its early stage. Many features are still in development. | ||
class Markdown | ||
def self.parse(text, renderer) | ||
parser = Parser.new(text, renderer) | ||
parser.parse | ||
end | ||
|
||
def self.to_html(text) : String | ||
String.build do |io| | ||
parse text, Markdown::HTMLRenderer.new(io) | ||
end | ||
end | ||
end | ||
|
||
require "./markdown/*" |
2 changes: 1 addition & 1 deletion
2
...ystal/tools/doc/markdown/html_renderer.cr → src/markdown/html_renderer.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...iler/crystal/tools/doc/markdown/parser.cr → src/markdown/parser.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...er/crystal/tools/doc/markdown/renderer.cr → src/markdown/renderer.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters