Skip to content

Commit

Permalink
use rst reference as default
Browse files Browse the repository at this point in the history
  • Loading branch information
y1xiaoc committed Apr 13, 2021
1 parent a37c2f1 commit b7f869d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b7f869d

Please sign in to comment.