Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Xbus emitter
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Xbus emitter
Commits
76b180030261
Commit
76b180030261
authored
1 year ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
fix documentation generation
parent
957b1e0c6bbc
Branches
branch/15.0
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!23
📚 fix documentation generation
Pipeline
#52952
passed
1 year ago
Stage: build
Stage: test
Stage: doc
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/autotodo.py
+3
-2
3 additions, 2 deletions
doc/autotodo.py
doc/conf.py
+16
-12
16 additions, 12 deletions
doc/conf.py
with
19 additions
and
14 deletions
doc/autotodo.py
+
3
−
2
View file @
76b18003
...
...
@@ -22,7 +22,7 @@
import
os
import
os.path
import
sys
from
typing
import
Dict
,
Mapping
,
Tuple
from
collections.abc
import
Mapping
def
main
():
...
...
@@ -99,5 +99,5 @@
res
[
tag
].
extend
(
info
)
def
scan_file
(
filename
,
tags
)
->
T
uple
[
D
ict
[
str
,
T
uple
[
str
,
int
,
str
]],
int
]:
def
scan_file
(
filename
,
tags
)
->
t
uple
[
d
ict
[
str
,
t
uple
[
str
,
int
,
str
]],
int
]:
res
=
{
tag
:
[]
for
tag
in
tags
}
...
...
@@ -103,4 +103,5 @@
res
=
{
tag
:
[]
for
tag
in
tags
}
line_num
:
int
=
0
with
open
(
filename
,
"
r
"
)
as
f
:
for
line_num
,
line
in
enumerate
(
f
):
for
tag
in
tags
:
...
...
This diff is collapsed.
Click to expand it.
doc/conf.py
+
16
−
12
View file @
76b18003
...
...
@@ -33,7 +33,7 @@
"
sphinx.ext.todo
"
,
"
sphinx.ext.coverage
"
,
"
sphinx.ext.graphviz
"
,
"
sphinxodoo.ext.autodoc
"
,
"
sphinxodoo
autodoc
.ext.autodoc
"
,
]
# Add any paths that contain templates here, relative to this directory.
...
...
@@ -145,6 +145,6 @@
#
#
odoo-
sphinx-autodoc
# sphinx-
odoo-
autodoc
#
...
...
@@ -149,7 +149,7 @@
#
# sphinxodoo_addons: List of addons name to load (if empty, no addon will be
# sphinxodoo
autodoc
_addons
: List of addons name to load (if empty, no addon will be
# loaded)
this_module
=
os
.
path
.
basename
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
)
...
...
@@ -152,11 +152,13 @@
# loaded)
this_module
=
os
.
path
.
basename
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
)
sphinxodoo_addons
=
[
this_module
]
# sphinxodoo_root_path : Path of the Odoo root directory
sphinxodoo_root_path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
odoo
.
__file__
)))
# sphinxodoo_addons_path : List of paths were Odoo addons to load are located
sphinxodooautodoc_addons
=
[
this_module
]
# sphinxodooautodoc_root_path : Path of the Odoo root directory
sphinxodooautodoc_root_path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
odoo
.
__file__
))
)
# sphinxodooautodoc_addons_path : List of paths were Odoo addons to load are located
c
=
None
# find setup file of superproject, if any
directory
=
os
.
path
.
dirname
(
os
.
getenv
(
"
PWD
"
))
...
...
@@ -167,7 +169,7 @@
c
.
read
(
setup_path
)
if
c
.
has_section
(
"
odoo_scripts
"
):
# reload with odoo_scripts
c
=
Configuration
(
setup_path
)
c
=
Configuration
(
directory
)
else
:
c
=
None
if
not
c
:
...
...
@@ -176,9 +178,9 @@
else
:
directory
=
None
sphinxodoo_addons_path
=
[]
sphinxodoo
autodoc
_addons_path
=
list
()
if
c
:
addon_dirs
=
set
(
os
.
path
.
dirname
(
path
)
for
path
in
c
.
modules
)
for
line
in
addon_dirs
:
...
...
@@ -180,8 +182,8 @@
if
c
:
addon_dirs
=
set
(
os
.
path
.
dirname
(
path
)
for
path
in
c
.
modules
)
for
line
in
addon_dirs
:
sphinxodoo_addons_path
.
append
(
os
.
path
.
join
(
directory
,
line
))
sphinxodoo
autodoc
_addons_path
.
append
(
os
.
path
.
join
(
directory
,
line
))
else
:
# add this directory top dir
...
...
@@ -186,6 +188,8 @@
else
:
# add this directory top dir
sphinxodoo_addons_path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
getenv
(
"
PWD
"
))))
sphinxodooautodoc_addons_path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
getenv
(
"
PWD
"
)))
)
other_addons
=
os
.
getenv
(
"
ODOO_ADDONS_PATH
"
,
default
=
None
)
if
other_addons
:
for
addon_path
in
other_addons
.
split
(
"
,
"
):
...
...
@@ -189,4 +193,4 @@
other_addons
=
os
.
getenv
(
"
ODOO_ADDONS_PATH
"
,
default
=
None
)
if
other_addons
:
for
addon_path
in
other_addons
.
split
(
"
,
"
):
sphinxodoo_addons_path
.
append
(
addon_path
)
sphinxodoo
autodoc
_addons_path
.
append
(
addon_path
)
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