Skip to content

Commit da910d4

Browse files
committed
Changed: Consumers should now vendor the files instead of using submodule.
1 parent 1eb90df commit da910d4

20 files changed

+734
-108
lines changed

copy-me/docs/index.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,5 @@ This is the main page for your documentation using the Reloaded MkDocs Theme.
66

77
Edit this file to add your project's documentation content.
88

9-
## Features
9+
For guidance, read [How to Document](https://reloaded-project.github.io/Reloaded.MkDocsMaterial.Themes.R2/Pages/contributing.html).
1010

11-
- Built with [Reloaded MkDocs Theme](https://github.com/Reloaded-Project/Reloaded.MkDocsMaterial.Themes.R2)
12-
- Material for MkDocs with Reloaded styling
13-
- Responsive design
14-
- Search functionality
15-
- And much more!
16-
17-
<!-- This line is not visible in the generated documentation. This line is used to receive notifications for updates. Do not delete this line. -->
18-
<!-- Reloaded.MkDocsMaterial.Themes.R2:1.0.0 -->

docs/Images/Nexus-Heart-40.avif renamed to copy-me/docs/vendor/Reloaded/Images/Nexus-Heart-40.avif

File renamed without changes.

docs/Images/Nexus-Icon-40.avif renamed to copy-me/docs/vendor/Reloaded/Images/Nexus-Icon-40.avif

File renamed without changes.

docs/Images/Reloaded-Heart-40.avif renamed to copy-me/docs/vendor/Reloaded/Images/Reloaded-Heart-40.avif

File renamed without changes.

docs/Images/Reloaded-Icon-40.avif renamed to copy-me/docs/vendor/Reloaded/Images/Reloaded-Icon-40.avif

File renamed without changes.

docs/Stylesheets/extra.css renamed to copy-me/docs/vendor/Reloaded/Stylesheets/reloaded.css

File renamed without changes.

copy-me/docs/vendor/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reloaded.MkDocsMaterial.Themes.R2:1.0.0

copy-me/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extra:
1212
link: https://twitter.com/thesewer56?lang=en-GB
1313

1414
extra_css:
15-
- Reloaded/docs/Stylesheets/extra.css
15+
- vendor/Reloaded/Stylesheets/reloaded.css
1616

1717
markdown_extensions:
1818
- admonition
@@ -69,4 +69,4 @@ plugins:
6969
- Reloaded/venv/*
7070

7171
nav:
72-
- Home: index.md
72+
- Home: index.md

copy-me/start_docs.py

100644100755
Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,77 @@
11
#!/usr/bin/env python3
22
"""
3-
Wrapper script that calls the main start_docs.py in the Reloaded directory with parameters.
3+
Script to set up virtual environment and start MkDocs live server for documentation.
44
"""
55

66
import subprocess
77
import sys
8+
import os
89
from pathlib import Path
910

11+
def run_command(cmd, cwd=None):
12+
"""Run a command and handle errors."""
13+
print(f"Running: {' '.join(cmd)}")
14+
try:
15+
result = subprocess.run(cmd, cwd=cwd, check=True, capture_output=False)
16+
return result
17+
except subprocess.CalledProcessError as e:
18+
print(f"Error running command: {e}")
19+
sys.exit(1)
20+
1021
def main():
11-
"""Call the main start_docs.py script with prs-rs specific parameters."""
12-
# Get the directory where this script is located
13-
script_dir = Path(__file__).parent
14-
reloaded_script = script_dir / "docs" / "Reloaded" / "start_docs.py"
22+
"""Main function to set up docs environment."""
23+
import argparse
1524

16-
if not reloaded_script.exists():
17-
print(f"Error: Could not find {reloaded_script}")
18-
sys.exit(1)
25+
parser = argparse.ArgumentParser(description='Set up documentation environment')
26+
parser.add_argument('--docs-dir', type=str, help='Documentation directory containing mkdocs.yml and docs/ subfolder (default: script directory)')
27+
parser.add_argument('--project-name', type=str, default='documentation', help='Project name for messages')
28+
args = parser.parse_args()
29+
30+
# Use docs directory if provided, otherwise use script directory
31+
if args.docs_dir:
32+
script_dir = Path(args.docs_dir)
33+
else:
34+
script_dir = Path(__file__).parent
35+
36+
venv_dir = script_dir / "venv"
37+
38+
print(f"Setting up {args.project_name} environment...")
39+
40+
# Create virtual environment if it doesn't exist
41+
if not venv_dir.exists():
42+
print("Creating virtual environment...")
43+
run_command([sys.executable, "-m", "venv", "venv"], cwd=script_dir)
44+
else:
45+
print("Virtual environment already exists.")
46+
47+
# Determine the python executable in the venv
48+
if os.name == 'nt': # Windows
49+
python_exe = venv_dir / "Scripts" / "python.exe"
50+
pip_exe = venv_dir / "Scripts" / "pip.exe"
51+
else: # Unix-like
52+
python_exe = venv_dir / "bin" / "python"
53+
pip_exe = venv_dir / "bin" / "pip"
54+
55+
# Install required packages
56+
print("Installing required packages...")
57+
58+
# Install from requirements.txt relative to this script if it exists
59+
script_requirements_file = Path(__file__).parent / "docs" / "requirements.txt"
60+
if script_requirements_file.exists():
61+
print(f"Installing from {script_requirements_file}...")
62+
run_command([str(pip_exe), "install", "-r", str(script_requirements_file)], cwd=script_dir)
63+
64+
# Install from requirements.txt in docs directory if it exists
65+
requirements_file = script_dir / "docs" / "requirements.txt"
66+
if requirements_file.exists():
67+
print(f"Installing from {requirements_file}...")
68+
run_command([str(pip_exe), "install", "-r", str(requirements_file)], cwd=script_dir)
1969

20-
# Run the main script with parameters for prs-rs
21-
print(f"Running prs-rs documentation setup from: {reloaded_script}")
22-
subprocess.run([
23-
sys.executable,
24-
str(reloaded_script),
25-
"--docs-dir", str(script_dir),
26-
"--project-name", "prs-rs documentation"
27-
], cwd=script_dir)
70+
# Start MkDocs live server
71+
print("Starting MkDocs live server...")
72+
print("Documentation will be available at http://127.0.0.1:8000 (paste into browser address bar)")
73+
print("Press Ctrl+C to stop the server")
74+
run_command([str(python_exe), "-m", "mkdocs", "serve", "--livereload"], cwd=script_dir)
2875

2976
if __name__ == "__main__":
3077
main()

docs/Pages/contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ It's only 15 minutes 😀.
1212
1. Create a GitHub account.
1313
2. Fork this repository:
1414

15-
![Image](../Images/Contribute/ForkTheRepo.avif)
15+
![Image](..//Images/Contribute/ForkTheRepo.avif)
1616

1717
This will create a copy of the repository on your own user account, which you will be able to edit.
1818

1919
3. Clone this repository.
2020

2121
For example, using GitHub Desktop:
22-
![Image](../Images/Contribute/GitHubDesktop.avif)
22+
![Image](..//Images/Contribute/GitHubDesktop.avif)
2323

2424
4. Make changes inside the `docs` folder.
2525

26-
![Image](../Images/Contribute/Rider.avif)
26+
![Image](..//Images/Contribute/Rider.avif)
2727

2828
Consider using a [*Markdown Cheat Sheet*](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) if you are new to markdown.
2929

@@ -34,7 +34,7 @@ It's only 15 minutes 😀.
3434

3535
6. Open a `Pull Request`.
3636

37-
![Image](../Images/Contribute/OpenPullRequest.avif)
37+
![Image](..//Images/Contribute/OpenPullRequest.avif)
3838

3939
Opening a `Pull Request` will allow us to review your changes before adding them with the main official page. If everything's good, we'll hit the merge button and add your changes to the official repository.
4040

@@ -89,7 +89,7 @@ If you prefer to set up manually without scripts:
8989
mkdocs serve --livereload
9090
```
9191

92-
![Image](../Images/Contribute/LocalRun.avif)
92+
![Image](..//Images/Contribute/LocalRun.avif)
9393

9494
Copy the address to your web browser and enjoy the live preview; any changes you save will be shown instantly.
9595

0 commit comments

Comments
 (0)