1 |
slyfox 14/02/21 19:15:31 |
2 |
|
3 |
Added: gitit-0.10.3.1-tagsoup-0.13.patch |
4 |
gitit-0.10.3.1-pandoc-1.12.patch |
5 |
Log: |
6 |
Port to pandoc-1.12. |
7 |
|
8 |
(Portage version: 2.2.8_p51/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 www-apps/gitit/files/gitit-0.10.3.1-tagsoup-0.13.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/gitit/files/gitit-0.10.3.1-tagsoup-0.13.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/gitit/files/gitit-0.10.3.1-tagsoup-0.13.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: gitit-0.10.3.1-tagsoup-0.13.patch |
17 |
=================================================================== |
18 |
diff --git a/Network/Gitit/Types.hs b/Network/Gitit/Types.hs |
19 |
index a278633..6f2b65f 100644 |
20 |
--- a/Network/Gitit/Types.hs |
21 |
+++ b/Network/Gitit/Types.hs |
22 |
@@ -1,4 +1,4 @@ |
23 |
-{-# LANGUAGE TypeSynonymInstances, ScopedTypeVariables, FlexibleInstances #-} |
24 |
+{-# LANGUAGE TypeSynonymInstances, ScopedTypeVariables, FlexibleInstances, CPP #-} |
25 |
{- |
26 |
Copyright (C) 2009 John MacFarlane <jgm@××××××××.edu>, |
27 |
Anton van Straaten <anton@××××××××××××.com> |
28 |
@@ -400,7 +400,11 @@ type Handler = GititServerPart Response |
29 |
fromEntities :: String -> String |
30 |
fromEntities ('&':xs) = |
31 |
case lookupEntity ent of |
32 |
+#if MIN_VERSION_tagsoup(0,13,0) |
33 |
+ Just c -> c ++ fromEntities rest |
34 |
+#else |
35 |
Just c -> c : fromEntities rest |
36 |
+#endif |
37 |
Nothing -> '&' : fromEntities xs |
38 |
where (ent, rest) = case break (\c -> isSpace c || c == ';') xs of |
39 |
(zs,';':ys) -> (zs,ys) |
40 |
|
41 |
|
42 |
|
43 |
1.1 www-apps/gitit/files/gitit-0.10.3.1-pandoc-1.12.patch |
44 |
|
45 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/gitit/files/gitit-0.10.3.1-pandoc-1.12.patch?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/gitit/files/gitit-0.10.3.1-pandoc-1.12.patch?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: gitit-0.10.3.1-pandoc-1.12.patch |
49 |
=================================================================== |
50 |
commit 48155008397bdaed4f97c5678d83c70d4bc3f0ff |
51 |
Author: John MacFarlane <fiddlosopher@×××××.com> |
52 |
Date: Sat Sep 14 19:24:01 2013 -0700 |
53 |
|
54 |
Changes to allow compilation with pandoc 1.12. |
55 |
|
56 |
TODO: Better handling of images and other resources in |
57 |
Docx, ODT, PDF exports. |
58 |
|
59 |
diff --git a/Network/Gitit/ContentTransformer.hs b/Network/Gitit/ContentTransformer.hs |
60 |
index 9bf656a..1489c4f 100644 |
61 |
--- a/Network/Gitit/ContentTransformer.hs |
62 |
+++ b/Network/Gitit/ContentTransformer.hs |
63 |
@@ -85,6 +85,7 @@ import Network.URI (isUnescapedInURI) |
64 |
import Network.URL (encString) |
65 |
import Prelude hiding (catch) |
66 |
import System.FilePath |
67 |
+import qualified Text.Pandoc.Builder as B |
68 |
import Text.HTML.SanitizeXSS (sanitizeBalance) |
69 |
import Text.Highlighting.Kate |
70 |
import Text.Pandoc hiding (MathML, WebTeX, MathJax) |
71 |
@@ -452,8 +453,8 @@ addPageTitleToPandoc :: String -> Pandoc -> ContentTransformer Pandoc |
72 |
addPageTitleToPandoc title' (Pandoc _ blocks) = do |
73 |
updateLayout $ \layout -> layout{ pgTitle = title' } |
74 |
return $ if null title' |
75 |
- then Pandoc (Meta [] [] []) blocks |
76 |
- else Pandoc (Meta [Str title'] [] []) blocks |
77 |
+ then Pandoc nullMeta blocks |
78 |
+ else Pandoc (B.setMeta "title" (B.str title') nullMeta) blocks |
79 |
|
80 |
-- | Adds javascript links for math support. |
81 |
addMathSupport :: a -> ContentTransformer a |
82 |
@@ -553,9 +554,10 @@ inlinesToString = concatMap go |
83 |
LineBreak -> " " |
84 |
Math DisplayMath s -> "$$" ++ s ++ "$$" |
85 |
Math InlineMath s -> "$" ++ s ++ "$" |
86 |
- RawInline "tex" s -> s |
87 |
+ RawInline (Format "tex") s -> s |
88 |
RawInline _ _ -> "" |
89 |
Link xs _ -> concatMap go xs |
90 |
Image xs _ -> concatMap go xs |
91 |
Note _ -> "" |
92 |
+ Span _ xs -> concatMap go xs |
93 |
|
94 |
diff --git a/Network/Gitit/Export.hs b/Network/Gitit/Export.hs |
95 |
index 2eb5c2c..38d5bfa 100644 |
96 |
--- a/Network/Gitit/Export.hs |
97 |
+++ b/Network/Gitit/Export.hs |
98 |
@@ -79,7 +79,7 @@ respondX templ mimetype ext fn opts page doc = do |
99 |
then fixURLs page doc |
100 |
else return doc |
101 |
respond mimetype ext (fn opts{writerTemplate = template |
102 |
- ,writerSourceDirectory = repositoryPath cfg |
103 |
+ ,writerSourceURL = Just $ baseUrl cfg |
104 |
,writerUserDataDir = pandocUserData cfg}) |
105 |
page doc' |
106 |
|
107 |
@@ -135,7 +135,7 @@ respondSlides templ slideVariant page doc = do |
108 |
writerVariables = |
109 |
("body",body''):("dzslides-core",dzcore):("highlighting-css",pygmentsCss):variables' |
110 |
,writerTemplate = template |
111 |
- ,writerSourceDirectory = repositoryPath cfg |
112 |
+ ,writerSourceURL = Just $ baseUrl cfg |
113 |
,writerUserDataDir = pandocUserData cfg |
114 |
} (Pandoc meta []) |
115 |
h' <- liftIO $ makeSelfContained (pandocUserData cfg) h |
116 |
diff --git a/Network/Gitit/Types.hs b/Network/Gitit/Types.hs |
117 |
index a278633..87d6b29 100644 |
118 |
--- a/Network/Gitit/Types.hs |
119 |
+++ b/Network/Gitit/Types.hs |
120 |
@@ -400,7 +400,7 @@ type Handler = GititServerPart Response |
121 |
fromEntities :: String -> String |
122 |
fromEntities ('&':xs) = |
123 |
case lookupEntity ent of |
124 |
- Just c -> c : fromEntities rest |
125 |
+ Just c -> c ++ fromEntities rest |
126 |
Nothing -> '&' : fromEntities xs |
127 |
where (ent, rest) = case break (\c -> isSpace c || c == ';') xs of |
128 |
(zs,';':ys) -> (zs,ys) |
129 |
diff --git a/data/default.conf b/data/default.conf |
130 |
index e2d6cae..8a6d818 100644 |
131 |
--- a/data/default.conf |
132 |
+++ b/data/default.conf |
133 |
@@ -238,8 +238,8 @@ use-feed: no |
134 |
|
135 |
base-url: |
136 |
# the base URL of the wiki, to be used in constructing feed IDs |
137 |
-# and RPX token_urls. Set this if use-feed is 'yes' or |
138 |
-# authentication-method is 'rpx'. |
139 |
+# and RPX token_urls, and in exporting docx and pdf. |
140 |
+# Set this if use-feed is 'yes' or authentication-method is 'rpx'. |
141 |
|
142 |
absolute-urls: no |
143 |
# make wikilinks absolute with respect to the base-url. |
144 |
diff --git a/gitit.cabal b/gitit.cabal |
145 |
index 53bf8fb..07a76f7 100644 |
146 |
--- a/gitit.cabal |
147 |
+++ b/gitit.cabal |
148 |
@@ -117,8 +117,8 @@ Library |
149 |
exposed-modules: Network.Gitit.Interface |
150 |
build-depends: ghc, ghc-paths |
151 |
cpp-options: -D_PLUGINS |
152 |
- build-depends: base >= 3, pandoc >= 1.10.0.5 && < 1.12, |
153 |
- pandoc-types >= 1.10 && < 1.11, filepath, safe |
154 |
+ build-depends: base >= 3, pandoc >= 1.12 && < 1.13, |
155 |
+ pandoc-types >= 1.12 && < 1.13, filepath, safe |
156 |
extensions: CPP |
157 |
if impl(ghc >= 6.12) |
158 |
ghc-options: -Wall -fno-warn-unused-do-bind |
159 |
@@ -134,8 +134,8 @@ Executable gitit |
160 |
pretty, |
161 |
xhtml, |
162 |
containers, |
163 |
- pandoc >= 1.10.0.5 && < 1.12, |
164 |
- pandoc-types >= 1.10 && < 1.11, |
165 |
+ pandoc >= 1.12 && < 1.13, |
166 |
+ pandoc-types >= 1.12 && < 1.13, |
167 |
process, |
168 |
filepath, |
169 |
directory, |
170 |
@@ -164,7 +164,7 @@ Executable gitit |
171 |
ConfigFile >= 1 && < 1.2, |
172 |
feed >= 0.3.6 && < 0.4, |
173 |
xss-sanitize >= 0.3 && < 0.4, |
174 |
- tagsoup >= 0.12 && < 0.13, |
175 |
+ tagsoup >= 0.13 && < 0.14, |
176 |
blaze-html >= 0.4 && < 0.7, |
177 |
json >= 0.4 && < 0.8 |
178 |
if impl(ghc >= 6.10) |