Skip to content

Commit

Permalink
Merge pull request espnet#5883 from Masao-Someki/bugfix/homepage_sour…
Browse files Browse the repository at this point in the history
…ce_link

Bug fix for source link
  • Loading branch information
sw005320 authored Aug 29, 2024
2 parents 7750626 + 6f7fb6f commit afe42f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/argparse2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_parser():
for m in modinfo:
cmd = m.path.name
sourceurl = f"https://github.com/espnet/espnet/blob/" \
+ get_git_revision_hash() + str(m.path.parent / m.path.stem) + ".py"
+ get_git_revision_hash() + "/" + str(m.path.parent / m.path.stem) + ".py"
sep = "~" * len(cmd)
mname = m.name if m.name.startswith("espnet") \
else ".".join(m.name.split(".")[1:])
Expand Down
4 changes: 2 additions & 2 deletions doc/members2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def parse_ast(filename):

def gen_func_rst(func_name, writer, filepath, lineno):
sourceurl = f"https://github.com/espnet/espnet/blob/" \
+ GIT_HASH + filepath + f":L{lineno}"
+ GIT_HASH + "/" + filepath + f"#L{lineno}"
writer.write(f""".. _{func_name}
{func_name}
{"~" * len(func_name)}
Expand All @@ -54,7 +54,7 @@ def gen_func_rst(func_name, writer, filepath, lineno):

def gen_class_rst(class_name, writer, filepath, lineno):
sourceurl = f"https://github.com/espnet/espnet/blob/" \
+ GIT_HASH + filepath + f":L{lineno}"
+ GIT_HASH + "/" + filepath + f"#L{lineno}"
writer.write(f""".. _{class_name}
{class_name}
{"~" * len(class_name)}
Expand Down
2 changes: 1 addition & 1 deletion doc/usage2rst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ len=${#cmd}
r=$(dirname $real)
sep=$(printf '~%.0s' $(seq $len))
usage=$($real --help |& sed "s?${r}/??g" | grep -v -e '--help' | sed "s/^/ /g")
sourceurl="https://github.com/espnet/espnet/blob/${githash}/$1"
sourceurl="https://github.com/espnet/espnet/blob/${githash}\/$1"
cat <<EOF
.. _${cmd}
Expand Down

0 comments on commit afe42f1

Please sign in to comment.