mkdocs-simple-plugin 4.0.0__tar.gz → 4.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/.gitignore +1 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/PKG-INFO +1 -1
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/generator.py +30 -3
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/LICENSE +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/README.md +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/.pages +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/README.md +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/__init__.py +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/plugin.py +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/semiliterate.py +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/simple.py +0 -0
- {mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-simple-plugin
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Summary: Plugin for adding simple wiki site creation from markdown files interspersed within your code with MkDocs.
|
|
5
5
|
Project-URL: Documentation, http://www.althack.dev/mkdocs-simple-plugin
|
|
6
6
|
Project-URL: Homepage, http://www.althack.dev/mkdocs-simple-plugin
|
|
@@ -53,24 +53,48 @@ def default_config():
|
|
|
53
53
|
# Set the default edit uri to empty since doc files are built from source
|
|
54
54
|
# and may not exist.
|
|
55
55
|
config['edit_uri'] = ''
|
|
56
|
+
return config
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def apply_environment_config(config, existing_config=None):
|
|
60
|
+
"""Set config values from non-empty environment inputs."""
|
|
61
|
+
existing_config = existing_config or {}
|
|
56
62
|
|
|
57
63
|
def maybe_set_string(name):
|
|
64
|
+
env_variable = "DEFAULT_" + name.upper()
|
|
65
|
+
config_variable = name.lower()
|
|
66
|
+
config_exists = config_variable in existing_config
|
|
67
|
+
if os.environ.get(env_variable) and not config_exists:
|
|
68
|
+
config[config_variable] = os.environ[env_variable]
|
|
69
|
+
|
|
70
|
+
def maybe_set_dict(name, key):
|
|
71
|
+
env_variable = "DEFAULT_" + name.upper()
|
|
72
|
+
config_variable = name.lower()
|
|
73
|
+
config_exists = config_variable in existing_config
|
|
74
|
+
if os.environ.get(env_variable) and not config_exists:
|
|
75
|
+
config[config_variable] = {key: os.environ[env_variable]}
|
|
76
|
+
|
|
77
|
+
def set_string(name):
|
|
58
78
|
env_variable = "INPUT_" + name.upper()
|
|
59
79
|
config_variable = name.lower()
|
|
60
80
|
if os.environ.get(env_variable):
|
|
61
81
|
config[config_variable] = os.environ[env_variable]
|
|
62
82
|
|
|
63
|
-
def
|
|
83
|
+
def set_dict(name, key):
|
|
64
84
|
env_variable = "INPUT_" + name.upper()
|
|
65
85
|
config_variable = name.lower()
|
|
66
86
|
if os.environ.get(env_variable):
|
|
67
87
|
config[config_variable] = {key: os.environ[env_variable]}
|
|
68
|
-
|
|
88
|
+
|
|
69
89
|
maybe_set_string("site_name")
|
|
70
90
|
maybe_set_string("site_url")
|
|
71
91
|
maybe_set_string("repo_url")
|
|
72
92
|
maybe_set_dict("theme", "name")
|
|
73
|
-
|
|
93
|
+
|
|
94
|
+
set_string("site_name")
|
|
95
|
+
set_string("site_url")
|
|
96
|
+
set_string("repo_url")
|
|
97
|
+
set_dict("theme", "name")
|
|
74
98
|
|
|
75
99
|
|
|
76
100
|
class MkdocsConfigDumper(yaml.Dumper):
|
|
@@ -100,9 +124,11 @@ def write_config(config_file, config):
|
|
|
100
124
|
def setup_config(config_file="mkdocs.yml"):
|
|
101
125
|
"""Create the mkdocs.yml file with defaults for params that don't exist."""
|
|
102
126
|
config = default_config()
|
|
127
|
+
local_config = {}
|
|
103
128
|
if not os.path.exists(config_file):
|
|
104
129
|
# If config file doesn't exit, create a simple one, guess the site name
|
|
105
130
|
# from the folder name.
|
|
131
|
+
apply_environment_config(config)
|
|
106
132
|
write_config(config_file, config)
|
|
107
133
|
# Open the config file to verify settings.
|
|
108
134
|
with open(config_file, 'r', encoding="utf-8") as stream:
|
|
@@ -112,6 +138,7 @@ def setup_config(config_file="mkdocs.yml"):
|
|
|
112
138
|
# Overwrite default config values with local mkdocs.yml
|
|
113
139
|
config.update(local_config)
|
|
114
140
|
print(config)
|
|
141
|
+
apply_environment_config(config, local_config)
|
|
115
142
|
if not os.path.exists(config["docs_dir"]):
|
|
116
143
|
# Ensure docs directory exists.
|
|
117
144
|
print("making docs_dir %s", config["docs_dir"])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mkdocs_simple_plugin-4.0.0 → mkdocs_simple_plugin-4.0.1}/mkdocs_simple_plugin/semiliterate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|