1- # -*- coding: utf-8 -*-
21# Licensed under the Apache License, Version 2.0 (the "License");
32# you may not use this file except in compliance with the License.
43# You may obtain a copy of the License at
1817
1918from recommonmark .transform import AutoStructify
2019
21- # --
22- # Copy README.md, CONTRIBUTING.md to source/ directory and replace
23- # all paths to point github files.
24- def _copy_with_converting_link_to_repo (filename , new_filename ):
25- base_url = 'https://github.com/kubernetes-client/python/blob/master/'
26-
27- def subf (subs ):
28- label , url = subs .groups ()
29- if not url .startswith ('http://' ) and not url .startswith ('https://' ):
30- url = base_url + url
31- return label + '(' + url + ')'
3220
33- with open (filename , "r" ) as r :
34- data = re .sub ("(\[[^\]]+\])\(([^\)]+)\)" , subf , r .read ())
35-
36- with open (new_filename , "w" ) as w :
37- w .write (data )
38-
39- _copy_with_converting_link_to_repo ("../../README.md" , "README.md" )
40- _copy_with_converting_link_to_repo ("../../CONTRIBUTING.md" , "CONTRIBUTING.md" )
41- # --
42-
43- sys .path .insert (0 , os .path .abspath ('../..' ))
4421# -- General configuration ----------------------------------------------------
4522
4623source_suffix = ['.rst' , '.md' ]
@@ -50,23 +27,17 @@ def subf(subs):
5027extensions = [
5128 'sphinx_markdown_tables' ,
5229 'recommonmark' ,
53- 'sphinx.ext.autodoc' ,
54- #'sphinx.ext.intersphinx',
5530]
5631
57- # autodoc generation is a bit aggressive and a nuisance when doing heavy
58- # text edit cycles.
59- # execute "export SPHINX_DEBUG=1" in your terminal to disable
60-
6132# The suffix of source filenames.
62- source_suffix = '.rst'
33+ source_suffix = [ '.rst' , '.md' ]
6334
6435# The master toctree document.
6536master_doc = 'index'
6637
6738# General information about the project.
68- project = u 'kubernetes-python-client'
69- copyright = u '2017, Kubernetes'
39+ project = 'kubernetes-python-client'
40+ copyright = '2017-present , Kubernetes'
7041
7142# If true, '()' will be appended to :func: etc. cross-reference text.
7243add_function_parentheses = True
@@ -78,33 +49,36 @@ def subf(subs):
7849# The name of the Pygments (syntax highlighting) style to use.
7950pygments_style = 'sphinx'
8051
81- # -- Options for HTML output --------------------------------------------------
82-
83- # The theme to use for HTML and HTML Help pages. Major themes that come with
84- # Sphinx are currently 'default' and 'sphinxdoc'.
85- # html_theme_path = ["."]
86- # html_theme = '_theme'
87- # html_static_path = ['static']
88-
89- # Output file base name for HTML help builder.
90- htmlhelp_basename = '%sdoc' % project
91-
92- # Grouping the document tree into LaTeX files. List of tuples
93- # (source start file, target name, title, author, documentclass
94- # [howto/manual]).
95- latex_documents = [
96- ('index' ,
97- '%s.tex' % project ,
98- u'%s Documentation' % project ,
99- u'Kubernetes' , 'manual' ),
100- ]
10152
102- # Example configuration for intersphinx: refer to the Python standard library.
103- #intersphinx_mapping = {'http://docs.python.org/': None}
53+ # Copy README.md, CONTRIBUTING.md to source/ directory and replace
54+ # all paths to point github files.
55+ def _copy_with_converting_link_to_repo (filename , new_filename ):
56+ base_url = 'https://github.com/kubernetes-client/python/blob/master/'
57+
58+ def subf (subs ):
59+ label , url = subs .groups ()
60+ if not url .startswith ('http://' ) and not url .startswith ('https://' ):
61+ url = base_url + url
62+ return label + '(' + url + ')'
63+
64+ with open (filename , "r" ) as r :
65+ data = re .sub ("(\[[^\]]+\])\(([^\)]+)\)" , subf , r .read ())
66+
67+ with open (new_filename , "w" ) as w :
68+ w .write (data )
69+
70+
71+ _copy_with_converting_link_to_repo ("../../README.md" , "README.md" )
72+ _copy_with_converting_link_to_repo ("../../CONTRIBUTING.md" , "CONTRIBUTING.md" )
73+
74+
10475def setup (app ):
105- app .add_config_value ('recommonmark_config' , {
76+ app .add_config_value (
77+ 'recommonmark_config' ,
78+ {
10679 'auto_toc_tree_section' : 'Contents' ,
10780 'enable_eval_rst' : True ,
108- }, True )
81+ },
82+ True ,
83+ )
10984 app .add_transform (AutoStructify )
110-
0 commit comments