Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepend 'user-content-' to in-text links to match the prepended 'user-content-' in link anchors when rendered by Github Pages #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion parse_json_to_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def render_paper(paper_entry: dict, idx: int) -> str:
def render_title_and_author(paper_entry: dict, idx: int) -> str:
title = paper_entry["title"]
authors = paper_entry["authors"]
paper_string = f"{idx}. [{title}](#link{idx})\n"
# Github Pages seems to prepend 'user-content-' to the above anchors,
# so adjust for that and prepend 'user-content' to the in-text links
paper_string = f"{idx}. [{title}](#user-content-link{idx})\n"
paper_string += f'**Authors:** {", ".join(authors)}\n'
return paper_string

Expand Down