git.iko.soy/typeable/pandoc
on master help sign in
DocBook reader: Implemented screen, quandadiv, ackno.
commitcbfd187ba975ba9dc0b97812fa537ab1fb245b2b authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 1 May 2012, 20:54 (14 years ago) parent9961dc2
1 file changed+15−11
src/Text/Pandoc/Readers/DocBook.hs+15−11
src/Text/Pandoc/Readers/DocBook.hs+15−11
@@ -11,15 +11,16 @@ import Data.List (intersperse)
1111
1212{-
1313
14−List of all DocBook tags, with [x] indicating implemented:
14+List of all DocBook tags, with [x] indicating implemented,
15+[o] meaning intentionally left unimplemented (pass through):
1516
16−[ ] abbrev - An abbreviation, especially one followed by a period
17+[o] abbrev - An abbreviation, especially one followed by a period
1718[x] abstract - A summary
18−[ ] accel - A graphical user interface (GUI) keyboard shortcut
19−[ ] ackno - Acknowledgements in an Article
20−[ ] acronym - An often pronounceable word made from the initial
21−[ ] action - A response to a user event
22−[ ] address - A real-world address, generally a postal address
19+[o] accel - A graphical user interface (GUI) keyboard shortcut
20+[x] ackno - Acknowledgements in an Article
21+[o] acronym - An often pronounceable word made from the initial
22+[o] action - A response to a user event
23+[o] address - A real-world address, generally a postal address
2324[ ] affiliation - The institutional affiliation of an individual
2425[ ] alt - Text representation for a graphical element
2526[ ] anchor - A spot in the document
@@ -305,7 +306,7 @@ List of all DocBook tags, with [x] indicating implemented:
305306[ ] publishername - The name of the publisher of a document
306307[ ] pubsnumber - A number assigned to a publication other than an ISBN or ISSN
307308 or inventory part number
308−[ ] qandadiv - A titled division in a QandASet
309+[x] qandadiv - A titled division in a QandASet
309310[ ] qandaentry - A question/answer set within a QandASet
310311[ ] qandaset - A question-and-answer set
311312[ ] question - A question in a QandASet
@@ -349,9 +350,9 @@ List of all DocBook tags, with [x] indicating implemented:
349350[ ] rhs - The right-hand side of an EBNF production
350351[ ] row - A row in a table
351352[ ] sbr - An explicit line break in a command synopsis
352−[ ] screen - Text that a user sees or might see on a computer screen
353−[ ] screenco - A screen with associated areas used in callouts
354−[ ] screeninfo - Information about how a screen shot was produced
353+[x] screen - Text that a user sees or might see on a computer screen
354+[o] screenco - A screen with associated areas used in callouts
355+[o] screeninfo - Information about how a screen shot was produced
355356[ ] screenshot - A representation of what the user sees or might see on a
356357 computer screen
357358[ ] secondary - A secondary word or phrase in an index term
@@ -546,6 +547,7 @@ parseBlock (Text (CData _ s _)) = if all isSpace s
546547parseBlock (Elem e) =
547548 case qName (elName e) of
548549 "para" -> para <$> getInlines e
550+ "ackno" -> para <$> getInlines e
549551 "blockquote" -> do
550552 attrib <- case filterChild (named "attribution") e of
551553 Nothing -> return mempty
@@ -566,6 +568,7 @@ parseBlock (Elem e) =
566568 "sect4" -> sect 4
567569 "sect5" -> sect 5
568570 "section" -> gets dbSectionLevel >>= sect . (+1)
571+ "qandadiv" -> gets dbSectionLevel >>= sect . (+1)
569572 "abstract" -> blockQuote <$> getBlocks e
570573 "itemizedlist" -> bulletList <$> listitems
571574 "orderedlist" -> orderedList <$> listitems -- TODO list attributes
@@ -578,6 +581,7 @@ parseBlock (Elem e) =
578581 "article" -> modify (\st -> st{ dbBook = False }) >>
579582 getTitle >> getBlocks e
580583 "book" -> modify (\st -> st{ dbBook = True }) >> getTitle >> getBlocks e
584+ "screen" -> return $ codeBlock $ strContent e -- TODO attrs
581585 "programlisting" -> return $ codeBlock $ strContent e -- TODO attrs
582586 "?xml" -> return mempty
583587 _ -> getBlocks e