summaryrefslogtreecommitdiffstats
path: root/lib/page
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-02-13 10:43:22 +0100
committerSamy Pesse <samypesse@gmail.com>2016-02-13 10:43:22 +0100
commit272f30af532b247e2b13d2d0b59c89a041723e9a (patch)
tree5a0ee666ab8dfafaa30addf5171a0a52b3695be7 /lib/page
parent4c6717e23488656686f276aa2b40ce1d1c7641f8 (diff)
downloadgitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.zip
gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.gz
gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.bz2
Complete test for convertion of svgs
Diffstat (limited to 'lib/page')
-rw-r--r--lib/page/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/page/index.js b/lib/page/index.js
index e96f89b..77b9950 100644
--- a/lib/page/index.js
+++ b/lib/page/index.js
@@ -78,6 +78,14 @@ Page.prototype.resolve = function() {
return this.book.resolve(this.resolveLocal.apply(this, arguments));
};
+// Convert an absolite path to a relative path from this page
+Page.prototype.relative = function(name) {
+ return location.relative(
+ this.resolve('.'),
+ this.resolve(name)
+ );
+};
+
// Update content of the page
Page.prototype.update = function(content) {
this.content = content;