Skip to content

Commit f766f22

Browse files
authored
Merge pull request #2 from lias-laboratory/enhance-docs
Enhanced Documentation
2 parents 8c49b92 + 9f3937c commit f766f22

File tree

6 files changed

+149
-11
lines changed

6 files changed

+149
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
2-
<a href="https://github.com/lias-laboratory/radius_clustering/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/github/license/lias-laboratory/radius-clustering"></a>
2+
<a href="https://github.com/lias-laboratory/radius_clustering/blob/main/LICENSE"><img alt="License: GPLv3" src="https://img.shields.io/github/license/lias-laboratory/radius_clustering"></a>
33
<a href="https://pypi.org/project/radius-clustering/"><img alt="PyPI" src="https://img.shields.io/pypi/v/radius-clustering"></a>
44
<a href="https://docs.astral.sh/ruff/"><img alt="Code style: Ruff" src="https://img.shields.io/badge/style-ruff-41B5BE?style=flat"></a>
5-
<a><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/lias-laboratory/radius-clustering/sphinx.yml?label=Doc%20Building"></a>
5+
<a href="https://lias-laboratory.github.io/radius_clustering/"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/lias-laboratory/radius_clustering/sphinx.yml?label=Doc%20Building"></a>
66
<a><img alt="Python version supported" src="https://img.shields.io/pypi/pyversions/radius-clustering"></a>
77

88
</p>

docs/source/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
import os
1010
import sys
11+
from pathlib import Path
1112

13+
sys.path.insert(0, os.path.abspath("."))
1214
sys.path.insert(0, os.path.abspath("../.."))
1315

1416
project = "Radius Clustering"
@@ -25,6 +27,7 @@
2527
"sphinx.ext.viewcode",
2628
"sphinx-prompt",
2729
"sphinx.ext.napoleon",
30+
"sphinxcontrib.sass",
2831
"sphinx_remove_toctrees",
2932
"sphinxcontrib.email",
3033
"sphinx_gallery.gen_gallery",
@@ -82,6 +85,17 @@
8285
"footer_end": [],
8386
}
8487

88+
# Compile scss files into css files using sphinxcontrib-sass
89+
sass_src_dir, sass_out_dir = "scss", "_static/styles"
90+
sass_targets = {
91+
f"{file.stem}.scss": f"{file.stem}.css"
92+
for file in Path(sass_src_dir).glob("*.scss")
93+
}
94+
95+
html_static_path = ["_static"]
96+
# Additional CSS files, should be subset of the values of `sass_targets`
97+
html_css_files = ["styles/custom.css"]
98+
8599
sg_examples_dir = "../../examples"
86100
sg_gallery_dir = "auto_examples"
87101
sphinx_gallery_conf = {

docs/source/details.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,4 @@ Key insights:
118118

119119
.. note:: Since the publication of the paper, the Radius Clustering package has been improved and optimized. The results presented here are based on the initial version of the package. For the latest results, please refer to the documentation or the source code.
120120

121-
References
122-
==========
123121

docs/source/installation.rst

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ There are different ways to install Radius Clustering:
1010

1111
* :ref:`From the source <installation-source>`. This is best for users who want the latest features and are comfortable building from source. This is also needed if you want to contribute to the project.
1212

13+
.. warning::
14+
15+
Radius Clustering is currently not available on PyPI, pending the organization acceptance on PyPI. You can install the package from the source by following the :ref:`instructions <installation-source>`.
16+
Please notice that the compilation stage require a C and C++ compiler toolchain to be installed on your system.
17+
18+
1319
.. _installation-pypi:
1420

1521
Installing from PyPI
@@ -27,20 +33,18 @@ Installing from PyPI
2733
.install-instructions .sd-tab-set.tabs-os::before {
2834
content: "Operating System";
2935
}
30-
31-
.install-instructions .sd-tab-set.tabs-package-manager::before {
32-
content: "Package Manager";
33-
}
3436
}
3537
</style>
3638

3739
.. div:: install-instructions
3840

3941
.. tab-set::
4042
:class: tabs-os
43+
:sync-group: os
4144

4245
.. tab-item:: Windows
4346
:class-label: tab-4
47+
:sync: windows
4448

4549
Install the 64-bit version of Python 3, for instance from the
4650
`official website <https://www.python.org/downloads/windows/>`__.
@@ -65,7 +69,7 @@ Installing from PyPI
6569

6670
.. tab-item:: MacOS
6771
:class-label: tab-4
68-
72+
:sync: macos
6973

7074
Install Python 3 using `homebrew <https://brew.sh/>`_ (`brew install python`)
7175
or by manually installing the package from the `official website
@@ -91,6 +95,7 @@ Installing from PyPI
9195

9296
.. tab-item:: Linux
9397
:class-label: tab-4
98+
:sync: linux
9499

95100
Python 3 is usually installed by default on most Linux distributions. To
96101
check if you have it installed, try:
@@ -143,12 +148,84 @@ a Raspberry Pi).
143148
Installing from the source
144149
--------------------------
145150

146-
To install Radius Clustering from the source, you need to clone the repository and
151+
Compiler Requirements
152+
~~~~~~~~~~~~~~~~~~~~~
153+
154+
To install Radius Clustering from the source, you need to have a C and C++ compiler and their respective toolchains installed on your system, depending on your operating system.
155+
156+
.. raw:: html
157+
158+
<style>
159+
/* Show caption on large screens */
160+
@media screen and (min-width: 960px) {
161+
.install-instructions .sd-tab-set {
162+
--tab-caption-width: 20%;
163+
}
164+
165+
.install-instructions .sd-tab-set.tabs-os::before {
166+
content: "Operating System";
167+
}
168+
}
169+
</style>
170+
171+
.. div:: install-instructions
172+
173+
.. tab-set::
174+
:class: tabs-os
175+
:sync-group: os
176+
177+
.. tab-item:: Windows
178+
:class-label: tab-4
179+
:sync: windows
180+
181+
Install the correct version of Microsoft Visual C++ Build Tools for your Python version from the `official website <https://visualstudio.microsoft.com/visual-cpp-build-tools/>`__.
182+
183+
In Build Tools, install C++ toolchain. Ensure that it is added to the system PATH.
184+
You are now ready to install Radius Clustering from source.
185+
186+
.. tab-item:: MacOS
187+
:class-label: tab-4
188+
:sync: macos
189+
190+
Normally, you should have the necessary tools installed on your system as it comes with Xcode Command Line Tools, which is included when you first install Homebrew or Xcode.
191+
To check if you have the necessary tools installed, try:
192+
193+
.. prompt:: bash
194+
195+
gcc --version
196+
g++ --version
197+
198+
If you don't have the necessary tools installed, you can install them directly from the App Store by getting Xcode. You may also be interested in installing Homebrew. See this `tutorial <https://www.moncefbelyamani.com/how-to-install-xcode-with-homebrew/>`__ for more information.
199+
200+
.. tab-item:: Linux
201+
:class-label: tab-4
202+
:sync: linux
203+
204+
Normally, you should have the necessary tools installed on your system. To check if you have the necessary tools installed, try:
205+
206+
.. prompt:: bash
207+
208+
gcc --version
209+
g++ --version
210+
211+
If you don't have the necessary tools installed, you can install them using your distribution's package manager. For instance, on Ubuntu, you can install them by running:
212+
213+
.. prompt:: bash
214+
215+
sudo apt-get update
216+
sudo apt-get install build-essential
217+
218+
219+
Installing Radius Clustering
220+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221+
222+
Now you have installed compilers toolchains requirements, you can build and install `radius-clustering` from the sources. You need to clone the repository and
147223
install the package using the following commands:
148224

149225
.. prompt:: bash
150226

151-
cd /path/to/your/folder
227+
git clone [email protected]:lias-laboratory/radius_clustering.git # clone the repository
228+
cd radius_clustering
152229
python -m venv rad-env
153230
source rad-env/bin/activate # activate
154231
python -m pip install .

docs/source/scss/custom.scss

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Tabs (sphinx-design) */
2+
3+
.sd-tab-set {
4+
--tab-caption-width: 0%; // No tab caption by default
5+
margin-top: 1.5rem;
6+
7+
&::before {
8+
// Set `content` for tab caption
9+
width: var(--tab-caption-width);
10+
display: flex;
11+
align-items: center;
12+
font-weight: bold;
13+
}
14+
15+
.sd-tab-content {
16+
padding: 0.5rem 0 0 0 !important;
17+
background-color: transparent !important;
18+
border: none !important;
19+
20+
blockquote {
21+
background-color: transparent !important;
22+
border: none !important;
23+
}
24+
25+
> p:first-child {
26+
margin-top: 1rem !important;
27+
}
28+
}
29+
30+
> label.sd-tab-label {
31+
margin: 0 3px;
32+
display: flex;
33+
align-items: center;
34+
justify-content: center;
35+
border-radius: 5px !important;
36+
37+
38+
&.tab-4 {
39+
width: calc((100% - var(--tab-caption-width)) / 3 - 6px) !important;
40+
}
41+
}
42+
43+
> input:checked + label.sd-tab-label {
44+
transform: unset;
45+
border: 2px solid var(--pst-color-primary);
46+
}
47+
}

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dev = [
6161
"sphinx-remove-toctrees>=1.0.0",
6262
"sphinx-prompt>=1.9.0",
6363
"sphinx_design>=0.6.1",
64+
"sphinxcontrib.sass >= 0.3.4",
6465
]
6566

6667
doc = [
@@ -72,6 +73,7 @@ doc = [
7273
"sphinx-remove-toctrees>=1.0.0",
7374
"sphinx-prompt>=1.9.0",
7475
"sphinx_design>=0.6.1",
76+
"sphinxcontrib.sass >= 0.3.4",
7577
]
7678

7779
[tool.setuptools]

0 commit comments

Comments
 (0)