yuccaaa commited on
Commit
359ccd3
·
verified ·
1 Parent(s): b263af4

Upload ms-swift/docs/source/conf.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. ms-swift/docs/source/conf.py +117 -0
ms-swift/docs/source/conf.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
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
+
7
+ # -- Path setup --------------------------------------------------------------
8
+
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
15
+
16
+ # import sphinx_book_theme
17
+
18
+ sys.path.insert(0, os.path.abspath('../../'))
19
+ # -- Project information -----------------------------------------------------
20
+
21
+ project = 'swift'
22
+ copyright = '2022-2024, Alibaba ModelScope'
23
+ author = 'ModelScope Authors'
24
+ version_file = '../../swift/version.py'
25
+ html_theme = 'sphinx_rtd_theme'
26
+ language = 'zh_CN'
27
+
28
+
29
+ def get_version():
30
+ with open(version_file, 'r', encoding='utf-8') as f:
31
+ exec(compile(f.read(), version_file, 'exec'))
32
+ return locals()['__version__']
33
+
34
+
35
+ # The full version, including alpha/beta/rc tags
36
+ version = get_version()
37
+ release = version
38
+
39
+ # -- General configuration ---------------------------------------------------
40
+
41
+ # Add any Sphinx extension module names here, as strings. They can be
42
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
43
+ # ones.
44
+ extensions = [
45
+ 'sphinx.ext.napoleon',
46
+ 'sphinx.ext.autosummary',
47
+ 'sphinx.ext.autodoc',
48
+ 'sphinx.ext.viewcode',
49
+ 'sphinx_markdown_tables',
50
+ 'sphinx_copybutton',
51
+ 'myst_parser',
52
+ ]
53
+
54
+ # build the templated autosummary files
55
+ autosummary_generate = True
56
+ numpydoc_show_class_members = False
57
+
58
+ # Enable overriding of function signatures in the first line of the docstring.
59
+ autodoc_docstring_signature = True
60
+
61
+ # Disable docstring inheritance
62
+ autodoc_inherit_docstrings = False
63
+
64
+ # Show type hints in the description
65
+ autodoc_typehints = 'description'
66
+
67
+ # Add parameter types if the parameter is documented in the docstring
68
+ autodoc_typehints_description_target = 'documented_params'
69
+
70
+ autodoc_default_options = {
71
+ 'member-order': 'bysource',
72
+ }
73
+
74
+ # Add any paths that contain templates here, relative to this directory.
75
+ templates_path = ['_templates']
76
+
77
+ # The suffix(es) of source filenames.
78
+ # You can specify multiple suffix as a list of string:
79
+ #
80
+ source_suffix = ['.rst', '.md']
81
+
82
+ # The master toctree document.
83
+ root_doc = 'index'
84
+
85
+ # List of patterns, relative to source directory, that match files and
86
+ # directories to ignore when looking for source files.
87
+ # This pattern also affects html_static_path and html_extra_path.
88
+ exclude_patterns = ['build', 'source/.ipynb_checkpoints', 'source/api/generated', 'Thumbs.db', '.DS_Store']
89
+ # A list of glob-style patterns [1] that are used to find source files.
90
+ # They are matched against the source file names relative to the source directory,
91
+ # using slashes as directory separators on all platforms.
92
+ # The default is **, meaning that all files are recursively included from the source directory.
93
+ # -- Options for HTML output -------------------------------------------------
94
+
95
+ # The theme to use for HTML and HTML Help pages. See the documentation for
96
+ # a list of builtin themes.
97
+ #
98
+ # html_theme = 'sphinx_book_theme'
99
+ # html_theme_path = [sphinx_book_theme.get_html_theme_path()]
100
+ # html_theme_options = {}
101
+
102
+ # Add any paths that contain custom static files (such as style sheets) here,
103
+ # relative to this directory. They are copied after the builtin static files,
104
+ # so a file named "default.css" will overwrite the builtin "default.css".
105
+ html_static_path = ['_static']
106
+ # html_css_files = ['css/readthedocs.css']
107
+
108
+ # -- Options for HTMLHelp output ---------------------------------------------
109
+ # Output file base name for HTML help builder.
110
+
111
+ # -- Extension configuration -------------------------------------------------
112
+ # Ignore >>> when copying code
113
+ copybutton_prompt_text = r'>>> |\.\.\. '
114
+ copybutton_prompt_is_regexp = True
115
+
116
+ # Example configuration for intersphinx: refer to the Python standard library.
117
+ intersphinx_mapping = {'https://docs.python.org/': None}