Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update user guide & Pages deploy #217

Merged
merged 9 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
# Need to refine this by specifying components required for doc
# Deps
- uses: dtolnay/rust-toolchain@nightly
- uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "0.4.36"
# Generate user guide first because it removes all existing files
# from the target directory
- name: Generate User Guide
run: mdbook build -d ../target/doc/ user-guide/
- name: Generate Rust Docs
run: cargo +nightly doc --all --no-deps --all-features

# Generate / using sudo before I'm forced to retry this 83491 times due to CI constraints
- name: Generate documentation
run: |
sudo chmod +x docs/build.sh
sudo ./docs/build.sh
# Deploy
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
force_orphan: true
force_orphan: true
11 changes: 11 additions & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generate docs

cargo +nightly doc --all --no-deps --all-features
mdbook build user-guide/

# Add stuff to the deployed folder

mv user-guide/book target/doc/user-guide
cp docs/index.html target/doc
cp docs/index.css target/doc
cp docs/theme.js target/doc
124 changes: 124 additions & 0 deletions docs/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
:root {
/* Light mode colors */
--background-color: #f5f5f5;
--body-background: white;
--text-color: #34495e;
--heading-color: #2c3e50;
--link-color: #3498db;
--border-color: #eee;
--box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode colors */
.dark-mode {
--background-color: #1a1a1a;
--body-background: #121212;
--text-color: #c0c0c0;
--heading-color: #e0e0e0;
--link-color: #4da6ff;
--border-color: #333;
--box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

html {
background-color: var(--background-color);
height: 100%;
transition: background-color 0.3s;
}

body {
max-width: 65ch;
margin: 1rem auto;
padding: 1.5rem;
line-height: 1.6;
background-color: var(--body-background);
height: auto;
box-shadow: var(--box-shadow);
border-radius: 8px;
color: var(--text-color);
transition: background-color 0.3s, color 0.3s;
position: relative; /* Added to help with positioning */
}

h1, h2, h3 {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
color: var(--heading-color);
margin-bottom: 1rem;
transition: color 0.3s;
}

h1 {
font-size: 2rem;
border-bottom: 2px solid var(--border-color);
margin-top: 0.1rem;
padding-bottom: 0.5rem;
transition: border-color 0.3s;
position: relative; /* Added to help with positioning */
}

h2 {
font-size: 1.5rem;
margin-top: 1rem;
}

p, li {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
color: var(--text-color);
margin-bottom: 1rem;
transition: color 0.3s;
}

a:link, a:visited {
color: var(--link-color);
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color 0.2s ease, color 0.3s;
}

a:hover {
border-bottom-color: var(--link-color);
}

/* Theme toggle styles */
.theme-switch {
position: absolute;
top: 0.5rem;
right: 0.5rem;
display: flex;
align-items: center;
}

.theme-switch input {
display: none;
}

.theme-switch-label {
cursor: pointer;
display: inline-block;
width: 50px;
height: 24px;
background-color: var(--border-color);
border-radius: 12px;
position: relative;
transition: background-color 0.3s;
}

.theme-switch-label::after {
content: '';
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: var(--text-color);
top: 2px;
left: 2px;
transition: transform 0.3s;
}

.theme-switch input:checked + .theme-switch-label {
background-color: var(--link-color);
}

.theme-switch input:checked + .theme-switch-label::after {
transform: translateX(26px);
}
34 changes: 34 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Honeycomb</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="theme-switch">
<input type="checkbox" id="theme-toggle">
<label for="theme-toggle" class="theme-switch-label"></label>
</div>

<h1>Honeycomb 🐝</h1>

<h2>Scope of the project</h2>

<p>Honeycomb aims to provide a safe, efficient and scalable implementation
of combinatorial maps for meshing applications. More specifically, the
goal is to converge towards a (or multiple) structure(s) adapted to
algorithms exploiting GPUs and many-core architectures.</p>

<h2>Links</h2>

<ul>
<li><a href="https://github.com/LIHPC-Computational-Geometry/honeycomb">repository</a></li>
<li><a href="https://crates.io/crates/integraal">crates dot io</a></li>
<li><a href="honeycomb">master branch documentation</a></li>
<li><a href="user-guide">user guide</a></li>
</ul>
<script src="theme.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions docs/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
document.getElementById('theme-toggle').addEventListener('change', function() {
document.documentElement.classList.toggle('dark-mode', this.checked);
// Optional: Persist theme preference in localStorage
localStorage.setItem('theme', this.checked ? 'dark' : 'light');
});

// Check for saved theme preference or system preference on page load
document.addEventListener('DOMContentLoaded', () => {
const savedTheme = localStorage.getItem('theme');
const themeToggle = document.getElementById('theme-toggle');

if (savedTheme === 'dark') {
document.documentElement.classList.add('dark-mode');
themeToggle.checked = true;
}
});
5 changes: 3 additions & 2 deletions user-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
- [Other content](./project-structure/others.md)
- [Benchmarks](./project-structure/honeycomb-benches.md)
- [Examples](./project-structure/honeycomb-examples.md)
- [User guide](./project-structure/honeycomb-guide.md)

# Kernels

- [DVR](./kernels/dvr.md)
- [Grisubal](./kernels/grisubal.md)
- [Polygon triangulation](./kernels/triangulations.md)
- [Splits](./kernels/splits.md)

# Definitions

Expand All @@ -27,5 +29,4 @@
- [Add / Remove a dimension](./definitions/changeNdim.md)
- [Add / Remove a free dart](./definitions/changeNdart.md)
- [Sewing / Unsewing operation](./definitions/sew.md)
- [Advanced Operations](./definitions/advancedops.md)

1 change: 0 additions & 1 deletion user-guide/src/definitions/advancedops.md

This file was deleted.

7 changes: 3 additions & 4 deletions user-guide/src/definitions/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ dedicated sections.

## Implementation

Because embedding is defined per-application or per-needs, our combinatorial map
implementation uses a generic system to handle this; The storage follows our
own specific logic, which is detailed in [this](../honeycomb_core/struct.CMap2.html#note-on-cell-identifiers)
documentation entry.
Because embedding is defined per-application or per-needs, our combinatorial map implementation uses
a generic system to handle this; The storage follows our own specific logic, which is detailed in
[this](../../honeycomb_core/cmap/struct.CMap2.html#note-on-cell-identifiers) documentation entry.

## Examples

Expand Down
8 changes: 4 additions & 4 deletions user-guide/src/definitions/sew.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Exact properties of the link operation directly depends on the property of the m

The *i-sew* operation corresponds to an *i-link* operation, coupled with an update of the affected attributes. *How*
the attributes are updated is defined through trait implementation in the Rust crate (see
[AttributeUpdate](../honeycomb_core/trait.AttributeUpdate.html),
[AttributeBind](../honeycomb_core/trait.AttributeBind.html)). *Which* attributes are updated can be deduced from the
dimension *i* of the sewing operation. This is summarized in the following table:
[AttributeUpdate](../../honeycomb_core/attributes/trait.AttributeUpdate.html),
[AttributeBind](../../honeycomb_core/attributes/trait.AttributeBind.html)). *Which* attributes are updated can be
deduced from the dimension *i* of the sewing operation. This is summarized in the following table:

| Dimension | Geometrical operation | 0-cell / Vertex Attributes | 1-cell / Edge Attributes | 2-cell / Face Attributes | 3-cell / Volume Attributes |
|-----------|-----------------------|----------------------------|--------------------------|--------------------------|----------------------------|
Expand All @@ -49,4 +49,4 @@ dimension *i* of the sewing operation. This is summarized in the following table

The unsew operation is the complementary to the sew operation. It behaves according to similar properties, but is used
to remove links between darts. It does so by replacing values of the beta functions by the null dart. Geometrical
updates are handled and defined in the same way as for the sew operation.
updates are handled and defined in the same way as for the sew operation.
36 changes: 17 additions & 19 deletions user-guide/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ The current objective is to
- ~improve the structure without having to deal with data races and similar issues, thanks to the Rust's guarantees~
- ~implement basic meshing algorithms to evaluate the viability of the implementation & improve our structure using
Rust's framework to streamline the refactoring and parallelization process~
- ~Benchmark and/or profile and/or parallelize our first algorithm, **grisubal**~
- Ship a first stable version of the library (see this [issue](https://github.com/LIHPC-Computational-Geometry/honeycomb/issues/150))
- Benchmark and/or profile and/or parallelize our first algorithm, **grisubal**
- Work on efficient parallelism

### Core Requirements

Expand Down Expand Up @@ -53,28 +54,16 @@ version, and use the GitHub Pages documentation instead of the one hosted on doc

## Documentation

Published crates:

- [honeycomb](honeycomb/) *Main crate*
- [honeycomb-core](honeycomb_core/) *Core definitions and tools*
- [honeycomb-kernels](honeycomb_kernels/) *Meshing kernel implementations*
- [honeycomb-render](honeycomb_render/) *Visualization tool*

Others:

- [honeycomb-benches](honeycomb_benches/) *Rust code benchmarks*
- [honeycomb-examples](honeycomb_examples/) *Rust code examples*

You can also generate this documentation locally using **mdbook** and **cargo doc**:
You can generate this book and the Rust documentation locally using respectively **mdbook** and **cargo doc**:

```shell
# Serve the doc on a local server
mdbook serve --open -d ../target/doc/ user-guide/ &
mdbook serve --open user-guide/
```
```shell
cargo +nightly doc --all --all-features --no-deps
```

Note that generating the doc using a stable toolchain is possible,
the features just won't be documented as clearly.
Note that generating the doc using a stable toolchain is possible, the features just won't be documented as clearly.

## Contributing

Expand Down Expand Up @@ -109,7 +98,7 @@ defined in the Apache-2.0 license, shall be dual licensed as above, without any

### Combinatorial Maps

- Damiand, Guillaume, and Pascal Lienhardt. *Combinatorial Maps: Efficient Data Structures for Computer Graphics and
- Damiand and Lienhardt. *Combinatorial Maps: Efficient Data Structures for Computer Graphics and
Image Processing*. Chapman&Hall/CRC, 2015.
- Provides an in-depth presentation of the structure and its variants
- [Link](https://hal.science/hal-01090890v1)
Expand All @@ -118,6 +107,15 @@ defined in the Apache-2.0 license, shall be dual licensed as above, without any
implementation uses a different approach than ours, & support N-dimensionnal map.
- [Link](https://doc.cgal.org/latest/Combinatorial_map/)

### Algorithms

- Staten, Noble, and Wilson. *Constructing Tetrahedral Meshes No Matter How Ugly*. SIAM, 2024
- Describes the logic behind an overlay grid algorithm.
- [Link](https://internationalmeshingroundtable.com/assets/research-notes/imr32/2011.pdf)
- Rangarajan and Lew. *Provably Robust Directional Vertex Relaxation for geometric mesh optimization*. SIAM, 2017
- usage TBD
- [Link](https://epubs.siam.org/doi/abs/10.1137/16M1089101)

### Integration

- The repository structure and workspace system is heavily inspired by
Expand Down
5 changes: 5 additions & 0 deletions user-guide/src/kernels/dvr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Directional Vertices Relaxation

---

WIP: https://github.com/LIHPC-Computational-Geometry/honeycomb/pull/212
Loading