Skip to content

Commit

Permalink
Generated Docs (#255)
Browse files Browse the repository at this point in the history
* Add generated docs with typedoc and tidy docs pages

* Get docs building

* Fix docs build mkdir
  • Loading branch information
taybenlor authored Aug 21, 2023
1 parent 9b9dc1f commit 44962a8
Show file tree
Hide file tree
Showing 13 changed files with 1,983 additions and 7,424 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Generated Docs
packages/*/docs
8,746 changes: 1,753 additions & 6,993 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
"bootstrap": "npm install",
"dev": "npm run dev --workspace=@runno/website",
"publish": "npm run build && npx lerna publish",
"build:docs:wasi": "npm run build:docs --workspace=@runno/wasi && rm -rf packages/website/docs/wasi && mkdir -p packages/website/docs && cp -R packages/wasi/docs packages/website/docs/wasi",
"build:docs:runtime": "npm run build:docs --workspace=@runno/runtime && rm -rf packages/website/docs/runtime && mkdir -p packages/website/docs && cp -R packages/runtime/docs packages/website/docs/runtime",
"build:docs": "npm run build:docs:runtime && npm run build:docs:wasi",
"build:host": "cd packages/host && npm run build",
"build:client": "cd packages/client && npm run build",
"build:wasi": "cd packages/wasi && npm run build",
"build:runtime": "cd packages/runtime && npm run build",
"build:website": "cd packages/website && npm run build",
"build": "npm run build:host && npm run build:wasi && npm run build:runtime && npm run build:client && npm run build:website",
"build": "npm run build:host && npm run build:wasi && npm run build:runtime && npm run build:client && npm run build:docs && npm run build:website",
"build:deploy": "npm run bootstrap && npm run build",
"test:client": "cd packages/client && npm run test",
"test:wasi": "cd packages/wasi && npm run test:prepare && npm run test",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/url-safe-base64": "^1.1.0",
"eslint": "^8.2.0",
"typescript": "^5.1.6",
"vite": "^4.4.6"
"vite": "^4.4.9"
},
"dependencies": {
"@runno/host": "^0.5.1",
Expand Down
31 changes: 30 additions & 1 deletion packages/runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
👨‍💻 **Use Runno** 👉 [Runno.dev](https://runno.dev/)

📖 **Documentation** 👉 [Runno.dev](https://runno.dev/#web-components)
📖 **Documentation** 👉 [Runno.dev](https://runno.dev/docs)

# Runno Runtime

Expand Down Expand Up @@ -57,3 +57,32 @@ const result = await headlessRunCode("python", "print('Hello World!')");

If you want to provide more than a single code snippet, you can use
`headlessRunFS` to provide each of the files, and the entrypoint file.

## Styling

The <code>runno-run</code> element can be styled with css
variables to change the height of the individual
<code>runno-editor</code> and <code>runno-terminal</code> elements
inside.

```css
runno-run {
/* Sets a specific height for the editor */
--runno-editor-height: auto;

/* Sets a maximum height for the editor */
--runno-editor-max-height: 60%;

/* Sets a specific height for the terminal */
--runno-terminal-height: auto;

/* Sets a minimum height for the terminal */
--runno-terminal-min-height: 4rem;
}
```

By default the editor will resize to fit the content you put
inside it, and the terminal will be its minimum height. If you set
the element to be a fixed height, they will share the space so
that the editor gets 60% and the controls and terminal get the
rest.
6 changes: 4 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"scripts": {
"dev": "vite",
"watch": "vite build --watch",
"build": "tsc && vite build",
"build:docs": "typedoc --options typedoc.config.cjs",
"build:package": "tsc && vite build",
"build": "npm run build:docs && npm run build:package",
"serve": "vite preview",
"lint": "npx eslint src"
},
Expand All @@ -39,7 +41,7 @@
"eslint": "^7.28.0",
"typedoc": "^0.24.8",
"typescript": "^5.1.6",
"vite": "^4.4.6"
"vite": "^4.4.9"
},
"dependencies": {
"@codemirror/basic-setup": "^0.19.0",
Expand Down
17 changes: 17 additions & 0 deletions packages/runtime/typedoc.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type {import('typedoc').TypeDocOptions} */
module.exports = {
entryPoints: ["./src/main.ts"],
out: "docs",
// titleLink: "/",
sidebarLinks: {
Docs: "/docs",
"@runno/wasi": "/docs/wasi/",
},
navigationLinks: {
Runno: "/",
WASI: "/wasi",
Articles: "/articles",
Docs: "/docs",
GitHub: "https://github.com/taybenlor/runno",
},
};
6 changes: 4 additions & 2 deletions packages/wasi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
},
"scripts": {
"dev": "vite --port 5173",
"build:docs": "typedoc --options typedoc.config.cjs",
"build:tests": "cd programs && cargo wasi build -r && cd .. && cp programs/target/wasm32-wasi/release/*.wasi.wasm public/bin/tests/",
"build:types": "tsc",
"build:vite": "vite build",
"build": "npm run build:vite && npm run build:types",
"build": "npm run build:docs && npm run build:vite && npm run build:types",
"test:server": "vite --port 5173",
"test:cargo": "cargo install cargo-wasi || echo Please install cargo to run the tests",
"test:mkdir": "mkdir -p public/bin/languages public/bin/tests",
Expand All @@ -42,6 +43,7 @@
"devDependencies": {
"@playwright/test": "^1.26.1",
"typescript": "^5.1.6",
"vite": "^4.4.6"
"typedoc": "^0.24.8",
"vite": "^4.4.9"
}
}
17 changes: 17 additions & 0 deletions packages/wasi/typedoc.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type {import('typedoc').TypeDocOptions} */
module.exports = {
entryPoints: ["./lib/main.ts"],
out: "docs",
// titleLink: "/",
sidebarLinks: {
Docs: "/docs",
"@runno/runtime": "/docs/runtime/",
},
navigationLinks: {
Runno: "/",
WASI: "/wasi",
Articles: "/articles",
Docs: "/docs",
GitHub: "https://github.com/taybenlor/runno",
},
};
6 changes: 4 additions & 2 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:package": "tsc && vite build",
"build": "npm run build:package",
"serve": "vite preview"
},
"devDependencies": {
Expand All @@ -27,14 +28,15 @@
"@tailwindcss/typography": "^0.5.4",
"@types/marked": "^4.0.7",
"autoprefixer": "^10.4.0",
"glob": "^10.3.3",
"js-untar": "^2.0.0",
"lit": "^2.7.6",
"marked": "^4.1.0",
"pako": "^1.0.11",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"vite": "^4.4.6",
"vite": "^4.4.9",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-web-links": "^0.6.0"
Expand Down
3 changes: 0 additions & 3 deletions packages/website/src/components/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export class WebsiteHeader extends TailwindElement {
max-w-[50%]
"
>
<a href="/" class="inline-flex font-bold hover:text-yellow group">
Home
</a>
<a href="/wasi" class="inline-flex font-bold hover:text-yellow group">
WASI
</a>
Expand Down
Loading

0 comments on commit 44962a8

Please sign in to comment.