Skip to content

Commit

Permalink
Make the fix_table_links script configurable, so we can pass in a dif…
Browse files Browse the repository at this point in the history
…ferent file.

PiperOrigin-RevId: 469327109
Change-Id: Ieb6fb55174fffc823fbabb38208b39c9b7671d03
  • Loading branch information
lanctot committed Aug 23, 2022
1 parent dafe96c commit 152f30d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/fix_table_links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
# https://github.com/ryanfox/sphinx-markdown-tables/issues/18

# Currently the only file affected is the api_reference:
sed -i -E 's/a href="(.*)\.md"/a href="\1\.html"/g' _build/html/api_reference.html
FILE="_build/html/api_reference.html"
if [[ "$1" != "" ]]; then
FILE="$1"
fi

sed -E 's/a href="(.*)\.md"/a href="\1\.html"/g' -i ${FILE}
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ build:
- echo `ls docs`
- echo `ls docs/_build/html/api_reference.html`
- echo "Fixing the table links"
- cd docs && bash fix_table_links.sh
- bash docs/fix_table_links.sh _readthedocs/html/api_reference.html

0 comments on commit 152f30d

Please sign in to comment.