Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
ac37ca39
Commit
ac37ca39
authored
6 years ago
by
Xavier Morel
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] doc: github_link compatibility with Sphinx 1.8
parent
d2ba7050
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/_extensions/github_link.py
+5
-5
5 additions, 5 deletions
doc/_extensions/github_link.py
with
5 additions
and
5 deletions
doc/_extensions/github_link.py
+
5
−
5
View file @
ac37ca39
...
...
@@ -91,17 +91,17 @@ def make_github_link(app, path, line=None, mode="blob"):
''
,
''
if
line
is
None
else
'
L%d
'
%
line
))
def
add_doc_link
(
app
,
pagename
,
templatename
,
context
,
doctree
):
"""
Add github_link function linking to the current page on github
"""
if
not
app
.
config
.
github_user
and
app
.
config
.
github_project
:
return
# FIXME: find other way to recover current document's source suffix
# in Sphinx 1.3 it's possible to have mutliple source suffixes and that
# may be useful in the future
source_suffix
=
app
.
config
.
source_suffix
source_suffix
=
source_suffix
if
isinstance
(
source_suffix
,
pycompat
.
string_types
)
else
source_suffix
[
0
]
# in 1.3 source_suffix can be a list
# in 1.8 source_suffix can be a mapping
# FIXME: will break if we ever add support for !rst markdown documents maybe
if
not
isinstance
(
source_suffix
,
pycompat
.
string_types
):
source_suffix
=
next
(
iter
(
source_suffix
))
# can't use functools.partial because 3rd positional is line not mode
context
[
'
github_link
'
]
=
lambda
mode
=
'
edit
'
:
make_github_link
(
app
,
'
doc/%s%s
'
%
(
pagename
,
source_suffix
),
mode
=
mode
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment