Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Commit 9334bed

Browse files
KemingHegithub-actions[bot]
authored andcommitted
docs(src/assets/): update conda official documentation
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4f75a8c commit 9334bed

151 files changed

Lines changed: 13039 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/assets/conda/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Minimal makefile for Sphinx documentation
2+
3+
# You can set these variables from the command line.
4+
SPHINXOPTS =
5+
SPHINXBUILD = python3 -msphinx
6+
SPHINXPROJ = conda
7+
SOURCEDIR = source
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
livehtml:
15+
@AUTOBUILD=1 sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --ignore=.git/* --ignore=_build/* $(O)
16+
17+
serve:
18+
python3 -m http.server --directory "$(BUILDDIR)/html"
19+
20+
.PHONY: help livehtml serve Makefile
21+
22+
# Catch-all target: route all unknown targets to Sphinx using the new
23+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
24+
%: Makefile
25+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

src/assets/conda/_metadata.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source_repo: conda/conda
2+
docs_path: docs
3+
updated_at: 2025-07-16T02:52:06Z
4+
commit_sha: 85832cc9d76ac9316c6bc8fdac68cf053edfeee6

src/assets/conda/environment.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: sphinx
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- Pillow==10.1.0
6+
- Sphinx<9
7+
- boltons>=23.0.0
8+
- conda-sphinx-theme==0.3.0
9+
- frozendict>=2.4.2
10+
- linkify-it-py==2.0.2
11+
- myst-parser==2.0.0
12+
- pluggy==1.3.0
13+
- pylint==3.0.2
14+
- requests>=2.28.0,<3
15+
- ruamel.yaml>=0.11.14,<0.19
16+
- sphinx-argparse==0.5.2
17+
- sphinx-autoapi==3.0.0
18+
- sphinx-autobuild==2021.3.14
19+
- sphinx-reredirects==0.1.5
20+
- sphinx-sitemap==2.5.1
21+
- sphinx-design==0.5.0
22+
- sphinxcontrib-applehelp==1.0.7
23+
- sphinxcontrib-devhelp==1.0.5
24+
- sphinxcontrib-htmlhelp==2.0.4
25+
- sphinxcontrib-jsmath==1.0.1
26+
- sphinxcontrib-mermaid==0.9.2
27+
- sphinxcontrib-programoutput==0.17
28+
- sphinxcontrib-qthelp==1.0.6
29+
- sphinxcontrib-serializinghtml==1.1.9
30+
- tqdm>=4
31+
- conda-libmamba-solver>=24.11.0
32+
- pip>25
33+
- pip:
34+
- sphinxcontrib-plantuml==0.21
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#!/usr/bin/env python
2+
# Copyright (C) 2012 Anaconda, Inc
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
import fileinput
5+
import os
6+
import shutil
7+
import sys
8+
9+
import requests
10+
from pylint.pyreverse.main import Run
11+
12+
here = os.path.dirname(__file__)
13+
plantuml_jarfile_url = (
14+
"https://sourceforge.net/projects/plantuml/files/plantuml.jar/download"
15+
)
16+
17+
18+
# files and folders to ignore during generating the UML files
19+
ignore = [
20+
"_vendor.py",
21+
"compat.py",
22+
"misc.py",
23+
"utils.py",
24+
"exports.py",
25+
"api.py",
26+
]
27+
28+
# additional PLantUML directives to add
29+
extra_puml = "\n".join(
30+
[
31+
"left to right direction",
32+
"skinparam nodesep 5",
33+
"skinparam ranksep 5",
34+
]
35+
)
36+
37+
# some replacement to patch the PlantUML generated by pyreverse
38+
replacements = (
39+
(
40+
"set namespaceSeparator none",
41+
f"set namespaceSeparator none\n{extra_puml}",
42+
),
43+
(
44+
'class "" as conda.common.compat.six_with_metaclass.',
45+
'class "six_with_metaclass" as conda.common.compat.six_with_metaclass.',
46+
),
47+
)
48+
49+
50+
def post_process(files, output_path):
51+
"""Replace all items from the replacements list above in the given files."""
52+
for file in files:
53+
with fileinput.input(
54+
files=[os.path.join(output_path, file)], inplace=True
55+
) as open_file:
56+
for line in open_file:
57+
for old, new in replacements:
58+
line = line.replace(old, new)
59+
sys.stdout.write(line)
60+
61+
62+
def generate_pumls(app=None, config=None):
63+
"""
64+
Generates PlantUML files for the given packages and writes
65+
the files to the components directory in the documentation source.
66+
"""
67+
sys.stdout.write("Generating PlantUML...\n")
68+
sys.stdout.flush()
69+
# TODO: make this a configurable thing via the docs config
70+
packages = ["conda"]
71+
72+
for package in packages:
73+
output_path = os.path.join(here, "..", "dev-guide", "umls")
74+
output_format = "puml"
75+
files = [
76+
f"packages_{package}.{output_format}",
77+
f"classes_{package}.{output_format}",
78+
]
79+
ignore_list = ",".join(ignore)
80+
args = [
81+
package,
82+
f"--ignore={ignore_list}",
83+
f"--output={output_format}",
84+
"--colorized",
85+
"--max-color-depth=8",
86+
f"--project={package}",
87+
f"--output-directory={output_path}",
88+
"--all-associated",
89+
"--all-ancestors",
90+
]
91+
# Run pyreverse to create the files first
92+
try:
93+
Run(args)
94+
except SystemExit as err:
95+
# ignore sys.exit() call from pyreverse.Run if the exit code is 0
96+
if err.code:
97+
raise
98+
# Then post-process the generated files to fix some things.
99+
post_process(files, output_path)
100+
sys.stdout.write("Done generating PlantUML files.\n")
101+
102+
103+
def download_plantuml(app, config):
104+
if os.path.exists(config.plantuml_jarfile_path):
105+
sys.stdout.write(
106+
f"PlantUML jar file already downloaded. "
107+
f"To update run `make clean` or manually "
108+
f"delete {config.plantuml_jarfile_path}.\n"
109+
)
110+
else:
111+
parent = os.path.dirname(config.plantuml_jarfile_path)
112+
if not os.path.isdir(parent):
113+
os.makedirs(parent, exist_ok=True)
114+
with requests.get(plantuml_jarfile_url, stream=True) as response:
115+
sys.stdout.write(
116+
f"Downloading PlantUML jar file to {config.plantuml_jarfile_path}..."
117+
)
118+
sys.stdout.flush()
119+
response.raise_for_status()
120+
response.raw.decode_content = True
121+
with open(config.plantuml_jarfile_path, "wb") as jarfile:
122+
shutil.copyfileobj(response.raw, jarfile)
123+
sys.stdout.write("done.\n")
124+
125+
126+
def setup(app):
127+
if "AUTOBUILD" not in os.environ:
128+
app.add_config_value("plantuml_jarfile_path", None, rebuild="")
129+
app.connect("config-inited", download_plantuml)
130+
app.connect("config-inited", generate_pumls)
131+
132+
return {
133+
"version": "0.1",
134+
"parallel_read_safe": False,
135+
"parallel_write_safe": False,
136+
}
137+
138+
139+
if __name__ == "__main__":
140+
generate_pumls()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/** UML **/
2+
.plantuml {
3+
height: 100%;
4+
width: 100%;
5+
}
6+
7+
.plantuml svg text {
8+
/* Make map text un-selectable */
9+
-webkit-touch-callout: none;
10+
-webkit-user-select: none;
11+
-khtml-user-select: none;
12+
-moz-user-select: none;
13+
-ms-user-select: none;
14+
-o-user-select: none;
15+
user-select: none;
16+
pointer-events: none;
17+
}
18+
19+
.plantuml svg text::selection {
20+
background: none;
21+
}
22+
23+
/** JS Panel **/
24+
.jsPanel-ftr span.desc {
25+
display: "flex";
26+
justify-content: "space-between";
27+
}
28+
29+
.jsPanel-ftr span.desc {
30+
flex-grow: 1;
31+
}
32+
33+
.jsPanel-ftr span.buttons {
34+
display: flex;
35+
align-items: center;
36+
}
37+
38+
#conda-documentation .sd-tab-content {
39+
min-height: 9rem;
40+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)