astropy / astropy/sphinx-astropy

Improvements to edit_on_github extension

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Python
Stars
7
Forks
19
Avg merge
5h 41m
Merged PRs (30d)
1

Description

*Originally requested by @embray in https://github.com/astropy/astropy-helpers/issues/211*

In https://github.com/astropy/astropy/issues/4361#issuecomment-167673551 I suggested a few fixes to the edit_on_github Sphinx extension that might be worth making:
- [ ] If the `doctree` argument passed to `html_page_content` is `None`, this implies an HTML page that was not generated from an actual rst document. Usually this implies that there is no page to edit on GitHub, though I suppose a static HTML page that lives in the repository is also possible. In either case, the case of `doctree is None` should be handled in some appropriate way. Currently if `doctree is None` for a page that is _not_ skipped, the extension crashes.
- [ ] The default for `edit_on_github_skip_regex` should be updated, probably to include `api.*` pages for compatibility with automodapi. Better yet, maybe the extension can check if automodapi is being used, and automatically skip anything that starts with the value for the `automodapi_toctreedirnm` config option used by automodapi.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the edit_on_github Sphinx extension and its html_page_content entry point, then inspect handling of a None doctree and the edit_on_github_skip_regex and automodapi_toctreedirnm configuration options. Done means non-document HTML pages no longer crash and API pages are skipped through an updated default or compatible automodapi behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.