build: initial skeleton
Add initial build system integration.
This commit is contained in:
commit
be565d948b
37 changed files with 3870 additions and 0 deletions
4
doc/.gitignore
vendored
Normal file
4
doc/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
/book
|
38
doc/CMakeLists.txt
Normal file
38
doc/CMakeLists.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
# SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
# SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
cmake_minimum_required(VERSION 3.30)
|
||||
|
||||
include(cmake/helpers)
|
||||
|
||||
project(linux-parental-controls-doc
|
||||
LANGUAGES NONE)
|
||||
|
||||
ensure_rust_utils(
|
||||
mdbook
|
||||
mdbook-mermaid)
|
||||
|
||||
# ------------------------
|
||||
|
||||
set(doc_sources
|
||||
src/SUMMARY.md
|
||||
|
||||
src/architectural-overview.md
|
||||
src/design-tenets.md
|
||||
src/why.md
|
||||
|
||||
src/components/nss.md)
|
||||
|
||||
# ------------------------
|
||||
|
||||
add_custom_target(doc ALL
|
||||
COMMAND ${mdbook} build --dest-dir ${CMAKE_CURRENT_BINARY_DIR}/out ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${mdbook} ${mdbook-mermaid} ${doc_sources}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(doc-watch
|
||||
COMMAND ${mdbook} serve --open --dest-dir ${CMAKE_CURRENT_BINARY_DIR}/out ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${mdbook} ${doc_sources}
|
||||
VERBATIM
|
||||
)
|
20
doc/book.toml
Normal file
20
doc/book.toml
Normal file
|
@ -0,0 +1,20 @@
|
|||
# SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
[book]
|
||||
authors = ["Matteo Settenvini"]
|
||||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
title = "Linux Parental Controls"
|
||||
|
||||
[rust]
|
||||
edition = "2024"
|
||||
|
||||
[build]
|
||||
build-dir = "build"
|
||||
|
||||
[preprocessor.mermaid]
|
||||
|
||||
[output.html]
|
||||
additional-js = ["mermaid.min.js", "mermaid-init.js"]
|
35
doc/mermaid-init.js
Normal file
35
doc/mermaid-init.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
(() => {
|
||||
const darkThemes = ['ayu', 'navy', 'coal'];
|
||||
const lightThemes = ['light', 'rust'];
|
||||
|
||||
const classList = document.getElementsByTagName('html')[0].classList;
|
||||
|
||||
let lastThemeWasLight = true;
|
||||
for (const cssClass of classList) {
|
||||
if (darkThemes.includes(cssClass)) {
|
||||
lastThemeWasLight = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const theme = lastThemeWasLight ? 'default' : 'dark';
|
||||
mermaid.initialize({ startOnLoad: true, theme });
|
||||
|
||||
// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page
|
||||
|
||||
for (const darkTheme of darkThemes) {
|
||||
document.getElementById(darkTheme).addEventListener('click', () => {
|
||||
if (lastThemeWasLight) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (const lightTheme of lightThemes) {
|
||||
document.getElementById(lightTheme).addEventListener('click', () => {
|
||||
if (!lastThemeWasLight) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
2
doc/mermaid-init.js.license
Normal file
2
doc/mermaid-init.js.license
Normal file
|
@ -0,0 +1,2 @@
|
|||
SPDX-FileCopyrightText: Knut Sveidqvist
|
||||
SPDX-License-Identifier: MIT
|
2186
doc/mermaid.min.js
vendored
Normal file
2186
doc/mermaid.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
doc/mermaid.min.js.license
Normal file
2
doc/mermaid.min.js.license
Normal file
|
@ -0,0 +1,2 @@
|
|||
SPDX-FileCopyrightText: Knut Sveidqvist
|
||||
SPDX-License-Identifier: MIT
|
15
doc/src/SUMMARY.md
Normal file
15
doc/src/SUMMARY.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
-->
|
||||
|
||||
# Summary
|
||||
|
||||
[Why Linux Parental Controls?](./why.md)
|
||||
|
||||
- [Design tenets](./design-tenets.md)
|
||||
- [Architectural Overview](./architectural-overview.md)
|
||||
|
||||
# Components
|
||||
|
||||
- [NSS module](./components/nss.md)
|
6
doc/src/architectural-overview.md
Normal file
6
doc/src/architectural-overview.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
-->
|
||||
|
||||
# Architectural Overview
|
6
doc/src/components/nss.md
Normal file
6
doc/src/components/nss.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
-->
|
||||
|
||||
# NSS Module
|
6
doc/src/design-tenets.md
Normal file
6
doc/src/design-tenets.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
-->
|
||||
|
||||
# Design Tenets
|
16
doc/src/why.md
Normal file
16
doc/src/why.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||
-->
|
||||
|
||||
# Why Linux Parental Controls?
|
||||
|
||||
Example:
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A-->B;
|
||||
A-->C;
|
||||
B-->D;
|
||||
C-->D;
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue