aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO61
-rw-r--r--src/Main.hs4
-rw-r--r--src/Text/Pandoc/Shared.hs2
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs3
-rw-r--r--src/Text/Pandoc/Writers/RST.hs7
-rw-r--r--tests/html-reader.html1
-rw-r--r--tests/rst-reader.rst1
-rw-r--r--tests/s5.basic.html1
-rw-r--r--tests/s5.fancy.html1
-rw-r--r--tests/s5.fragment.html1
-rw-r--r--tests/s5.inserts.html1
-rw-r--r--tests/testsuite.txt1
-rw-r--r--tests/writer.html1
-rw-r--r--tests/writer.latex1
-rw-r--r--tests/writer.markdown1
-rw-r--r--tests/writer.rst1
-rw-r--r--tests/writer.rtf1
-rw-r--r--tests/writer.smart.html1
18 files changed, 25 insertions, 65 deletions
diff --git a/TODO b/TODO
index 9f72a0f04..ee710a070 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,19 @@
# TODO
+* Fix bug in latex reader? "... gets converted the wrong way.
+
+* Use XHTML library for HTML writer?
+
* Revisions for building with windows under cygwin:
Cabal under windows produces 'pandoc.exe', and some of the scripts
- expect 'pandoc'.
+ expect 'pandoc'. (See if this has now been fixed by Makefile change.)
+
+* Windows binary distribution: pandoc.exe. Work this into the website
+ target.
+
+* Consider allowing 'a.', 'b.', etc. to mark ordered lists. Perhaps
+ also '(a)', '(1)', 'a)', '1)', etc., as in rst. This does depart from
+ markdown syntax.
* Consider making section headers block titles rather than blocks.
Instead of: [Header 1 "My title", Block1, Block2, Block3],
@@ -10,6 +21,10 @@
This seems cleaner and would facilitate a docbook writer.
It might also simplify the rst reader.
+* Consider merging changes in pandoc-wrappers (symlinks rather than
+ wrapper scripts, except web2markdown and markdown2pdf). This also
+ needs documentation.
+
* pandoc's HTML output fails to validate completely (w3c).
There are a few quirks:
+ HTML doesn't like the \> at the end of <meta tags.
@@ -41,47 +56,3 @@
Disadvantage: Perhaps slightly harder to read. (But HTML and LaTeX
output will still be easy to read.)
-* Consider scrapping most of the wrapper scripts in favor of having
- symlinks to pandoc. Modify pandoc so that it changes its defaults
- depending on the name of the calling program (getProgName).
- This would eliminate a lot of complexity and allow better handling
- of options (eliminating the need for a separation between wrapper
- and pandoc options, for example).
-
- If we do this, we should change option parsing in pandoc to allow
- options after arguments. This will preserve backward-compatibility
- with the present wrapper system. We'd also want to add an -o
- option to pandoc (output file). When -o foo is specified, pandoc
- should print "Created foo" to stderr on success (unless --quiet
- is specified).
-
- A disadvantage is that we'd lose iconv conversion. But maybe this
- isn't needed anymore; UTF-8 seems to be standard on most systems now.
-
- The tricky wrappers to replace are markdown2pdf and html2markdown.
-
- markdown2pdf:
-
- save working_directory
- create tempdir
- if markdown2latex "$@" >tempdir/output 2>tempdir/logfile; then
- extract output-file from logfile (this will be foo.pdf)
- if output-file found:
- mv foo.pdf tempdir/foo.tex
- else:
- mv tempdir/output tempdir/foo.tex
- cd tempdir
- run pdflatex on foo.tex to produce foo.pdf
- mv foo.pdf working_directory/foo.pdf
- else:
- display logfile to inform user
- on exit:
- get rid of tempdir
-
- html2markdown: needs to run the HTML through tidy (mainly because
- pandoc's html parser requires closing tags, etc.) So we probably
- need something like the existing wrapper script here. roktas
- suggests perhaps keeping html2markdown simple and using a separate
- script, web2markdown. note: we also need iconv here, since web
- pages may not be in UTF8.
-
diff --git a/src/Main.hs b/src/Main.hs
index dc5a9fde1..d279d5d3d 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -19,7 +19,7 @@ import Text.Pandoc.Shared
import System ( exitWith, getArgs, getProgName )
import System.Exit
import System.Console.GetOpt
-import IO ( stdout, stderr, hPutStrLn )
+import System.IO
import Data.Maybe ( fromMaybe )
import Data.List ( isPrefixOf )
import Char ( toLower )
@@ -286,7 +286,7 @@ main = do
writerIncludeBefore = includeBefore,
writerIncludeAfter = includeAfter }
- (readSources sources) >>= (putStrLn . encodeUTF8 . (writer writerOptions) .
+ (readSources sources) >>= (putStr . encodeUTF8 . (writer writerOptions) .
(reader startParserState) . filter .
decodeUTF8 . (joinWithSep "\n"))
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 07afba00e..b2686d941 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -140,7 +140,7 @@ prettyBlock block = show block
-- | Prettyprint Pandoc document.
prettyPandoc :: Pandoc -> String
-prettyPandoc (Pandoc meta blocks) = "Pandoc " ++ "(" ++ (show meta) ++ ")\n" ++ (prettyBlockList 0 blocks)
+prettyPandoc (Pandoc meta blocks) = "Pandoc " ++ "(" ++ (show meta) ++ ")\n" ++ (prettyBlockList 0 blocks) ++ "\n"
-- | Convert tabs to spaces (with adjustable tab stop).
tabsToSpaces :: Int -- ^ Tabstop
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 4ca131455..e7c167eb3 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -11,8 +11,7 @@ import Text.PrettyPrint.HughesPJ hiding ( Str )
writeMarkdown :: WriterOptions -> Pandoc -> String
writeMarkdown options (Pandoc meta blocks) =
let body = text (writerIncludeBefore options) <>
- vcat (map (blockToMarkdown (writerTabStop options)) (formatKeys blocks)) $$
- text (writerIncludeAfter options) in
+ vcat (map (blockToMarkdown (writerTabStop options)) (formatKeys blocks)) $$ text (writerIncludeAfter options) in
let head = if (writerStandalone options) then
((metaToMarkdown meta) $$ text (writerHeader options))
else
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 7d08d152d..cc2bc6499 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -16,14 +16,15 @@ writeRST options (Pandoc meta blocks) =
(metaToRST meta) $$ text (writerHeader options)
else
empty in
- let refs' = nubBy (\x y -> (render x) == (render y)) refs in -- remove duplicate keys
+ -- remove duplicate keys
+ let refs' = nubBy (\x y -> (render x) == (render y)) refs in
let body = text (writerIncludeBefore options) <>
vcat main $$ text (writerIncludeAfter options) in
- render $ top <> body $$ vcat refs'
+ render $ top <> body $$ vcat refs' $$ text "\n"
-- | Escape special RST characters.
escapeString :: String -> String
-escapeString = backslashEscape "`\\|*_"
+escapeString = backslashEscape "`\\|*_"
-- | Convert list of inline elements into one 'Doc' of wrapped text and another
-- containing references.
diff --git a/tests/html-reader.html b/tests/html-reader.html
index 0df91b335..b89a93299 100644
--- a/tests/html-reader.html
+++ b/tests/html-reader.html
@@ -396,4 +396,3 @@ An e-mail address: nobody [at] nowhere.net<blockquote>
<p>If you want, you can use a caret at the beginning of every line, as with blockquotes, but all that you need is a caret at the beginning of the first line of the block and any preceding blank lines.</p>
</body>
</html>
-
diff --git a/tests/rst-reader.rst b/tests/rst-reader.rst
index 75716f7b4..4bc0d71b8 100644
--- a/tests/rst-reader.rst
+++ b/tests/rst-reader.rst
@@ -338,4 +338,3 @@ From "Voyage dans la Lune" by Georges Melies (1902):
Here is a movie |movie| icon.
.. |movie| image:: movie.jpg
-
diff --git a/tests/s5.basic.html b/tests/s5.basic.html
index ddb4d8079..919b09da6 100644
--- a/tests/s5.basic.html
+++ b/tests/s5.basic.html
@@ -758,4 +758,3 @@ window.onresize = function(){setTimeout('fontScale()', 50);}</script>
</div>
</body>
</html>
-
diff --git a/tests/s5.fancy.html b/tests/s5.fancy.html
index 875bbfbaf..8686a8542 100644
--- a/tests/s5.fancy.html
+++ b/tests/s5.fancy.html
@@ -1670,4 +1670,3 @@ else
</div>
</body>
</html>
-
diff --git a/tests/s5.fragment.html b/tests/s5.fragment.html
index d77c484dc..370b9c111 100644
--- a/tests/s5.fragment.html
+++ b/tests/s5.fragment.html
@@ -15,4 +15,3 @@
<ul>
<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
</ul>
-
diff --git a/tests/s5.inserts.html b/tests/s5.inserts.html
index 7ebdf23e4..4f998c573 100644
--- a/tests/s5.inserts.html
+++ b/tests/s5.inserts.html
@@ -38,4 +38,3 @@ STUFF INSERTED
STUFF INSERTED
</body>
</html>
-
diff --git a/tests/testsuite.txt b/tests/testsuite.txt
index 8bcbbd0f9..f27f00245 100644
--- a/tests/testsuite.txt
+++ b/tests/testsuite.txt
@@ -609,4 +609,3 @@ to a single footnote (as with block quotes).
^ as with blockquotes, but all that you need is a caret at the
^ beginning of the first line of the block and any preceding
^ blank lines.
-
diff --git a/tests/writer.html b/tests/writer.html
index 0eb528a63..77cb3a47f 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -453,4 +453,3 @@ Cat &amp; 1 \\ \hline
</div>
</body>
</html>
-
diff --git a/tests/writer.latex b/tests/writer.latex
index 7f632cb6d..30ea0f54f 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -578,4 +578,3 @@ If you want, you can use a caret at the beginning of every line, as with blockqu
\end{document}
-
diff --git a/tests/writer.markdown b/tests/writer.markdown
index c086190d2..737ddd524 100644
--- a/tests/writer.markdown
+++ b/tests/writer.markdown
@@ -625,4 +625,3 @@ space\^(my note).
^ with blockquotes, but all that you need is a caret at the beginning
^ of the first line of the block and any preceding blank lines.
-
diff --git a/tests/writer.rst b/tests/writer.rst
index cd67cdaba..b1413db8d 100644
--- a/tests/writer.rst
+++ b/tests/writer.rst
@@ -741,3 +741,4 @@ space^(my note).
.. _nobody@nowhere.net: mailto:nobody@nowhere.net
.. |lalune| image:: lalune.jpg
.. |movie| image:: movie.jpg
+
diff --git a/tests/writer.rtf b/tests/writer.rtf
index ae4024181..65ef026a8 100644
--- a/tests/writer.rtf
+++ b/tests/writer.rtf
@@ -375,4 +375,3 @@ http://example.com/
}. This should {\i not} be a footnote reference, because it contains a space^(my note).\par}
}
-
diff --git a/tests/writer.smart.html b/tests/writer.smart.html
index 1ab182558..d206d4ece 100644
--- a/tests/writer.smart.html
+++ b/tests/writer.smart.html
@@ -453,4 +453,3 @@ Cat &amp; 1 \\ \hline
</div>
</body>
</html>
-