Skip to content

Commit

Permalink
✨ Write docs for most features
Browse files Browse the repository at this point in the history
  • Loading branch information
gwennlbh committed Apr 14, 2024
1 parent 2bb3c30 commit 8243b45
Show file tree
Hide file tree
Showing 22 changed files with 1,555 additions and 91 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[*.md]
indent_size = 2
indent_style = space
197 changes: 111 additions & 86 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,95 @@
import { defineConfig } from "vitepress"
import footnote from "markdown-it-footnote"
import deflists from "markdown-it-deflist"

const ortfodbSidebar = [
{
text: "Introduction",
items: [
{
text: "Getting started",
link: "db/getting-started",
},
{
text: "Your first description.md file",
link: "db/your-first-description-file",
},
{
text: "Database format",
link: "db/database-format",
},
],
},
{
text: "Features",
items: [
{
text: "Scattered mode",
link: "db/scattered-mode",
},
{
text: "Markdown",
link: "db/markdown",
},
{
text: "Thumbnail generation",
link: "db/thumbnails",
},
{
text: "Primary colors extraction",
link: "db/colors",
},
{
text: "Complex layouts",
link: "db/layouts",
},
{
text: "JSON Schemas",
link: "db/json-schemas",
},
],
},
{
text: "Exporters",
base: "db/exporters/",
items: [
{
text: "Introduction",
link: "/",
},
{
text: "Built-in exporters (SSH, FTP, Git, Cloud services)",
link: "/builtin",
},
{
text: "The custom exporter",
link: "/custom",
},
{
text: "Writing your own exporter",
link: "/development",
},
],
},
{
text: "CLI Reference",
base: "/db/commands/",
collapsed: true,
items: [
{ text: "Global options", link: "/" },
{ text: "add", link: "/add" },
{ text: "build", link: "/build" },
{ text: "schemas", link: "/schemas" },
{ text: "replicate", link: "/replicate" },
{ text: "completion", link: "/completion" },
],
},

{
text: "Type definitions for Python, Rust and TypeScript",
link: "/client-libraries",
},
]
// https://vitepress.dev/reference/site-config
export default defineConfig({
lang: "en-US",
Expand All @@ -9,13 +98,18 @@ export default defineConfig({
markdown: {
config: (md) => {
md.use(footnote)
md.use(deflists)
},
},
themeConfig: {
search: {
provider: "local",
},
logo: "/logo.png",
logo: {
dark: "/logo-dark.svg",
light: "/logo-light.svg",
},

// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
Expand All @@ -27,92 +121,23 @@ export default defineConfig({
},

sidebar: {
"/guide/": {
items: [
{
base: "/guide/",
text: "Getting started",
items: [
{ text: "What is ortfo?", link: "/what-is-ortfo" },
{ text: "Quick start", link: "/getting-started" },
{ text: "JSON Schemas", link: "/json-schemas" },
],
},
{
base: "/db/",
text: "ortfo/db",
items: [
{ text: "Introduction", link: "/" },
{ text: "Scattered mode", link: "/scattered-mode" },
{ text: "Exporters", link: "/exporters/" },
],
},
],
},
"/db/": {
base: "/db/",
items: [
{
text: "Getting started",
link: "/getting-started",
},
{
text: "Your first description.md file",
link: "/your-first-description-file",
},
{
text: "Scattered mode",
link: "/scattered-mode",
},
{
text: "Markdown",
link: "/markdown",
},
{
text: "Database format",
link: "/database-format",
},
{
text: "Exporters",
base: "/db/exporters/",
items: [
{
text: "Introduction",
link: "/",
},
{
text: "Built-in exporters (SSH, FTP, Git, Cloud services)",
link: "/builtin",
},
{
text: "The custom exporter",
link: "/custom",
},
{
text: "Writing your own exporter",
link: "/development",
},
],
},
{
text: "CLI Reference",
base: "/db/commands/",
items: [
{ text: "Global options", link: "/" },
{ text: "add", link: "/add" },
{ text: "build", link: "/build" },
{ text: "schemas", link: "/schemas" },
{ text: "replicate", link: "/replicate" },
{ text: "completion", link: "/completion" },
],
},
"/guide/": [
{
base: "/guide/",
text: "Getting started",
items: [
{ text: "What is ortfo?", link: "/what-is-ortfo" },
{ text: "Quick start", link: "/getting-started" },
{ text: "JSON Schemas", link: "/json-schemas" },
],
},
{
text: "ortfo/db",
items: ortfodbSidebar,
},
],

{
text: "Type definitions for Python, Rust and TypeScript",
link: "/client-libraries",
},
],
},
"/db/": ortfodbSidebar,
},

socialLinks: [{ icon: "github", link: "https://github.com/ortfo" }],
Expand Down
Binary file modified bun.lockb
Binary file not shown.
51 changes: 51 additions & 0 deletions db/colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Primary colors extraction

ortfo/db supports extracting the most proeminent colors from the works' images. This can be useful to give a 🎀 colorful touch 🎀 to your website

## Configuration

Enable it in [`ortfodb.yaml`](/db/configuration.md):

```yaml
extract colors:
enabled: true
extract: []
default files: []
```
### `enabled`

Controls whether ortfo/db will try to extract colors or not

### `extract`

Array of

### `default files`

TODO

## In `database.json`

Each media [content block](/db/your-first-description-file.md#blocks) will have a `colors` object that contains the proeminent colors of the media:

```json
{
"ideaseed": {
"content": {
"en": {
"blocks": [
{
"id": "Sw0WJU8osY",
"type": "media",
...
"hasSound": false,
"colors": {// [!code focus]
"primary": "#FEF3ED",// [!code focus]
"secondary": "#858585",// [!code focus]
"tertiary": "#FCC696" // [!code focus]
}, // [!code focus]
"thumbnails": {
"100": "ideaseed/[email protected]",
...
```
5 changes: 0 additions & 5 deletions db/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
next:
link: /db/your-first-description-file
---

# Getting started
## Installation
### Binaries
Expand Down
Loading

0 comments on commit 8243b45

Please sign in to comment.