Skip to content
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
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- [ ] `mdbook build` runs without errors
- [ ] New pages are listed in `src/SUMMARY.md`
- [ ] Links between pages are relative (`../reference/protocol-api.md`)
- [ ] Headings use sentence case
- [ ] Headings on new pages use sentence case
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For a new page, add the Markdown file to the right section folder under `src/` a
## Style

- Write plain, direct English. Short sentences, active voice, explain terms the first time you use them.
- Use sentence case for headings: "High-level design", not "High-Level Design".
- Use sentence case for headings in new pages: "High-level design", not "High-Level Design". Many older pages use Title Case; leave their headings as they are unless you are rewriting the page, so pull requests stay focused on content.
- Use relative links between pages, such as `[protocol](../reference/protocol-api.md)`, so they work both on GitHub and on the site.
- Put commands, file names and code in backticks, and longer code in fenced blocks with a language (` ```rust `).
- When the code and a page disagree, the code is right: update the page in the same pull request as the code change if you can.
Expand Down
1 change: 1 addition & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ site-url = "/docs/"
git-repository-url = "https://github.com/PsyDianOS/docs"
edit-url-template = "https://github.com/PsyDianOS/docs/edit/main/{path}"
additional-css = ["theme/psydian.css"]
additional-js = ["theme/mermaid-init.js"]
no-section-label = false

[output.html.fold]
Expand Down
2 changes: 2 additions & 0 deletions src/project/readme-specification.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# README Specification

> **Note:** this page is the original specification for the code repository's README. Two things have changed since: there is no `Docs/` folder in the code repository any more, and the README's Documentation section links to this book at [psydianos.github.io/docs](https://psydianos.github.io/docs/) instead of to `Docs/...` files. The examples below are kept as they were written.

## 1. Purpose

The root `README.md` is the primary entry point for the PsyDian repository.
Expand Down
9 changes: 9 additions & 0 deletions src/project/repository-structure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# GitHub Repository Structure

> **Note:** this page is the original repository plan, written before the code existed. The documentation has since moved out of the code repository into its own repository, so the `Docs/` folder shown below no longer exists. The organisation is now laid out like this:
>
> | Repository | Contents |
> |---|---|
> | [PsyDianOS/PsyDian_OS](https://github.com/PsyDianOS/PsyDian_OS) | `kernel/`, `ai-bridge/`, `scripts/`, `website/`, `src/` (host launcher), `.github/`, README, CONTRIBUTING, SECURITY, licences |
> | [PsyDianOS/docs](https://github.com/PsyDianOS/docs) | This book: `src/` with `product/`, `architecture/`, `reference/`, `engineering/` and `project/`, plus `book.toml` and `theme/` |
>
> For the current layout of the code itself, see the "Repository layout" section of the [PsyDian_OS README](https://github.com/PsyDianOS/PsyDian_OS#repository-layout).

## 1. Purpose

The PsyDian repository should keep source code, documentation, tests, build configuration, scripts, and project artifacts organized so that both team members can understand and reproduce the project.
Expand Down
24 changes: 24 additions & 0 deletions theme/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Renders ```mermaid code blocks as diagrams, the way GitHub does.
// Mermaid is loaded only on pages that contain a diagram, and follows the
// light or dark mdBook theme.
(function () {
const blocks = document.querySelectorAll("code.language-mermaid");
if (!blocks.length) return;

const script = document.createElement("script");
script.src = "https://cdn.jsdelivr.net/npm/mermaid@11.4.1/dist/mermaid.min.js";
script.onload = function () {
blocks.forEach(function (code) {
const diagram = document.createElement("pre");
diagram.className = "mermaid";
diagram.textContent = code.textContent;
code.parentElement.replaceWith(diagram);
});
const dark = ["coal", "navy", "ayu"].some(function (theme) {
return document.documentElement.classList.contains(theme);
});
mermaid.initialize({ startOnLoad: false, theme: dark ? "dark" : "default" });
mermaid.run();
};
document.head.appendChild(script);
})();
6 changes: 6 additions & 0 deletions theme/psydian.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
display: table;
width: 100%;
}

/* Mermaid diagrams: centred, no code-block background. */
pre.mermaid {
background: none;
text-align: center;
}
Loading