Restore RST writer.
This commit is contained in:
1 parent
460721cec9
commit
9fa2d0892e
1 file changed
+3
-8
@@ -51,9 +51,6 @@ type RST = StateT WriterState
|
||||
-- | Convert Pandoc to RST.
|
||||
writeRST :: PandocMonad m => WriterOptions -> Pandoc -> m Text
|
||||
writeRST opts document = do
|
||||
undefined
|
||||
|
||||
{-
|
||||
let st = WriterState { stNotes = [], stLinks = [],
|
||||
stImages = [], stHasMath = False,
|
||||
stHasRawTeX = False, stOptions = opts,
|
||||
@@ -448,9 +445,11 @@ transformInlines = insertBS .
|
||||
hasContents (Link _ [] ("", "")) = False
|
||||
hasContents (Image _ [] ("", "")) = False
|
||||
hasContents _ = True
|
||||
dropInitialSpace (Str t : xs) = Str (T.dropWhile (==' ') t) : xs
|
||||
dropInitialSpace xs = xs
|
||||
-- remove spaces after displaymath, as they screw up indentation:
|
||||
removeSpaceAfterDisplayMath (Math DisplayMath x : zs) =
|
||||
Math DisplayMath x : dropWhile (==Space) zs
|
||||
Math DisplayMath x : dropInitialSpace zs
|
||||
removeSpaceAfterDisplayMath (x:xs) = x : removeSpaceAfterDisplayMath xs
|
||||
removeSpaceAfterDisplayMath [] = []
|
||||
insertBS :: [Inline] -> [Inline] -- insert '\ ' where needed
|
||||
@@ -508,8 +507,6 @@ transformInlines = insertBS .
|
||||
isComplex (Span _ (x:_)) = isComplex x
|
||||
isComplex _ = False
|
||||
|
||||
-}
|
||||
|
||||
-- | Flattens nested inlines. Extracts nested inlines and goes through
|
||||
-- them either collapsing them in the outer inline container or
|
||||
-- pulling them out of it
|
||||
@@ -592,7 +589,6 @@ setInlineChildren (Image a _ t) i = Image a i t
|
||||
setInlineChildren (Span a _) i = Span a i
|
||||
setInlineChildren leaf _ = leaf
|
||||
|
||||
{-
|
||||
inlineListToRST :: PandocMonad m => [Inline] -> RST m (Doc Text)
|
||||
inlineListToRST = writeInlines . walk transformInlines
|
||||
|
||||
@@ -783,4 +779,3 @@ simpleTable opts blocksToDoc headers rows = do
|
||||
else hline $$ toRow headerDocs
|
||||
let bdy = vcat $ map toRow rowDocs
|
||||
return $ hdr $$ hline $$ bdy $$ hline
|
||||
-}
|
||||
Reference in new issue
Block a user