Skip to content

Commit 665c449

Browse files
committed
fix: EXACT config from working repo (import ad_api, alabaster theme)
1 parent 6807bbb commit 665c449

File tree

1 file changed

+67
-71
lines changed

1 file changed

+67
-71
lines changed

docs/conf.py

Lines changed: 67 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,86 @@
1-
# -*- coding: utf-8 -*-
1+
# Configuration file for the Sphinx documentation builder.
22
#
3-
# Configuration file for Sphinx documentation
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
import inspect
7+
# -- Path setup --------------------------------------------------------------
48

9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
515
import os
616
import sys
717

8-
# Agregar el directorio padre al path
9-
sys.path.insert(0, os.path.abspath('..'))
18+
sys.path.insert(0, os.path.abspath('.'))
1019

11-
# -- General configuration ------------------------------------------------
20+
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
21+
parentdir = os.path.dirname(currentdir)
22+
sys.path.insert(0, parentdir)
1223

13-
# Extensions
14-
extensions = [
15-
'sphinx.ext.autodoc',
16-
'sphinx.ext.napoleon', # Para docstrings estilo Google
17-
'sphinx_rtd_theme'
18-
]
24+
# Importar el módulo principal - ¡ESTO ES CLAVE Y DIFERENTE A LO QUE HEMOS HECHO!
25+
import ad_api
1926

20-
# Configuración CRÍTICA para métodos decorados
21-
autodoc_default_options = {
22-
'members': True,
23-
'undoc-members': True,
24-
'member-order': 'bysource',
25-
'special-members': '__init__',
26-
'private-members': False,
27-
'show-inheritance': True,
28-
'inherited-members': False,
29-
}
27+
# -- Project information -----------------------------------------------------
3028

31-
# IMPORTANTE para preservar docstrings con decoradores
32-
autodoc_inherit_docstrings = True
33-
autodoc_preserve_defaults = True # Preserva valores por defecto
34-
autodoc_typehints = 'signature' # Muestra type hints
35-
autodoc_typehints_format = 'short'
36-
autodoc_class_signature = 'separated'
29+
project = 'PYTHON-AMAZON-AD-API'
30+
copyright = '2023, Daniel Alvaro'
31+
author = 'Daniel Alvaro'
3732

38-
# Configuración de napoleon para docstrings estilo Google
39-
napoleon_google_docstring = True
40-
napoleon_numpy_docstring = False
41-
napoleon_include_init_with_doc = True
42-
napoleon_include_private_with_doc = False
43-
napoleon_include_special_with_doc = True
44-
napoleon_use_admonition_for_examples = True
45-
napoleon_use_admonition_for_notes = True
46-
napoleon_use_admonition_for_references = True
47-
napoleon_use_ivar = True
48-
napoleon_use_param = True
49-
napoleon_use_rtype = True
50-
napoleon_use_keyword = True
51-
napoleon_preprocess_types = True
33+
# -- General configuration ---------------------------------------------------
34+
35+
# Add any Sphinx extension module names here, as strings. They can be
36+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37+
# ones.
38+
extensions = [
39+
"sphinx_rtd_theme", 'button', 'cookieconsent',
40+
'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.napoleon',
41+
'enum_tools.autoenum',
5242

53-
# Mockear importaciones problemáticas
54-
autodoc_mock_imports = [
55-
'requests',
56-
'cachetools',
57-
'pycryptodome',
58-
'pytz',
59-
'confuse',
60-
'six',
61-
'python-dotenv',
62-
'pyyaml',
63-
# Mockear módulos específicos de ad_api si es necesario
64-
'ad_api.base',
65-
'ad_api.api',
66-
'ad_api.api.sp',
6743
]
6844

69-
# Templates
45+
# Add any paths that contain templates here, relative to this directory.
7046
templates_path = ['_templates']
7147

72-
# Source
73-
source_suffix = '.rst'
74-
master_doc = 'index'
75-
76-
# Project info
77-
project = u'Python Amazon Advertising API'
78-
copyright = u'2023, Daniel Alvaro'
79-
author = u'Daniel Alvaro'
80-
version = u'0.7.4'
81-
release = u'0.7.4'
82-
83-
# Exclusiones
48+
# List of patterns, relative to source directory, that match files and
49+
# directories to ignore when looking for source files.
50+
# This pattern also affects html_static_path and html_extra_path.
8451
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
52+
autodoc_default_options = {"members": True, "undoc-members": True, 'member-order': 'bysource'}
53+
# html_theme_options = {
54+
# "collapse_navigation": False
55+
# }
56+
# -- Options for HTML output -------------------------------------------------
8557

86-
# -- Options for HTML output ----------------------------------------------
58+
# The theme to use for HTML and HTML Help pages. See the documentation for
59+
# a list of builtin themes.
60+
#
61+
# html_theme = 'sphinx_rtd_theme'
62+
# html_theme = "pydata_sphinx_theme"
63+
html_theme = 'alabaster'
8764

88-
html_theme = 'sphinx_rtd_theme'
89-
html_theme_options = {"collapse_navigation": False}
65+
html_theme_options = {
66+
'github_button': True, # optional tweaks
67+
'github_banner': True,
68+
'github_button': True,
69+
'description': '''
70+
A wrapper to access Amazon's Advertising API with an easy-to-use interface.
71+
''',
72+
'donate_url': 'https://github.com/sponsors/denisneuf',
73+
'github_user': 'denisneuf',
74+
'github_repo': 'python-amazon-ad-api',
75+
"github_type": "star", # watch|star|fork
76+
'fixed_sidebar': True
77+
}
78+
# Add any paths that contain custom static files (such as style sheets) here,
79+
relative to this directory. They are copied after the builtin static files,
80+
so a file named "default.css" will overwrite the builtin "default.css".
9081
html_static_path = ['_static']
82+
html_css_files = ['custom.css']
83+
84+
85+
napoleon_google_docstring = True
86+
napoleon_numpy_docstring = False

0 commit comments

Comments
 (0)