[Lldb-commits] [lldb] 2771ce8 - [lldb][Docs] Add edit link to docs pages (#102144)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Aug 8 01:48:52 PDT 2024
Author: David Spickett
Date: 2024-08-08T09:48:50+01:00
New Revision: 2771ce80f86e75ba38d9f5cb39fb37aa0268f0da
URL: https://github.com/llvm/llvm-project/commit/2771ce80f86e75ba38d9f5cb39fb37aa0268f0da
DIFF: https://github.com/llvm/llvm-project/commit/2771ce80f86e75ba38d9f5cb39fb37aa0268f0da.diff
LOG: [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.
Added:
lldb/docs/_templates/components/edit-this-page.html
Modified:
lldb/docs/conf.py
Removed:
################################################################################
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 00000000000000..671caeac52f6d2
--- /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 9b005c9537f23e..50f4ab84f1ca66 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 = []
More information about the lldb-commits
mailing list