gitit
gitit copied to clipboard
mediawiki-style red links for missing pages
<b>Describe the feature or enhancement here.</b> Links to pages which do not exist in the wiki should be associated with a different style. Among other things, this is useful for spotting typos or mistakes. For example, one thing I'm prone to when using the darcs wiki is linking to "Foo" from "Bar/Quux" (which gives me "/Bar/Foo" when I really meant "/Foo"). If this were red-linked, I'd get immediate feedback that this wasn't the link I intended to make. Google Code Info: Issue #: 101 Author: [email protected] Created On: 2010-03-24T15:07:41.000Z Closed On:
This would be great, so bad never was implemented.
I don't know Haskell but I would say that all that's needed is to change ContentTransformer.hs starting on line 720:
-- | Convert links with no URL to wikilinks.
convertWikiLinks :: Config -> Inline -> Inline
#if MIN_VERSION_pandoc(1,16,0)
convertWikiLinks cfg (Link attr ref ("", "")) | useAbsoluteUrls cfg =
Link attr ref ("/" </> baseUrl cfg </> inlinesToURL ref, "Go to wiki page")
convertWikiLinks _cfg (Link attr ref ("", "")) =
Link attr ref (inlinesToURL ref, "Go to wiki page")
#else
convertWikiLinks cfg (Link ref ("", "")) | useAbsoluteUrls cfg =
Link ref ("/" </> baseUrl cfg </> inlinesToURL ref, "Go to wiki page")
convertWikiLinks _cfg (Link ref ("", "")) =
Link ref (inlinesToURL ref, "Go to wiki page")
#endif
convertWikiLinks _cfg x = x
Add something like:
#If isPage baseUrl
AddClass inexistant
#endif