hejsan hoppsan
This commit is contained in:
parent
27a169b30c
commit
f971423f04
9 changed files with 264 additions and 98 deletions
|
|
@ -1,5 +1,8 @@
|
|||
namespace Fibble.FibLib
|
||||
|
||||
open System
|
||||
open System.Xml.Schema
|
||||
|
||||
module Pandoc =
|
||||
open System.Diagnostics
|
||||
|
||||
|
|
@ -17,14 +20,16 @@ module Pandoc =
|
|||
use proc = Process.Start startInfo
|
||||
// Skriv markdown till Pandoc
|
||||
use stdin = proc.StandardInput
|
||||
stdin.Write markdownText
|
||||
stdin.WriteLine markdownText
|
||||
stdin.Close() // Måste stängas så Pandoc vet att texten är slut
|
||||
// Läs ut resultatet
|
||||
let htmlOutput = proc.StandardOutput.ReadToEnd()
|
||||
let errorOutput = proc.StandardError.ReadToEnd()
|
||||
|
||||
|
||||
|
||||
proc.WaitForExit()
|
||||
|
||||
Console.WriteLine(htmlOutput)
|
||||
if proc.ExitCode = 0 then
|
||||
htmlOutput.Trim()
|
||||
else
|
||||
|
|
@ -35,4 +40,5 @@ module Pandoc =
|
|||
sprintf "\n<pre>%s</pre> and <pre>%s</pre>" ex.Message markdownText
|
||||
|
||||
let mdToHtml markdownText =
|
||||
toHtml "markdown" markdownText
|
||||
let res= toHtml "markdown" markdownText
|
||||
res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue