Skip to content

Commit 2771ce8

Browse files
[lldb][Docs] Add edit link to docs pages (#102144)
That aren't the generated `python_api/` pages. This button is a pencil icon at the top right of the page and takes you to a GitHub page where you can edit the content, assuming you have a fork already. If not it tells you how to make one. This is hardcoded to the llvm-project URL and main branch. So folks will need a downstream patch if they want to change that. For the upstream repo, main is right because even if a release branch was open for PRs, it would only be for cherry picks from main. The icon isn't as obvious as the "edit on GitHub" icons seen elsewhere but it's built in, and we could change it later if we wanted to.
1 parent 4d47211 commit 2771ce8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "furo/components/edit-this-page.html" %}
2+
3+
{% block link_available -%}
4+
{%- if pagename.startswith("python_api") -%}
5+
<!-- Python API docs are generated. -->
6+
{%- else -%}
7+
{{ furo_edit_button(determine_page_edit_link()) }}
8+
{%- endif -%}
9+
{%- endblock %}

lldb/docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@
166166
# Theme options are theme-specific and customize the look and feel of a theme
167167
# further. For a list of options available for each theme, see the
168168
# documentation.
169-
html_theme_options = {}
169+
html_theme_options = {
170+
"source_repository": "https://github.com/llvm/llvm-project",
171+
"source_branch": "main",
172+
"source_directory": "lldb/docs/",
173+
}
170174

171175
# Add any paths that contain custom themes here, relative to this directory.
172176
# html_theme_path = []

0 commit comments

Comments
 (0)