You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/09/12 16:22:47 UTC
[couchdb] branch try-to-fix-docs-edit-link updated (2f4499575 -> 6868e6f23)
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a change to branch try-to-fix-docs-edit-link
in repository https://gitbox.apache.org/repos/asf/couchdb.git
discard 2f4499575 Try to fix edit docs link
new 6868e6f23 Try to fix edit docs link
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (2f4499575)
\
N -- N -- N refs/heads/try-to-fix-docs-edit-link (6868e6f23)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/docs/ext/github.py | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
[couchdb] 01/01: Try to fix edit docs link
Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch try-to-fix-docs-edit-link
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 6868e6f238a25e491cca3b00f76a8ef6f5c40b97
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Mon Sep 12 11:31:08 2022 -0400
Try to fix edit docs link
---
src/docs/ext/github.py | 35 ++++++++++++++++++++++------------
src/docs/src/conf.py | 5 +++--
src/docs/templates/pages/download.html | 2 +-
3 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/src/docs/ext/github.py b/src/docs/ext/github.py
index f812d9e6b..b4455f8a1 100644
--- a/src/docs/ext/github.py
+++ b/src/docs/ext/github.py
@@ -21,26 +21,37 @@ def get_github_url(app, view, path):
path=path,
)
+def get_default_github_url(app, view):
+ return "https://github.com/{project}/{view}/{branch}/src/docs".format(
+ project=app.config.github_project,
+ view=view,
+ branch=app.config.github_branch,
+ )
+
+
+
def html_page_context(app, pagename, templatename, context, doctree):
# base template for common sphinx pages like search or genindex
# there is no need to provide github show/edit links for them
if templatename != "page.html":
- return
-
- # ok, I'm aware about that this is wrong way to concat url segments
- # but this is one is most portable between 2.x and 3.x versions
- # plus it fits our current requirements. But still, patches are welcome (:
- path = os.path.join(
- app.config.github_docs_path,
- os.path.relpath(doctree.get("source"), app.builder.srcdir),
- )
- context["github_show_url"] = get_github_url(app, "blob", path)
- context["github_edit_url"] = get_github_url(app, "edit", path)
+ context["github_show_url"] = get_default_github_url(app, "blob")
+ context["github_edit_url"] = get_default_github_url(app, "edit")
+ print("XXXXXX html_page_context p:%s t:%s" %( pagename, templatename))
+ else:
+ # ok, I'm aware about that this is wrong way to concat url segments
+ # but this is one is most portable between 2.x and 3.x versions
+ # plus it fits our current requirements. But still, patches are welcome (:
+ path = os.path.join(
+ app.config.github_docs_path,
+ os.path.relpath(doctree.get("source"), app.builder.srcdir),
+ )
+ context["github_show_url"] = get_github_url(app, "blob", path)
+ context["github_edit_url"] = get_github_url(app, "edit", path)
def setup(app):
app.add_config_value("github_project", "", True)
- app.add_config_value("github_branch", "master", True)
+ app.add_config_value("github_branch", "main", True)
app.add_config_value("github_docs_path", "", True)
app.connect("html-page-context", html_page_context)
diff --git a/src/docs/src/conf.py b/src/docs/src/conf.py
index c0da58004..3fbc6413b 100644
--- a/src/docs/src/conf.py
+++ b/src/docs/src/conf.py
@@ -18,7 +18,7 @@ import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath("../ext"))
-needs_sphinx = "1.5"
+needs_sphinx = "2.4.4"
extensions = [
"sphinx.ext.todo",
@@ -77,7 +77,8 @@ html_context = {
# Format Template: https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}
"github_user": "apache",
"github_repo": "couchdb",
- "github_version": "main/src/",
+ "github_version": "main",
+ "conf_py_path": "/src/docs/src/"
}
master_doc = "index"
diff --git a/src/docs/templates/pages/download.html b/src/docs/templates/pages/download.html
index 76fe93daf..481ec9fac 100644
--- a/src/docs/templates/pages/download.html
+++ b/src/docs/templates/pages/download.html
@@ -16,7 +16,7 @@ specific language governing permissions and limitations under the License.
{% extends "layout.html" %}
{% set title = 'Download' %}
{% set url = 'https://media.readthedocs.org/%s/couchdb/%s/couchdb.%s' %}
-{% if git_branch == 'master' %}
+{% if git_branch == 'main' %}
{% set rtd_ver = 'latest' %}
{% else %}
{% set rtd_ver = git_branch %}