Skip to content

Commit 16346a1

Browse files
committed
Add documentation page
1 parent 862f474 commit 16346a1

21 files changed

Lines changed: 1826 additions & 8 deletions

.github/workflows/deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy docs site to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
5+
# using the `master` branch as the default branch.
6+
push:
7+
branches: [main]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: pages
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 10
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 20
36+
cache: "yarn"
37+
38+
- name: Yarn install
39+
run: yarn install --frozen-lockfile
40+
41+
- name: Build documentation site
42+
run: yarn docs:build
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: ./docs/.vitepress/dist
51+
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
57+
needs: build
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 10
60+
name: Deploy
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ source "https://rubygems.org"
55
gemspec
66

77
gem "actionview", "~> 8.0"
8-
gem "herb"
8+
gem "herb", path: "../herb-linter"
99
gem "maxitest"
10-
gem "minitest", "~> 5.16"
1110
gem "minitest-difftastic"
11+
gem "minitest", "~> 5.16"
1212
gem "railties", "~> 8.0"
1313
gem "rake", "~> 13.0"
1414
gem "rubocop", "~> 1.80.1"

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist/
2+
cache/
3+
.vitepress/dist/
4+
.vitepress/cache/
5+
node_modules/

docs/.vitepress/config.mts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { defineConfig } from "vitepress"
2+
import { createMarkdownConfig } from "./config/markdown.mts"
3+
import { createViteConfig } from "./config/vite.mts"
4+
import { createThemeConfig } from "./config/theme.mts"
5+
6+
const themeConfig = createThemeConfig()
7+
8+
const title = "ReActionView"
9+
const description = "Enhanced ERB templates with Herb engine integration for Rails applications."
10+
11+
// https://vitepress.dev/reference/site-config
12+
export default defineConfig({
13+
title,
14+
description,
15+
srcDir: "./docs",
16+
base: "/reactionview/",
17+
head: [
18+
['link', { rel: 'icon', href: '/favicon.ico' }],
19+
['link', { rel: 'icon', href: '/favicon-16x16.png', sizes: '16x16' }],
20+
['link', { rel: 'icon', href: '/favicon-32x32.png', sizes: '32x32' }],
21+
['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }],
22+
['meta', { property: 'og:image', content: '/social.png' }],
23+
['meta', { property: 'og:title', content: 'ReActionView' }],
24+
['meta', { property: 'og:description', content: 'Enhanced ERB templates with Herb engine integration for Rails applications.' }],
25+
['meta', { property: 'og:url', content: 'https://reactionview.dev' }],
26+
['meta', { property: 'og:type', content: 'website' }],
27+
],
28+
cleanUrls: true,
29+
markdown: createMarkdownConfig(),
30+
vite: createViteConfig(),
31+
themeConfig,
32+
transformPageData(pageData) {
33+
pageData.frontmatter.head ??= []
34+
35+
const pageTitle = pageData.frontmatter.title || pageData.title
36+
37+
pageData.frontmatter.head.push([
38+
'meta',
39+
{
40+
property: 'og:title',
41+
content: pageTitle ? `${pageTitle} | ${title}` : `${title} - ${description}`
42+
}
43+
])
44+
},
45+
46+
async buildEnd() {
47+
console.log('🎉 VitePress build completed successfully')
48+
}
49+
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { groupIconMdPlugin } from "vitepress-plugin-group-icons"
2+
3+
export function createMarkdownConfig() {
4+
return {
5+
config(md) {
6+
md.use(groupIconMdPlugin)
7+
},
8+
// Explicitly load these languages for types highlighting
9+
languages: ["js", "jsx", "ts", "tsx", "bash", "shell", "ruby", "html", "erb"],
10+
}
11+
}

docs/.vitepress/config/theme.mts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const defaultSidebar = [
2+
{
3+
text: "Getting Started",
4+
collapsed: false,
5+
items: [
6+
{ text: "Overview", link: "/overview" },
7+
{ text: "Installation", link: "/installation" },
8+
],
9+
},
10+
{
11+
text: "Guides",
12+
collapsed: false,
13+
items: [
14+
{ text: "Debug Mode", link: "/guides/debug-mode" },
15+
{ text: "Validation Overlays", link: "/guides/validation-overlays" },
16+
{ text: "Development Tools", link: "/guides/development-tools" },
17+
],
18+
},
19+
{
20+
text: "Integration",
21+
collapsed: false,
22+
items: [
23+
{ text: "Rails", link: "/integrations/rails" },
24+
],
25+
},
26+
]
27+
28+
export function createThemeConfig() {
29+
return {
30+
logo: "/reactionview.png",
31+
nav: [
32+
{ text: "Home", link: "/" },
33+
{ text: "Documentation", link: "/overview" },
34+
{ text: "GitHub", link: "https://github.com/marcoroth/reactionview" },
35+
],
36+
outline: [2, 4],
37+
search: {
38+
provider: "local",
39+
},
40+
lastUpdated: {
41+
text: "Last updated",
42+
formatOptions: {
43+
dateStyle: "long",
44+
},
45+
},
46+
footer: {
47+
message: "Released under the MIT License.",
48+
copyright: "Copyright © 2025 Marco Roth and the ReActionView Contributors.",
49+
},
50+
editLink: {
51+
pattern: "https://github.com/marcoroth/reactionview/edit/main/docs/docs/:path",
52+
text: "Edit this page on GitHub",
53+
},
54+
sidebar: {
55+
'/': defaultSidebar
56+
},
57+
socialLinks: [
58+
{ icon: "github", link: "https://github.com/marcoroth/reactionview" },
59+
{ icon: "twitter", link: "https://twitter.com/marcoroth_" },
60+
{ icon: "mastodon", link: "https://ruby.social/@marcoroth" },
61+
{ icon: "bluesky", link: "https://bsky.app/profile/marcoroth.dev" },
62+
],
63+
}
64+
}

docs/.vitepress/config/vite.mts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { groupIconVitePlugin } from "vitepress-plugin-group-icons"
2+
3+
function createBuildStartPlugin() {
4+
return {
5+
name: 'reactionview-build-start',
6+
async buildStart() {
7+
console.log('🚀 Build starting - ReActionView docs...')
8+
},
9+
configResolved(config) {
10+
console.log(`📋 Build mode: ${config.command}`)
11+
}
12+
}
13+
}
14+
15+
export function createViteConfig() {
16+
// https://vp.yuy1n.io/features.html
17+
// https://github.com/vscode-icons/vscode-icons/wiki/ListOfFiles
18+
const groupIconPlugin = groupIconVitePlugin({
19+
customIcon: {
20+
ruby: "vscode-icons:file-type-ruby",
21+
".rb": "vscode-icons:file-type-ruby",
22+
".gemspec": "vscode-icons:file-type-ruby",
23+
gemfile: "vscode-icons:file-type-bundler",
24+
browser: "vscode-icons:file-type-js",
25+
"Node.js": "vscode-icons:file-type-js",
26+
".js": "vscode-icons:file-type-js",
27+
javascript: "vscode-icons:file-type-js",
28+
shell: "vscode-icons:file-type-shell",
29+
".erb": "vscode-icons:file-type-html",
30+
".html.erb": "vscode-icons:file-type-html",
31+
".herb": "vscode-icons:file-type-html",
32+
},
33+
})
34+
35+
const buildStartPlugin = createBuildStartPlugin()
36+
37+
return {
38+
plugins: [groupIconPlugin, buildStartPlugin],
39+
}
40+
}

docs/.vitepress/theme/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Theme } from 'vitepress'
2+
import DefaultTheme from 'vitepress/theme'
3+
4+
import './style.css'
5+
6+
export default {
7+
extends: DefaultTheme,
8+
} satisfies Theme

0 commit comments

Comments
 (0)