Created
February 19, 2017 20:01
-
-
Save KrzaQ/008f8d5d1f95c29ae3eb1c48d2610b13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <h1 id="test"> test</h1> | |
| <h2 id="bleh"> bleh</h2> | |
| <pre class="prettyprint"><code>foo | |
| foo bar baz | |
| class huj {}; | |
| </code></pre> | |
| <p>inline code: <code class="prettyprint">inline code</code> | |
| </p> | |
| [Finished in 0.3s] |
This file contains hidden or 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
| #!/usr/bin/ruby | |
| require 'httpclient' | |
| require 'json' | |
| def from_md(x) | |
| opts = { | |
| 'Content-Type' => 'application/json' | |
| } | |
| ret = HTTPClient.new.post('http://archvm:8080/api/parse_markdown', { md: x }.to_json , opts).body | |
| JSON.parse(ret)['markdown'] | |
| end | |
| str = <<MD | |
| # test | |
| ## bleh | |
| ``` | |
| foo | |
| foo bar baz | |
| class huj {}; | |
| ``` | |
| inline code: `inline code` | |
| MD | |
| puts from_md str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment