cloudmesh-ai-theme 7.0.1__py3-none-any.whl
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.
- cloudmesh_ai_theme/__init__.py +29 -0
- cloudmesh_ai_theme/assets/favicon copy.ico +0 -0
- cloudmesh_ai_theme/assets/favicon.svg +48 -0
- cloudmesh_ai_theme/assets/logo-white.png +0 -0
- cloudmesh_ai_theme/css/custom.css +11 -0
- cloudmesh_ai_theme/plugin.py +64 -0
- cloudmesh_ai_theme/theme/main.html +30 -0
- cloudmesh_ai_theme/theme.yml +1 -0
- cloudmesh_ai_theme-7.0.1.dist-info/METADATA +198 -0
- cloudmesh_ai_theme-7.0.1.dist-info/RECORD +13 -0
- cloudmesh_ai_theme-7.0.1.dist-info/WHEEL +5 -0
- cloudmesh_ai_theme-7.0.1.dist-info/entry_points.txt +5 -0
- cloudmesh_ai_theme-7.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
def get_version():
|
|
5
|
+
# 1. Try to read from VERSION file in the package root (installed)
|
|
6
|
+
try:
|
|
7
|
+
version_file = Path(__file__).parent / "VERSION"
|
|
8
|
+
if version_file.exists():
|
|
9
|
+
return version_file.read_text().strip()
|
|
10
|
+
except Exception:
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
# 2. Try to read from VERSION file in the project root (development)
|
|
14
|
+
try:
|
|
15
|
+
# __file__ is .../src/cloudmesh_ai_theme/__init__.py
|
|
16
|
+
# Project root is two levels up from src/
|
|
17
|
+
project_root_version = Path(__file__).parent.parent.parent / "VERSION"
|
|
18
|
+
if project_root_version.exists():
|
|
19
|
+
return project_root_version.read_text().strip()
|
|
20
|
+
except Exception:
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
# 3. Fallback to importlib.metadata
|
|
24
|
+
try:
|
|
25
|
+
return version("cloudmesh-ai-theme")
|
|
26
|
+
except PackageNotFoundError:
|
|
27
|
+
return "0.0.0"
|
|
28
|
+
|
|
29
|
+
__version__ = get_version()
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="cloudBlue" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#1e90ff"/>
|
|
5
|
+
<stop offset="100%" stop-color="#006dff"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
|
|
8
|
+
<filter id="shadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
9
|
+
<feDropShadow dx="0" dy="8" stdDeviation="16" flood-color="#000000" flood-opacity="0.18"/>
|
|
10
|
+
</filter>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- Transparent Background -->
|
|
14
|
+
<rect width="512" height="512" fill="transparent"/>
|
|
15
|
+
|
|
16
|
+
<!-- Cloud -->
|
|
17
|
+
<g filter="url(#shadow)">
|
|
18
|
+
<path
|
|
19
|
+
d="
|
|
20
|
+
M95 400
|
|
21
|
+
H417
|
|
22
|
+
C470 400 502 362 502 307
|
|
23
|
+
C502 258 468 223 423 223
|
|
24
|
+
H405
|
|
25
|
+
C390 138 326 92 255 92
|
|
26
|
+
C182 92 124 140 105 205
|
|
27
|
+
C53 210 18 248 18 305
|
|
28
|
+
C18 362 48 400 95 400
|
|
29
|
+
Z
|
|
30
|
+
"
|
|
31
|
+
fill="url(#cloudBlue)"
|
|
32
|
+
/>
|
|
33
|
+
</g>
|
|
34
|
+
|
|
35
|
+
<!-- Perfectly Centered AI -->
|
|
36
|
+
<text
|
|
37
|
+
x="230"
|
|
38
|
+
y="285"
|
|
39
|
+
text-anchor="middle"
|
|
40
|
+
dominant-baseline="middle"
|
|
41
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
42
|
+
font-size="245"
|
|
43
|
+
font-weight="900"
|
|
44
|
+
fill="#ffffff"
|
|
45
|
+
letter-spacing="-18">
|
|
46
|
+
AI
|
|
47
|
+
</text>
|
|
48
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.doc-object {
|
|
2
|
+
border: 1px solid rgba(0, 0, 0, 0.2) !important;
|
|
3
|
+
border-radius: 4px !important;
|
|
4
|
+
padding: 0.5rem !important;
|
|
5
|
+
margin: 0.5rem 0 !important;
|
|
6
|
+
background-color: var(--md-code-bg-color, #ffffff) !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-md-color-scheme="slate"] .doc-object {
|
|
10
|
+
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
|
11
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from mkdocs.plugins import BasePlugin
|
|
2
|
+
from mkdocs.config import config_options
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CloudmeshAIThemePlugin(BasePlugin):
|
|
6
|
+
"""
|
|
7
|
+
Clean MkDocs plugin:
|
|
8
|
+
- Injects branding defaults
|
|
9
|
+
- Configures theme safely
|
|
10
|
+
- Does NOT modify filesystem
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
config_scheme = (
|
|
14
|
+
("primary_color", config_options.Type(str, default="#1e90ff")),
|
|
15
|
+
("logo", config_options.Type(str, default=None)),
|
|
16
|
+
("favicon", config_options.Type(str, default=None)),
|
|
17
|
+
("inject_css", config_options.Type(bool, default=True)),
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def on_config(self, config):
|
|
21
|
+
theme = config.get("theme")
|
|
22
|
+
|
|
23
|
+
if not theme:
|
|
24
|
+
config["theme"] = {}
|
|
25
|
+
theme = config["theme"]
|
|
26
|
+
|
|
27
|
+
# Ensure Material theme baseline
|
|
28
|
+
theme["name"] = theme.get("name", "material")
|
|
29
|
+
|
|
30
|
+
# Branding defaults
|
|
31
|
+
if self.config["logo"]:
|
|
32
|
+
theme["logo"] = self.config["logo"]
|
|
33
|
+
|
|
34
|
+
if self.config["favicon"]:
|
|
35
|
+
theme["favicon"] = self.config["favicon"]
|
|
36
|
+
|
|
37
|
+
# Inject palette safely (do not overwrite user config)
|
|
38
|
+
theme.setdefault("palette", [
|
|
39
|
+
{
|
|
40
|
+
"scheme": "default",
|
|
41
|
+
"primary": self.config["primary_color"],
|
|
42
|
+
"accent": self.config["primary_color"],
|
|
43
|
+
"toggle": {
|
|
44
|
+
"icon": "brightness-7",
|
|
45
|
+
"name": "Switch to dark mode",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"scheme": "slate",
|
|
50
|
+
"primary": self.config["primary_color"],
|
|
51
|
+
"accent": self.config["primary_color"],
|
|
52
|
+
"toggle": {
|
|
53
|
+
"icon": "brightness-4",
|
|
54
|
+
"name": "Switch to light mode",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
# Inject CSS via MkDocs native mechanism
|
|
60
|
+
if self.config["inject_css"]:
|
|
61
|
+
config.setdefault("extra_css", [])
|
|
62
|
+
config["extra_css"].append("cloudmesh_ai_theme/custom.css")
|
|
63
|
+
|
|
64
|
+
return config
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block extrahead %}
|
|
4
|
+
{{ super() }}
|
|
5
|
+
<link rel="stylesheet" href="{{ path.rel_path('theme/custom.css') }}">
|
|
6
|
+
{% if theme.primary_color %}
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--md-primary-color: {{ theme.primary_color }};
|
|
10
|
+
}
|
|
11
|
+
</style>
|
|
12
|
+
{% endif %}
|
|
13
|
+
{% endblock %}
|
|
14
|
+
|
|
15
|
+
{% block site_name %}
|
|
16
|
+
<a href="{{ 'home'|url }}" class="site-title">
|
|
17
|
+
{% if theme.logo %}
|
|
18
|
+
<img src="{{ theme.logo }}" alt="Logo">
|
|
19
|
+
{% else %}
|
|
20
|
+
Cloudmesh AI
|
|
21
|
+
{% endif %}
|
|
22
|
+
</a>
|
|
23
|
+
{% endblock %}
|
|
24
|
+
|
|
25
|
+
{% block footer %}
|
|
26
|
+
{{ super() }}
|
|
27
|
+
<div class="footer-branding" style="text-align: center; padding: 1em; font-size: 0.8em; opacity: 0.7;">
|
|
28
|
+
© {{ now().year }} Cloudmesh AI. All rights reserved.
|
|
29
|
+
</div>
|
|
30
|
+
{% endblock %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
base_theme: material
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cloudmesh-ai-theme
|
|
3
|
+
Version: 7.0.1
|
|
4
|
+
Summary: Theme for Cloudmesh AI documentation
|
|
5
|
+
Author: Cloudmesh AI Contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/cloudmesh/cloudmesh-ai-theme
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: mkdocs
|
|
14
|
+
|
|
15
|
+
# Cloudmesh AI Theme Guide
|
|
16
|
+
|
|
17
|
+
Welcome to the guide for the **Cloudmesh AI Theme**. This package provides a consistent look and feel for Cloudmesh AI project documentation, built as an extension of the Material for MkDocs theme.
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
- [Introduction](#introduction)
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Usage](#usage-guide)
|
|
23
|
+
- [Primary Method (Recommended)](#primary-method-recommended)
|
|
24
|
+
- [Configuration Options](#configuration-options)
|
|
25
|
+
- [Alternative: Manual Asset Deployment](#alternative-manual-asset-deployment)
|
|
26
|
+
- [Development & Contribution](#development--contribution)
|
|
27
|
+
- [Local Development](#local-development)
|
|
28
|
+
- [Running Tests](#running-tests)
|
|
29
|
+
- [Maintainer's Guide](#maintainers-guide)
|
|
30
|
+
- [Project Structure](#project-structure)
|
|
31
|
+
- [Version Management](#version-management)
|
|
32
|
+
- [Release Process](#release-process)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Introduction
|
|
37
|
+
|
|
38
|
+
The `cloudmesh-ai-theme` is a Python package that provides branding for Cloudmesh AI documentation. Instead of copying CSS and images into every project, this package allows you to apply the theme via a configuration change in your `mkdocs.yml`.
|
|
39
|
+
|
|
40
|
+
It automatically handles:
|
|
41
|
+
- **Branding**: Injects the "Cloudmesh AI" site name and a standardized footer.
|
|
42
|
+
- **Styling**: Applies custom CSS.
|
|
43
|
+
- **Assets**: Provides shared logos and favicons.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
The theme is distributed as a Python package. You can install it using `pip`:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install cloudmesh-ai-theme
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
### Primary Method (Recommended)
|
|
60
|
+
|
|
61
|
+
The simplest way to use the theme is to specify it by name in your `mkdocs.yml` file. This method automatically applies all branding, styles, and assets.
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
theme:
|
|
65
|
+
name: cloudmesh-ai-theme
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Configuration Options
|
|
69
|
+
|
|
70
|
+
You can customize the theme while maintaining the Cloudmesh AI layout. Currently, the following options are supported:
|
|
71
|
+
|
|
72
|
+
#### `primary_color`
|
|
73
|
+
Change the primary accent color of the theme.
|
|
74
|
+
```yaml
|
|
75
|
+
theme:
|
|
76
|
+
name: cloudmesh-ai-theme
|
|
77
|
+
primary_color: "#ff0000" # Example: Red
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### `logo` and `favicon`
|
|
81
|
+
You can override the default Cloudmesh AI logo and favicon by specifying their paths in your `mkdocs.yml`. SVG favicons are recommended for better scalability and quality.
|
|
82
|
+
```yaml
|
|
83
|
+
theme:
|
|
84
|
+
name: cloudmesh-ai-theme
|
|
85
|
+
logo: assets/my-logo.png
|
|
86
|
+
favicon: assets/my-favicon.svg
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Alternative: Manual Asset Deployment
|
|
90
|
+
|
|
91
|
+
If you need direct access to the CSS and image files within your project directory (e.g., for further local overrides), you can deploy the assets manually.
|
|
92
|
+
|
|
93
|
+
1. **Run the deployment command**:
|
|
94
|
+
```bash
|
|
95
|
+
cloudmesh-ai-theme-install
|
|
96
|
+
```
|
|
97
|
+
This will copy the assets into `docs/theme/` in your current project.
|
|
98
|
+
|
|
99
|
+
2. **Reference assets in `mkdocs.yml`**:
|
|
100
|
+
```yaml
|
|
101
|
+
extra_css:
|
|
102
|
+
- theme/custom.css
|
|
103
|
+
|
|
104
|
+
theme:
|
|
105
|
+
favicon: theme/assets/favicon.svg
|
|
106
|
+
logo: theme/assets/logo-white.png
|
|
107
|
+
name: material
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Development & Contribution
|
|
113
|
+
|
|
114
|
+
### Local Development
|
|
115
|
+
|
|
116
|
+
To make changes to the theme and see them reflected in your projects immediately, install the package in editable mode:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cd cloudmesh-ai-theme
|
|
120
|
+
pip install -e .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Running Tests
|
|
124
|
+
|
|
125
|
+
The theme includes a verification suite to ensure that the package builds and renders correctly.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cd cloudmesh-ai-theme/tests
|
|
129
|
+
python test_theme.py
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Maintainer's Guide
|
|
135
|
+
|
|
136
|
+
### Project Structure
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
cloudmesh-ai-theme/
|
|
140
|
+
├── .github/workflows/ # CI/CD pipelines
|
|
141
|
+
├── src/
|
|
142
|
+
│ └── cloudmesh_ai_theme/
|
|
143
|
+
│ ├── __init__.py # Package logic & versioning
|
|
144
|
+
│ ├── assets/ # Logos and favicons
|
|
145
|
+
│ ├── css/ # Custom stylesheets
|
|
146
|
+
│ └── theme/ # MkDocs templates (main.html)
|
|
147
|
+
├── tests/ # Verification suite
|
|
148
|
+
├── VERSION # Single source of truth for version
|
|
149
|
+
├── pyproject.toml # Build system & metadata
|
|
150
|
+
└── README.md # This guide
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Version Management
|
|
154
|
+
|
|
155
|
+
The version is managed in the `VERSION` file at the root of the repository. To bump the version:
|
|
156
|
+
1. Edit the `VERSION` file (e.g., change `0.1.0` to `0.1.1`).
|
|
157
|
+
2. Commit the change:
|
|
158
|
+
```bash
|
|
159
|
+
git add VERSION
|
|
160
|
+
git commit -m "Bump version to 0.1.1"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Release Process
|
|
164
|
+
|
|
165
|
+
Releases are automated via GitHub Actions. To trigger a new release:
|
|
166
|
+
1. Create a git tag following the `v*` pattern:
|
|
167
|
+
```bash
|
|
168
|
+
git tag v0.1.0
|
|
169
|
+
git push origin v0.1.0
|
|
170
|
+
```
|
|
171
|
+
2. The GitHub Action will automatically build the `.whl` and `.tar.gz` distributions and upload them as artifacts.
|
|
172
|
+
|
|
173
|
+
#### Publishing to PyPI
|
|
174
|
+
|
|
175
|
+
The easiest way to upload the package to PyPI is using the provided `Makefile`:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
make pypi
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
This command automatically installs the necessary build tools, builds the distribution, and uploads it to PyPI using `twine`.
|
|
182
|
+
|
|
183
|
+
**Manual Upload (without Makefile):**
|
|
184
|
+
1. Install build tools:
|
|
185
|
+
```bash
|
|
186
|
+
pip install build twine
|
|
187
|
+
```
|
|
188
|
+
2. Build the distribution:
|
|
189
|
+
```bash
|
|
190
|
+
python -m build
|
|
191
|
+
```
|
|
192
|
+
3. Upload to PyPI:
|
|
193
|
+
```bash
|
|
194
|
+
python -m twine upload dist/*
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Automated Upload (GitHub Actions):**
|
|
198
|
+
To automate publishing, add a `pypi-publish` step to the `.github/workflows/release.yml` file and configure a `PYPI_API_TOKEN` in your GitHub repository secrets.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
cloudmesh_ai_theme/__init__.py,sha256=cOfMm5NKT3RNNsIdF1Plm6trcQkNge2bwEoX6oInxw4,953
|
|
2
|
+
cloudmesh_ai_theme/plugin.py,sha256=EhOcwBKTsy57VDxRwd6mhVMpmZfUXepmIenyB-kR4zo,1984
|
|
3
|
+
cloudmesh_ai_theme/theme.yml,sha256=U7XjlFg2874RqIF5klDrH9g1Y2nJIu8g2S2dJHewxQg,20
|
|
4
|
+
cloudmesh_ai_theme/assets/favicon copy.ico,sha256=tucsh653IAXPoED-dJC1nCjiSDT_xsjZyPQbdwC9TCU,8147
|
|
5
|
+
cloudmesh_ai_theme/assets/favicon.svg,sha256=cPv3SmvO27aVZ9VUqPlgwovI01dlk7YAL9IUbyEM-eI,1205
|
|
6
|
+
cloudmesh_ai_theme/assets/logo-white.png,sha256=fyWFcQVO32E0XOJ3-sBOdq8UcwbVqlgoIsGGvkk_W6A,12448
|
|
7
|
+
cloudmesh_ai_theme/css/custom.css,sha256=tdJyHtidi1A8kdjqECJZ8HwWygvpJI8VoPRKnRsoGiA,348
|
|
8
|
+
cloudmesh_ai_theme/theme/main.html,sha256=iHcWKL8ggcDozvpY9wjBdQSCioePzEvOi0-FbmSR_KU,733
|
|
9
|
+
cloudmesh_ai_theme-7.0.1.dist-info/METADATA,sha256=vPKWWPFiG6W6DOgNv-DG4Ni-OP9EnBxDPHr_hJPXP6Q,5695
|
|
10
|
+
cloudmesh_ai_theme-7.0.1.dist-info/WHEEL,sha256=YLJXdYXQ2FQ0Uqn2J-6iEIC-3iOey8lH3xCtvFLkd8Q,91
|
|
11
|
+
cloudmesh_ai_theme-7.0.1.dist-info/entry_points.txt,sha256=D4tjbJpNUbyIp7g8otJPfTDuuclf1sy9D5QYnzHIb6U,169
|
|
12
|
+
cloudmesh_ai_theme-7.0.1.dist-info/top_level.txt,sha256=ZjhIWObUVQ8d6lu2QiMTcS4blgiZq34XkdXo-LZ86VA,19
|
|
13
|
+
cloudmesh_ai_theme-7.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cloudmesh_ai_theme
|