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

Add mermaid class diagrams #33

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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: 2 additions & 0 deletions .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
with:
node-version: 20
cache: 'pnpm'
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Install dependencies
run: pnpm install
- name: Build
Expand Down
11 changes: 10 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {defineConfig} from 'astro/config';
import tailwind from '@astrojs/tailwind';
import pagefind from "astro-pagefind";
import mdx from '@astrojs/mdx';
import rehypeMermaid from "rehype-mermaid";
import {rehypeShiki} from "@astrojs/markdown-remark";

// https://astro.build/config
export default defineConfig({
Expand All @@ -16,5 +18,12 @@ export default defineConfig({
],
redirects: {
'/schema/[...slug].md': '/schema/[...slug]',
}
},
markdown: {
rehypePlugins: [
rehypeMermaid,
rehypeShiki,
],
syntaxHighlight: false,
},
});
1,333 changes: 1,300 additions & 33 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/markdown-remark": "^5.2.0",
"@astrojs/mdx": "^3.0.1",
"@astrojs/tailwind": "^5.1.0",
"@iconify-json/radix-icons": "^1.1.14",
Expand All @@ -19,6 +20,8 @@
"astro": "^4.9.2",
"astro-pagefind": "^1.5.0",
"pagefind": "^1.1.0",
"playwright": "^1.50.1",
"rehype-mermaid": "^3.0.0",
"sharp": "^0.33.4",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
linkml==1.8.6
linkml==1.8.7
2 changes: 1 addition & 1 deletion schema/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lint:
linkml-lint --validate src/ -a

gen-doc:
gen-doc src/schemas.yaml --directory generated --diagram-type er_diagram -v
gen-doc src/schemas.yaml --directory generated --diagram-type mermaid_class_diagram -v

gen-jsonld:
linkml-convert --input-format yaml --output-format json-ld --schema src/TerrasosProjectInfo.yaml data/TerrasosProjectInfoData.yaml --output data/TerrasosProjectInfoData.jsonld --target-class TerrasosProjectInfo
Expand Down
5 changes: 5 additions & 0 deletions src/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,9 @@
--purple-200: 128 142 171;
--purple-100: 86 104 143;
}

/* Center mermaid SVG diagrams. */
main svg {
margin: auto;
}
}
2 changes: 1 addition & 1 deletion src/components/topbar/Topbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Image} from 'astro:assets';
import logo from "../../assets/regen.png";
import Search from "astro-pagefind/components/Search";
---
<header class="flex flex-row py-2 px-3 bg-brand-300 justify-between items-center sticky w-screen"
<header class="flex flex-row py-2 px-3 h-16 bg-brand-300 justify-between items-center sticky w-full"
data-pagefind-ignore="all">
<div class="flex flex-row gap-4 items-center">
<Image src={logo} alt="Regen Network" width="20" height="20"/>
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ title = frontmatter ? frontmatter.title : title;
</head>
<body>
<Topbar/>
<div class="flex h-screen">
<div class="flex h-[calc(100vh-64px)]">
<Sidebar/>
<div id="main" class="px-16 py-8 prose overflow-y-auto">
<div id="main" class="grow px-16 py-8 prose max-w-none overflow-y-auto">
<p class="bg-warning-200 italic p-2 rounded-md">WARNING: This site is a work in progress.<p>
<main data-pagefind-body>
<main data-pagefind-body class="mx-auto lg:max-w-screen-lg">
<slot/>
</main>
</div>
Expand Down