Skip to content

Commit 5160b21

Browse files
committed
dupa
1 parent 540609b commit 5160b21

7 files changed

Lines changed: 161 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ documentation/
1212

1313
# python temporary files
1414
**/__pycache__/
15+
.venv/
1516

1617
# other
1718
*tmp*/

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: doxy clean-doxy clean mkdocs-serve mkdocs-build
2+
3+
doxy:
4+
@echo "==> Building Doxygen documentation..."
5+
doxygen Doxyfile
6+
uv run python scripts/postprocess_doxyhtml.py documentation/ --img-rules docs/style/img_style_rules.json
7+
@echo "==> Doxygen build complete."
8+
9+
clean-doxy:
10+
@echo "==> Cleaning Doxygen build directory..."
11+
rm -rf documentation/
12+
13+
clean: clean-doxy
14+
@echo "==> Cleaning MkDocs build directory..."
15+
rm -rf site/
16+
17+
mkdocs-serve:
18+
@echo "==> Starting MkDocs live server..."
19+
uv run mkdocs serve
20+
21+
mkdocs-build:
22+
@echo "==> Building static MkDocs site..."
23+
uv run mkdocs build

docs/api_details/graph_math.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a massive block of text and math that would have made the C++ header unreadable.

docs/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div align="center" markdown="1">
2+
<img src="img/cpp-gl-hex.png" alt="CPP-GL" width="360" />
3+
</div>
4+
5+
<br />
6+
7+
<div align="center" markdown="1">
8+
9+
[![g++](https://github.com/SpectraL519/cpp-gl/actions/workflows/gpp.yaml/badge.svg)](https://github.com/SpectraL519/cpp-gl/actions/workflows/g++)
10+
[![clang++](https://github.com/SpectraL519/cpp-gl/actions/workflows/clang.yaml/badge.svg)](https://github.com/SpectraL519/cpp-gl/actions/workflows/clang++)
11+
[![format](https://github.com/SpectraL519/cpp-gl/actions/workflows/format.yaml/badge.svg)](https://github.com/SpectraL519/cpp-gl/actions/workflows/format)
12+
[![benchmarks](https://github.com/SpectraL519/cpp-gl/actions/workflows/benchmarks.yaml/badge.svg)](https://github.com/SpectraL519/cpp-gl/actions/workflows/benchmarks.yaml)
13+
14+
</div>
15+
16+
<br />
17+
18+
## Overview
19+
20+
{% include-markdown "../README.md" start="## Overview" %}

docs/scripts/mathjax.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
window.MathJax = {
2+
tex: {
3+
inlineMath: [["\\(", "\\)"], ["$", "$"]],
4+
displayMath: [["\\[", "\\]"], ["$$", "$$"], ["[[", "]]"]],
5+
processEscapes: true,
6+
processEnvironments: true
7+
},
8+
options: {
9+
ignoreHtmlClass: ".*|",
10+
processHtmlClass: "arithmatex"
11+
}
12+
};

include/gl/graph.hpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,50 @@ struct to_impl;
6767

6868
} // namespace detail
6969

70+
/// @brief A general-purpose graph container.
71+
///
72+
/// This class represents a highly customizable graph data structure configured by the provided
73+
/// `GraphTraits`. It serves as the primary interface for managing vertices, edges, and their properties.
74+
///
75+
/// @tparam GraphTraits An instantiation of @ref gl::graph_traits
76+
///
77+
/// ### Mathematics
78+
/// Here is an inline math equation using standard dollars: $V = E - F + 2$,
79+
/// and one using Big-O: $\mathcal{O}(\vert V \vert + \vert E \vert)$.
80+
///
81+
/// And here is a normal (multiline) math block:
82+
///
83+
/// $$
84+
/// \sum_{v \in V} \text{deg}(v) = 2 \vert E \vert
85+
/// $$
86+
///
87+
/// Or alternatively for environments like cases:
88+
///
89+
/// $$
90+
/// A_{i,j} = \begin{cases} 1 & \text{if } (i,j) \in E \\\\ 0 & \text{otherwise} \end{cases}
91+
/// $$
92+
///
93+
/// ### Code Example
94+
/// ```cpp
95+
/// gl::directed_graph<> g;
96+
/// auto v1 = g.add_vertex();
97+
/// auto v2 = g.add_vertex();
98+
/// g.add_edge(v1, v2);
99+
/// for (const auto v : graph.vertices()) {
100+
/// std::cout << v << ": ";
101+
/// for (const auto u : graph.neighbors(v)) {
102+
/// std::cout << u << " ";
103+
/// }
104+
/// }
105+
/// ```
106+
///
107+
/// ### References
108+
/// For a general overview and integration instructions, see the [Project Overview](/#overview)
109+
/// or the [Installation Guide](/#installing-the-library).
110+
///
111+
/// > [!WARNING]
112+
/// > This class relies on its internal implementation tag to correctly define its layout. Modifying
113+
/// > the underlying structure bypassing the API can lead to undefined behavior.
70114
template <traits::c_instantiation_of<graph_traits> GraphTraits>
71115
class graph final {
72116
public:

mkdocs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
site_name: Generic C++ Graph Library
2+
site_description: A modern, generic C++ graph and hypergraph library.
3+
site_author: Your Name
4+
5+
theme:
6+
name: material
7+
features:
8+
- navigation.tabs
9+
- navigation.sections
10+
- navigation.expand
11+
- search.suggest
12+
- content.code.copy
13+
palette:
14+
- media: "(prefers-color-scheme: light)"
15+
scheme: default
16+
primary: indigo
17+
toggle:
18+
icon: material/brightness-7
19+
name: Switch to dark mode
20+
- media: "(prefers-color-scheme: dark)"
21+
scheme: slate
22+
primary: indigo
23+
toggle:
24+
icon: material/brightness-4
25+
name: Switch to light mode
26+
27+
markdown_extensions:
28+
- md_in_html
29+
- admonition
30+
- pymdownx.arithmatex:
31+
generic: true
32+
- pymdownx.superfences:
33+
custom_fences:
34+
- name: math
35+
class: arithmatex
36+
format: !!python/name:pymdownx.arithmatex.fence_mathjax_format
37+
- pymdownx.highlight:
38+
anchor_linenums: true
39+
- pymdownx.superfences
40+
- pymdownx.tabbed:
41+
alternate_style: true
42+
- pymdownx.details
43+
44+
extra_javascript:
45+
- scripts/mathjax.js
46+
- https://polyfill.io/v3/polyfill.min.js?features=es6
47+
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
48+
49+
plugins:
50+
- search
51+
- include-markdown
52+
- callouts
53+
- mkdoxy:
54+
projects:
55+
graphlib:
56+
src-dirs: include/
57+
doxy-cfg:
58+
GENERATE_HTML: NO
59+
GENERATE_XML: YES
60+
RECURSIVE: YES

0 commit comments

Comments
 (0)