-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs with vitepress and genji (#137)
- Loading branch information
Showing
12 changed files
with
1,602 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
**/target | ||
src/wasm | ||
dist | ||
**/*-actual.txt | ||
**/*-actual.txt | ||
cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {defineConfig} from "vitepress"; | ||
import config from "genji-theme-vitepress/config"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "Charming Cell", | ||
description: "The creative coding language for ASCII Art", | ||
extends: config, | ||
themeConfig: { | ||
nav: [ | ||
{text: "Home", link: "/"}, | ||
{text: "Examples", link: "https://observablehq.com/d/18b3d6f3affff5bb"}, | ||
], | ||
sidebar: [ | ||
{ | ||
text: "Introduction", | ||
items: [ | ||
{text: "What is Cell?", link: "/what-is-cell"}, | ||
{text: "Getting started", link: "/get-started"}, | ||
], | ||
}, | ||
{ | ||
text: "Features", | ||
items: [ | ||
{text: "Sketches", link: "/features/sketches"}, | ||
{text: "Shapes", link: "/features/shapes"}, | ||
], | ||
}, | ||
{text: "API Index", link: "/api-index"}, | ||
], | ||
socialLinks: [{icon: "github", link: "https://github.com/charming-art/cell"}], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// .vitepress/theme/index.js | ||
import DefaultTheme from "vitepress/theme"; | ||
import Layout from "genji-theme-vitepress"; | ||
import {h} from "vue"; | ||
import * as Cell from "../../../dist/es/index.js"; | ||
|
||
// More props: https://genji-md.dev/reference/props | ||
const props = { | ||
Theme: DefaultTheme, | ||
library: { | ||
Cell, | ||
}, | ||
}; | ||
|
||
export default { | ||
extends: DefaultTheme, | ||
Layout: () => h(Layout, props), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# API Index | ||
|
||
## Methods | ||
|
||
- render | ||
- wide | ||
|
||
## Context | ||
|
||
- stroke | ||
- point | ||
- cols | ||
- rows | ||
|
||
## Options | ||
|
||
- width | ||
- height | ||
- mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Shapes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Sketches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Getting Started | ||
|
||
> WIP | ||
```bash | ||
npm install @charming-art/cell | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# https://vitepress.dev/reference/default-theme-home-page | ||
layout: home | ||
|
||
hero: | ||
name: "Charming Cell" | ||
text: "The creative coding language for ASCII Art" | ||
tagline: Create expressive ASCII Art in a minute | ||
actions: | ||
- theme: brand | ||
text: Get Started | ||
link: /get-started | ||
- theme: alt | ||
text: What is Cell? | ||
link: /what-is-cell | ||
- theme: alt | ||
text: Examples | ||
link: https://observablehq.com/d/18b3d6f3affff5bb | ||
|
||
features: | ||
- title: Concise | ||
details: In the style of P5.js | ||
- title: Fast | ||
details: A software rasterizer written in Rust and compiled to WASM | ||
- title: Amusing | ||
details: Life is not just about work, right? | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# What is Cell? | ||
|
||
```js eval | ||
Cell.render((ctx) => ({ | ||
mode: "double", | ||
width: 520, | ||
height: 520, | ||
setup() { | ||
for (let t = 0; t <= Math.PI * 2; t += Math.PI / 120) { | ||
const x = ctx.cols() / 2 + 12 * Math.cos(t) * Math.cos(t * 3); | ||
const y = ctx.rows() / 2 + 12 * Math.sin(t) * Math.cos(t * 3); | ||
ctx.stroke(Cell.wide("🌟")); | ||
ctx.point(x, y); | ||
} | ||
}, | ||
})); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.