Add a link to the top of the sidebar in every docs page that takes the
user back to the source code in gitlab.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
docs/_templates/editpage.html | 5 +++++
docs/conf.py | 1 +
docs/devel/_templates/editpage.html | 5 +++++
docs/interop/_templates/editpage.html | 5 +++++
docs/specs/_templates/editpage.html | 5 +++++
docs/system/_templates/editpage.html | 5 +++++
docs/tools/_templates/editpage.html | 5 +++++
docs/user/_templates/editpage.html | 5 +++++
8 files changed, 36 insertions(+)
create mode 100644 docs/_templates/editpage.html
create mode 100644 docs/devel/_templates/editpage.html
create mode 100644 docs/interop/_templates/editpage.html
create mode 100644 docs/specs/_templates/editpage.html
create mode 100644 docs/system/_templates/editpage.html
create mode 100644 docs/tools/_templates/editpage.html
create mode 100644 docs/user/_templates/editpage.html
diff --git a/docs/_templates/editpage.html b/docs/_templates/editpage.html
new file mode 100644
index 0000000000..4319b0f5ac
--- /dev/null
+++ b/docs/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/conf.py b/docs/conf.py
index e584f68393..d40d8ff37b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -177,6 +177,7 @@ html_theme_options = {
html_sidebars = {
'**': [
'about.html',
+ 'editpage.html',
'navigation.html',
'searchbox.html',
]
diff --git a/docs/devel/_templates/editpage.html b/docs/devel/_templates/editpage.html
new file mode 100644
index 0000000000..a86d22bca8
--- /dev/null
+++ b/docs/devel/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/interop/_templates/editpage.html b/docs/interop/_templates/editpage.html
new file mode 100644
index 0000000000..215e562681
--- /dev/null
+++ b/docs/interop/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/interop/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/specs/_templates/editpage.html b/docs/specs/_templates/editpage.html
new file mode 100644
index 0000000000..aaa468aa98
--- /dev/null
+++ b/docs/specs/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/specs/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/system/_templates/editpage.html b/docs/system/_templates/editpage.html
new file mode 100644
index 0000000000..6586b2e257
--- /dev/null
+++ b/docs/system/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/tools/_templates/editpage.html b/docs/tools/_templates/editpage.html
new file mode 100644
index 0000000000..2a9c8fc92b
--- /dev/null
+++ b/docs/tools/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/tools/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
diff --git a/docs/user/_templates/editpage.html b/docs/user/_templates/editpage.html
new file mode 100644
index 0000000000..1f5ee01e60
--- /dev/null
+++ b/docs/user/_templates/editpage.html
@@ -0,0 +1,5 @@
+<div id="editpage">
+ <ul>
+ <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/user/{{pagename}}.rst">Page source</a></li>
+ </ul>
+</div>
--
2.28.0
On Mon, 2 Nov 2020 at 13:09, Daniel P. Berrangé <berrange@redhat.com> wrote: > > Add a link to the top of the sidebar in every docs page that takes the > user back to the source code in gitlab. This doesn't exactly link back to the source code, which is a bit confusing I think. Eg the 'page source' link in https://berrange.gitlab.io/qemu/system/quickstart.html goes to https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/quickstart.rst which is a gitlab rendered version of the rST, not a view of the actual sources. Is it possible to link directly to an "actually the source code" view? thanks -- PMM
On Mon, Nov 02, 2020 at 01:52:04PM +0000, Peter Maydell wrote: > On Mon, 2 Nov 2020 at 13:09, Daniel P. Berrangé <berrange@redhat.com> wrote: > > > > Add a link to the top of the sidebar in every docs page that takes the > > user back to the source code in gitlab. > > This doesn't exactly link back to the source code, which is a bit > confusing I think. Eg the 'page source' link in > https://berrange.gitlab.io/qemu/system/quickstart.html > goes to > https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/quickstart.rst > > which is a gitlab rendered version of the rST, not a view of > the actual sources. Is it possible to link directly to an > "actually the source code" view? At the top of that page there are two buttons for switching between the rendered view and source view. I don't think they're directly linkable as it is switched with javascript. At least the user can see exactly what source filename is involved though, which was the key goal I had. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
© 2016 - 2026 Red Hat, Inc.