From 2c6d54d9ed68ac8861ba28cbc5150e41393ee515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Fri, 6 May 2022 21:18:16 +0200 Subject: [PATCH] Support ID links. --- _scripts/generate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_scripts/generate.py b/_scripts/generate.py index 9708f16..9f997af 100644 --- a/_scripts/generate.py +++ b/_scripts/generate.py @@ -147,7 +147,10 @@ def render_text_tokens(tokens, acc): acc.append('{} '.format(chunk)) elif isinstance(chunk, Link): # @TODO: URLEscape - acc.append('{}'.format(chunk.value, chunk.description)) + link_target = chunk.value + if link_target.startswith('id:'): + link_target = './' + link_target[3:] + '.node.html' + acc.append('{}'.format(link_target, chunk.description)) else: raise NotImplementedError('TextToken: {}'.format(chunk))