Skip to content

Conversation

mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Apr 4, 2025

This was inspired by something I noticed in the standard Python documentation. Essentially, we use sphinx's builtin sphinx.ext.extlinks extension for adding custom roles to automatically expand external links in a simple manner.

For example:

  • :source:`src/example` is replaced with the text "src/example" that is hyperlinked to here
  • :code-example:`c_example.c` is replaced with the text "c_example.c" that is hyperlinked to here
  • :gh-pr:`235` is replaced with the text "gh-pr#235" that is hyperlinked to here

@mabruzzo mabruzzo added the documentation Documentation related label Apr 4, 2025
This was inspired by something I noticed in the standard Python documentation. Essentially, we use sphinx's builtin [sphinx.ext.extlinks](https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html#module-sphinx.ext.extlinks) extension for adding custom roles to automatically expand external links in a simple manner.

For example:
- ``:source:`src/example` `` is replaced with the text "src/example" that is hyperlinked to [here](https://github.com/grackle-project/grackle/tree/main/src/example)
- ``:code-example:`c_example.c` `` is replaced with the text "c_example.c" that is hyperlinked to [here](https://github.com/grackle-project/grackle/blob/main/src/example/c_example.c)
- ``:gh-pr:`235` `` is replaced with the text "gh-pr#235" that is hyperlinked to [here](grackle-project#235)
Copy link
Contributor

@brittonsmith brittonsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice simplification.

@brittonsmith brittonsmith merged commit 42ff225 into grackle-project:main May 26, 2025
5 checks passed
@mabruzzo mabruzzo deleted the source-links branch June 8, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants