diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-02-13 10:43:22 +0100 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-02-13 10:43:22 +0100 |
commit | 272f30af532b247e2b13d2d0b59c89a041723e9a (patch) | |
tree | 5a0ee666ab8dfafaa30addf5171a0a52b3695be7 /lib/page/index.js | |
parent | 4c6717e23488656686f276aa2b40ce1d1c7641f8 (diff) | |
download | gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.zip gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.gz gitbook-272f30af532b247e2b13d2d0b59c89a041723e9a.tar.bz2 |
Complete test for convertion of svgs
Diffstat (limited to 'lib/page/index.js')
-rw-r--r-- | lib/page/index.js | 8 |
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; |