Skip to content

Commit 52f98d0

Browse files
committed
First stab
1 parent 14c8927 commit 52f98d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4400
-8
lines changed

docusaurus.config.js

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
const lightCodeTheme = require("prism-react-renderer").themes.github;
55
const darkCodeTheme = require("prism-react-renderer").themes.dracula;
6+
const fs = require('fs').promises;
67

78
const siteName = "Runme.dev";
89
const twitterHandle = "@statefulhq";
@@ -55,6 +56,46 @@ const config = {
5556
},
5657
};
5758
},
59+
async function examplesInDocs(context, options) {
60+
return {
61+
name: 'examples-in-docs',
62+
async contentLoaded({ content, actions }) {
63+
const { createData, addRoute } = actions;
64+
const examples = await fs.readFile('./examples/examples.json', 'utf8');
65+
const examplesJsonPath = await createData(
66+
'examples.json',
67+
examples,
68+
);
69+
70+
addRoute({
71+
path: '/examples',
72+
component: '@site/src/components/ExamplesPage',
73+
modules: {
74+
// propName -> JSON file path
75+
examples: examplesJsonPath,
76+
},
77+
exact: true,
78+
});
79+
80+
const examplesJson = JSON.parse(examples);
81+
examplesJson.forEach(async (example) => {
82+
const exampleJsonPath = await createData(
83+
`example-${example.slug}.json`,
84+
JSON.stringify(example),
85+
);
86+
addRoute({
87+
path: `/examples/${example.slug}`,
88+
component: '@site/src/components/ExamplesPage',
89+
modules: {
90+
// propName -> JSON file path
91+
example: exampleJsonPath,
92+
},
93+
exact: true,
94+
});
95+
});
96+
},
97+
};;
98+
},
5899
[
59100
"@docusaurus/plugin-pwa",
60101
{
@@ -182,15 +223,15 @@ const config = {
182223
* credentials available in 1password
183224
*/
184225
...(process.env.ALGOLIA_API_KEY &&
185-
process.env.ALGOLIA_INDEX_NAME &&
186-
process.env.ALGOLIA_APP_ID
226+
process.env.ALGOLIA_INDEX_NAME &&
227+
process.env.ALGOLIA_APP_ID
187228
? {
188-
algolia: {
189-
apiKey: process.env.ALGOLIA_API_KEY,
190-
indexName: process.env.ALGOLIA_INDEX_NAME,
191-
appId: process.env.ALGOLIA_APP_ID,
192-
},
193-
}
229+
algolia: {
230+
apiKey: process.env.ALGOLIA_API_KEY,
231+
indexName: process.env.ALGOLIA_INDEX_NAME,
232+
appId: process.env.ALGOLIA_APP_ID,
233+
},
234+
}
194235
: {}),
195236
}),
196237
};

examples/examples.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
[
2+
{
3+
"title": "Hello World!",
4+
"description": "A simple example to create a new markdown file that installs and runs the dancing-bear with npm, run it in the notebook UX, and then use the `runme` CLI to parse and run the dancing bear in the terminal.",
5+
"slug": "hello-world",
6+
"tags": ["notebook", "cli", "hello world"],
7+
"runme": "https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fsourishkrout%2Floon.git&fileToOpen=AI.md",
8+
"repo": "https://github.com/stateful/vscode-runme/blob/main/examples/README.md",
9+
"docs": "https://docs.runme.dev/install",
10+
"img": "/graphics/hello-world.gif"
11+
},
12+
{
13+
"title": "Image rendering in notebook cells with OpenAI (image MIME type)",
14+
"description": "Changing the mimeType in the notebook cell configuration (image/png) let's you specify how you want the output rendered, in this case the image binary generated by OpenAI.",
15+
"webm": "https://media.graphassets.com/XfI7g2nYTgmwSGg75CDc",
16+
"mp4": "https://media.graphassets.com/N4iyhZ7S8WmssHAAQnbA",
17+
"slug": "rendering-an-image-openai",
18+
"tags": ["notebook", "render", "openai", "mime", "jpg", "image", "output"],
19+
"runme": "https://runme.dev/api/runme?repository=https%253A%252F%252Fgithub.com%252Fstateful%252Fvscode-runme.git%2526fileToOpen%253D%252Fexamples%252FREADME.md",
20+
"repo": "https://github.com/sourishkrout/loon",
21+
"docs": "https://docs.runme.dev/configuration#supported-mime-types"
22+
},
23+
{
24+
"title": "Integration testing a markdown in Github Actions",
25+
"description": "Avoid having to maintain multiple workflows for building, testing and deploying your application and instead, document them in markdown and have them used by your contributors and CI/CD. Find out in this example how we manage workflows in our `stateful/runmejs` project using Runme.",
26+
"img": "/graphics/runme-in-ci.png",
27+
"slug": "integration-testing-markdown-gh-action",
28+
"runme": "https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fstateful%2Frunmejs.git&fileToOpen=CONTRIBUTING.md",
29+
"repo": "https://github.com/stateful/runmejs",
30+
"docs": "https://docs.runme.dev/integrations#github-action",
31+
"tags": ["cli", "testing", "markdown", "github", "action", "ci/cd", "terminal"]
32+
},
33+
{
34+
"title": "Hardening Ubuntu server",
35+
"description": "Enhances the server's overall security posture, encourages continuous improvement, and safeguards against future attacks,",
36+
"mp4": "https://media.graphassets.com/RiKBWblNSbSR86ZcAVTa",
37+
"webm": "https://media.graphassets.com/NPgIDIcrRaiDt6prS8VD",
38+
"slug": "Hardening-Ubuntu-server",
39+
"runme": "https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fstateful%2Fhardening-ubuntu-server%2Fblob%2Fmain%2FREADME.md",
40+
"repo": "https://github.com/stateful/hardening-ubuntu-server",
41+
"docs": "https://docs.runme.dev/architecture",
42+
"tags": ["cli", "markdown", "ci/cd", "terminal", "ubuntu", "security"]
43+
},
44+
{
45+
"title": "Explore large JSON files interactively with antonmedv/fx",
46+
"description": "Create interactive workflows that allow your contributor to inspect their environment using popular terminal tools right within VS Code.",
47+
"img": "/graphics/fx-demo.gif",
48+
"slug": "explore-json-fx",
49+
"runme": "https://runme.dev/api/runme?repository=https%253A%252F%252Fgithub.com%252Fstateful%252Fvscode-runme.git%2526fileToOpen%253D%252Fexamples%252FREADME.md",
50+
"tags": ["notebook", "fx", "json", "render"]
51+
},
52+
{
53+
"title": "Launching a Runme notebook with a web link",
54+
"description": "With Runme you can bootstrap the onboarding of your contributors interactively through a notebook. With the Runme link you can save developers time having to manually clone the repository and direct them to the right document that help them to get productive quickly.",
55+
"img": "/graphics/runme-link-demo.gif",
56+
"slug": "launch-notebook-web-link",
57+
"runme": "https://runme.dev/api/runme?repository=https%3A%2F%2Fgithub.com%2Fstateful%2Frunmejs.git&fileToOpen=CONTRIBUTING.md",
58+
"docs": "https://docs.runme.dev/features#run-with-runme-deep-linking",
59+
"tags": ["notebook", "web", "education", "tutorial", "onboarding"]
60+
},
61+
{
62+
"title": "Render notebook cell output as a table (csv MIME type)",
63+
"description": "If you want to render a sortable table instead of comma delimited text with your cell output, it's as simple as going into the cell configuration and changing the mimetype to `text/csv` then re-running the cell. This is one of many super useful available MIME types you can take advantage of in your Runme notebook.",
64+
"img": "/graphics/mime-type-demo.gif",
65+
"slug": "custom-renderer-table-mime",
66+
"docs": "https://docs.runme.dev/configuration#supported-mime-types",
67+
"tags": ["notebook", "mime", "render", "output", "table"]
68+
},
69+
{
70+
"title": "Chaining output between markdown commands",
71+
"description": "With the `$__` parameter you can transfer the stdout result of a previous cell into your next execution.",
72+
"img": "/graphics/chaining-demo.gif",
73+
"slug": "chain-output-between-commands",
74+
"docs": "https://docs.runme.dev/features#chain-cell-output",
75+
"tags": ["notebook", "cli", "output", "chaining", "markdown", "workflow", "terminal"]
76+
},
77+
{
78+
"title": "Vercel deployment workflow in a notebook",
79+
"description": "Runme integrates with cloud services such as Vercel or Deno cloud to make deploying on the edge interactive and fun!",
80+
"img": "/graphics/integrations.gif",
81+
"slug": "vercel-deploy-in-notebook",
82+
"docs": "https://docs.runme.dev/integrations#nextjs-app-on-vercel",
83+
"tags": ["notebook", "vercel", "integration", "deploy"]
84+
},
85+
{
86+
"title": "Running Docker commands from markdown with our CLI",
87+
"description": "Runme can share the same terminal session across CLI and notebook allowing you to run flexible Docker workflows between VS Code and your terminal.",
88+
"img": "/graphics/docker-demo.gif",
89+
"slug": "running-docker-markdown-cli",
90+
"tags": ["notebook", "markdown", "docker"]
91+
},
92+
{
93+
"title": "Notebook LSP Support",
94+
"description": "Runme notebooks come with support of multiple script and declaritive languages, e.g. YAML, providing you text highlighting and auto-completion feature.",
95+
"img": "/graphics/lsp-demo.gif",
96+
"slug": "lsp-support",
97+
"tags": ["notebook", "lsp", "language"]
98+
},
99+
{
100+
"title": "Consistant Environment State",
101+
"description": "Execute markdown cells in VS Code and keep environment variables persistent. This allows you to create a click to play notebook experience for running your markdown in the browser, or VS Code with Runme.",
102+
"img": "/graphics/notebook-transparent.gif",
103+
"slug": "environment-state",
104+
"tags": ["environment", "workflow", "state"]
105+
},
106+
{
107+
"title": "Runme in DevContainer",
108+
"description": "The VS Code window attaches to an instance of the container image and transparently mounts the file system so changes are reflected locally.",
109+
"mp4": "/videos/devcontainer.mp4",
110+
"webm": "/videos/devcontainer.webm",
111+
"runme": "https://runme.dev/api/runme?repository=https%253A%252F%252Fgithub.com%252Fstateful%252Fblog-examples.git%2526fileToOpen%253D%252Fdevcontainer%252Fsandbox.md",
112+
"slug": "devcontainer",
113+
"tags": ["devcontainer", "workspace", "ephemeral"]
114+
}
115+
]

examples/examples.next

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"title": "Github Actions workflows UX (from a URL)",
4+
"description": "This is a description of the thing this does and why it's cool",
5+
"img": "https://media.graphassets.com/mbfC7eMfSHaKGeXvvWh2",
6+
"slug": "gh-action-workflow-ux",
7+
"tags": ["notebook", "github", "workflows", "ux", "action"]
8+
},
9+
{
10+
"title": "Terminals embeded in your notebook cells",
11+
"description": "This is a description of the thing this does and why it's cool",
12+
"img": "https://media.graphassets.com/mbfC7eMfSHaKGeXvvWh2",
13+
"slug": "terminals-embeded-notebook-cells",
14+
"tags": ["notebook", "terminal"]
15+
},
16+
{
17+
"title": "Click to send a SMS (Twilio) from a notebook",
18+
"description": "This is a description of the thing this does and why it's cool",
19+
"img": "https://media.graphassets.com/mbfC7eMfSHaKGeXvvWh2",
20+
"slug": "sent-sms-twilio-notebook",
21+
"tags": ["notebook", "sms", "twilio"]
22+
}
23+
]

package-lock.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"@docusaurus/plugin-pwa": "^3.1.1",
1919
"@docusaurus/preset-classic": "3.1.1",
2020
"@docusaurus/tsconfig": "3.1.1",
21+
"@fortawesome/free-solid-svg-icons": "^6.5.2",
22+
"@fortawesome/react-fontawesome": "^0.2.0",
2123
"@mdx-js/react": "^3.0.0",
2224
"clsx": "^2.1.0",
2325
"prism-react-renderer": "^2.3.0",

0 commit comments

Comments
 (0)