[Lldb-commits] [lldb] [lldb][Docs] Add edit link to docs pages (PR #102144)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 6 06:55:20 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/102144.diff
2 Files Affected:
- (added) lldb/docs/_templates/components/edit-this-page.html (+9)
- (modified) lldb/docs/conf.py (+5-1)
``````````diff
diff --git a/lldb/docs/_templates/components/edit-this-page.html b/lldb/docs/_templates/components/edit-this-page.html
new file mode 100644
index 0000000000000..671caeac52f6d
--- /dev/null
+++ b/lldb/docs/_templates/components/edit-this-page.html
@@ -0,0 +1,9 @@
+{% extends "furo/components/edit-this-page.html" %}
+
+{% block link_available -%}
+{%- if pagename.startswith("python_api") -%}
+ <!-- Python API docs are generated. -->
+{%- else -%}
+ {{ furo_edit_button(determine_page_edit_link()) }}
+{%- endif -%}
+{%- endblock %}
\ No newline at end of file
diff --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index 9b005c9537f23..7c9e2acd41457 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -166,7 +166,11 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-html_theme_options = {}
+html_theme_options = {
+ "source_repository": "https://github.com/llvm/llvm-project",
+ "source_branch": "main",
+ "source_directory": "lldb/docs/",
+}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
``````````
</details>
https://github.com/llvm/llvm-project/pull/102144
More information about the lldb-commits
mailing list