diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-05-19 16:14:24 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-05-19 16:14:38 +0200 |
commit | 3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d (patch) | |
tree | 99aa3859d9a5e4756c1a35d96f57991c83896b9f | |
parent | Bettre inclusion of attachements, +local url type. (diff) | |
download | vimwiki-scripts-3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d.tar.gz vimwiki-scripts-3905a5fcf2e3ed7f6f72f528b3fcc77c56d1052d.tar.xz |
Add support for HTTP links.
-rwxr-xr-x | do.py | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -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': |