summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-05-19 16:14:24 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-05-19 16:14:38 +0200
commit3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d (patch)
tree99aa3859d9a5e4756c1a35d96f57991c83896b9f
parentBettre inclusion of attachements, +local url type. (diff)
downloadvimwiki-scripts-3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d.tar.gz
vimwiki-scripts-3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d.tar.xz
Add support for HTTP links.
-rwxr-xr-xdo.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/do.py b/do.py
index 76a8fdb..8f6f71a 100755
--- a/do.py
+++ b/do.py
@@ -370,12 +370,6 @@ if __name__ == '__main__':
title = comment or url or frag
- # outstr += title + f"(bilaga~\\ref{{{uid}}})"
- # TODO
- outstr += title + f' (bilaga {chr(bilaga_nr + 64)})'
- # outstr += title + " (se bilaga)"
- bilaga_nr += 1
-
try:
proto, addr = url.split(":", 1)
except ValueError:
@@ -383,6 +377,23 @@ if __name__ == '__main__':
addr = url
print(proto, addr)
+ if proto in ['http', 'https']:
+ url = f'{proto}:{addr}'
+ if frag:
+ url += f'#{frag}'
+ if mode == 'tex':
+ outstr += f" \\href{{{url}}}{{{title} \\nolinkurl{{{url}}}}}"
+ else:
+ outstr += f' {title} <{url}>'
+ continue
+
+ # outstr += title + f"(bilaga~\\ref{{{uid}}})"
+ # TODO
+ outstr += title + f' (bilaga {chr(bilaga_nr + 64)})'
+ # outstr += title + " (se bilaga)"
+ bilaga_nr += 1
+
+
# disabled for full PDF:s
attach_str = ''
if mode == 'tex':