New upstream version 7.45
Georges Khaznadar
2 years ago
|
0 |
Version 7.45
|
|
1 |
* src
|
|
2 |
remove navigation toolsbars
|
0 | 3 |
Version 7.44
|
1 | 4 |
* src
|
2 | 5 |
user agent header added to https requests
|
0 | 0 |
Name: mediawiki2latex
|
1 | |
Version: 7.44
|
|
1 |
Version: 7.45
|
2 | 2 |
License: GPL
|
3 | 3 |
License-File: LICENSE
|
4 | 4 |
Author: Dirk Hünniger <dirk.hunniger@googlemail.com>
|
67 | 67 |
String ->
|
68 | 68 |
WikiUrl -> (Integer, String) -> IO (Maybe ([String], Integer, URL))
|
69 | 69 |
getImagePage dir u (i, ss)
|
70 | |
= do l <- (mapM (geturl . unify . exportURL . modpath2 ss)
|
|
70 |
= do l <- (mapM (geturl . kds.unify . exportURL . modpath2 ss)
|
71 | 71 |
(parses u))
|
72 | 72 |
:: IO [String]
|
73 | 73 |
let xx = (map (getImageUrl2) (zip l (parses u))) :: [Maybe String]
|
|
85 | 85 |
where go :: (URL, Maybe String) -> [(URL, String)]
|
86 | 86 |
go (uu, Just x) = [(uu, x)]
|
87 | 87 |
go _ = []
|
|
88 |
kds ('h':'t':'t':'p':'s':':':'/':'/':xs)=('h':'t':'t':'p':'s':':':'/':'/':(kds xs))
|
|
89 |
kds ('/':'/':xs)='/':(kds xs)
|
|
90 |
kds (x:xs) = x:( kds xs)
|
|
91 |
kds [] = []
|
88 | 92 |
|
89 | 93 |
{-DHUN| downloads a single image form the wiki. It takes the temporary image download directory as first parameter. It takes a tuple as second input parameter. The first element of the tuple is the image number so just an integer that can be used to identify the image uniquely) . The second element of the tupele is image include string of the image from the wiki source, that is the text in between the square brackets as second input parameter. It takes the WikiUrl of the wiki websitze currently being processed as thrird parameter. See function getImages in this module for documentation on the returned data type DHUN-}
|
90 | 94 |
|
1979 | 1979 |
| (Map.lookup "class" m) == (Just "editsection") = []
|
1980 | 1980 |
printPrepareNode (Environment Tag (TagAttr "span" m) _)
|
1981 | 1981 |
| (Map.lookup "class" m) == (Just "mw-editsection") = []
|
|
1982 |
printPrepareNode (Environment Tag (TagAttr "div" m) _)
|
|
1983 |
| (Map.lookup "id" m) == (Just "mw-navigation") = []
|
|
1984 |
printPrepareNode (Environment Tag (TagAttr "div" m) _)
|
|
1985 |
| (Map.lookup "id" m) == (Just "mw-panel") = []
|
|
1986 |
printPrepareNode (Environment Tag (TagAttr "ul" m) _)
|
|
1987 |
| (Map.lookup "id" m) == (Just "footer-places") = []
|
|
1988 |
printPrepareNode (Environment Tag (TagAttr "ul" m) _)
|
|
1989 |
| (Map.lookup "id" m) == (Just "footer-icons") = []
|
|
1990 |
printPrepareNode (Environment Tag (TagAttr "div" m) _)
|
|
1991 |
| (Map.lookup "id" m) == (Just "mw-panel") = []
|
1982 | 1992 |
printPrepareNode (Environment Tag (TagAttr "a" m) l)
|
1983 | 1993 |
= case (Map.lookup "class" m) of
|
1984 | 1994 |
(Just "image") -> imgfun m (printPrepareTree l) Nothing
|
258 | 258 |
|
259 | 259 |
getBookpage :: String -> WikiUrl -> IO (Maybe String)
|
260 | 260 |
getBookpage ss u
|
261 | |
= do l <- mapM ((geturl2) . unify) ((map ((++("/"++ss)).exportURL)) (parses u))
|
|
261 |
= do l <- mapM ((geturl2) . unify) ((map attach) (map exportURL (parses u)))
|
262 | 262 |
lll <- return (seq l l)
|
263 | 263 |
return $
|
264 | 264 |
(listToMaybe $ concat (map maybeToList (map go lll))) >>=
|
265 | 265 |
(return)
|
266 | 266 |
where
|
267 | 267 |
go x =if (x==(UTF8Str.fromString [])) then Nothing else Just (UTF8Str.toString x)
|
268 | |
|
|
268 |
attach x = case reverse x of
|
|
269 |
'/':xs -> ((reverse xs)++("/"++ss))
|
|
270 |
xs-> ((reverse xs)++("/"++ss))
|
269 | 271 |
|
270 | 272 |
{-DHUN| Loads the wikitext of an article form a mediawiki server when mediawiki2latex is running with the --mediawiki option. This function downloads the orignial wikitext source without expanding the templates. This is going to happen later by call to getExpandedPage. The first parmeter is lemma to load. The second paramerter is the WikiUrl to the server hosting the wiki. The return value is a pair. The first element of it is the wikitext source of the article. The second element of it is the URL under which the article was downloaded DHUN-}
|
271 | 273 |
|
202 | 202 |
|
203 | 203 |
versionHeader :: String
|
204 | 204 |
versionHeader
|
205 | |
= "mediawiki2latex version 7.44\n" ++ (usageInfo header options)
|
|
205 |
= "mediawiki2latex version 7.45\n" ++ (usageInfo header options)
|
206 | 206 |
|
207 | 207 |
{-DHUN| print the version string of mediawiki2latex. Takes the output of the compilerOpts function as input. Prints the version string if no options were given or the version command was given does noting otherwise DHUN-}
|
208 | 208 |
|