# HG changeset patch # User Constantine Linnick # Date 1381167098 -25200 # Node ID ea6a7cfcacd8641b107ea3a58ef6f262b1b80909 # Parent 5a8c3dda25ee136355fd54ea959fbb6350ee160f# Parent 61b435d176462fc5aa556e05cb9ece1b94176eaf Merged celdredge/hgext.markdown into default diff -r 61b435d17646 -r ea6a7cfcacd8 ReadMe.markdown --- a/ReadMe.markdown Mon Oct 07 17:24:34 2013 +0100 +++ b/ReadMe.markdown Tue Oct 08 00:31:38 2013 +0700 @@ -13,6 +13,14 @@ [WikiLinks](http://packages.python.org/Markdown/extensions/wikilinks.html) extension to support documentation split across several pages. +You can add relative links to [nested](relative/doca.md) pages, or to current [headers](#config), +or even to images +_(actually at BitBucket relative links are +[broken](https://bitbucket.org/site/master/issue/6315/relative-urls-in-readmemd-files-only-work) +and you don't see logo, but hgext.markdown can do it :)_ + +![logo](relative/logo.png) + ##Install## 1. Install Python-Markdown (http://packages.python.org/Markdown/install.html) diff -r 61b435d17646 -r ea6a7cfcacd8 __init__.py --- a/__init__.py Mon Oct 07 17:24:34 2013 +0100 +++ b/__init__.py Tue Oct 08 00:31:38 2013 +0700 @@ -80,7 +80,6 @@ f = req.form.get('file', [''])[0] parts = os.path.splitext(f) - if 'file' not in req.form: return webcommands.manifest(web, req, tmpl) @@ -100,8 +99,9 @@ if util.binary(text): return webcommands.rawfile(web, req, tmpl) - base_url = tmpl.defaults['url'] + 'file/' + changeid + "/" - base_raw_url = tmpl.defaults['url'] + 'rawfile/' + changeid + "/" + relative_path = os.path.split(f)[0] + base_url = tmpl.defaults['url'] + 'file/' + changeid + "/" + relative_path + base_raw_url = tmpl.defaults['url'] + 'rawfile/' + changeid + "/" + relative_path def rebase(proc, e, attr): uri = e.get(attr, '') diff -r 61b435d17646 -r ea6a7cfcacd8 relative/doca.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/relative/doca.md Tue Oct 08 00:31:38 2013 +0700 @@ -0,0 +1,4 @@ +#Relative links demo + +- [Sibling page B](docb.md) +- [Parent page](../ReadMe.markdown) \ No newline at end of file diff -r 61b435d17646 -r ea6a7cfcacd8 relative/docb.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/relative/docb.md Tue Oct 08 00:31:38 2013 +0700 @@ -0,0 +1,4 @@ +#Relative links demo + +- [Sibling page A](doca.md) +- [Parent page](../ReadMe.markdown) \ No newline at end of file diff -r 61b435d17646 -r ea6a7cfcacd8 relative/logo.png Binary file relative/logo.png has changed