From b7f869da874e0e0ab4b69d0a4630cdbe88cbcdfd Mon Sep 17 00:00:00 2001 From: Yixiao Chen Date: Tue, 13 Apr 2021 03:10:42 -0500 Subject: [PATCH] use rst reference as default --- dargs/dargs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dargs/dargs.py b/dargs/dargs.py index 04fb77e..753bf44 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -26,7 +26,7 @@ INDENT = " " # doc is indented by four spaces -RAW_ANCHOR = True # whether to use raw html anchors or RST ones +RAW_ANCHOR = False # whether to use raw html anchors or RST ones _DUMMYHOOK = lambda a,x: None # for doing nothing in traversing @@ -555,10 +555,10 @@ def make_rst_refid(name): def make_ref_pair(path, text=None, prefix=None): if not isinstance(path, str): path = '/'.join(path) - url = f"`{path}`_" if not RAW_ANCHOR else f"#{path}" + tgt = f"`{path}`_" if not RAW_ANCHOR else f"#{path}" ref = ("" if not prefix else f"{prefix}:") + path inline = f'`{ref}`_' if not text else f'|{ref}|_' - target = f'.. _`{ref}`: {url}' + target = f'.. _`{ref}`: {tgt}' if text: target = f'.. |{ref}| replace:: {text}\n' + target return inline, target