mirror of
https://github.com/pierre42100/comunic
synced 2025-07-16 23:08:13 +00:00
First commit
This commit is contained in:
15
3rdparty/pdf.js/docs/plugins/wintersmith-makerelative.coffee
vendored
Executable file
15
3rdparty/pdf.js/docs/plugins/wintersmith-makerelative.coffee
vendored
Executable file
@ -0,0 +1,15 @@
|
||||
module.exports = (env, callback) ->
|
||||
count = (string, substr) ->
|
||||
num = pos = 0
|
||||
return 1/0 unless substr.length
|
||||
num++ while pos = 1 + string.indexOf(substr, pos)
|
||||
num
|
||||
|
||||
env.helpers.makeRelative = (source, dest) ->
|
||||
return dest unless dest.indexOf("/") == 0
|
||||
depth = count(source, '/') # 1 being /
|
||||
ret = ""
|
||||
ret += "../" while depth = depth - 1
|
||||
ret + dest.substr(1)
|
||||
|
||||
callback()
|
Reference in New Issue
Block a user