Skip to content

Commit

Permalink
Merge pull request #1 from marpple/init-docs
Browse files Browse the repository at this point in the history
docs: init rune docs
  • Loading branch information
okyungjin authored Mar 15, 2024
2 parents ef47918 + d732f67 commit dd6637d
Show file tree
Hide file tree
Showing 15 changed files with 2,179 additions and 839 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy-docs-to-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy Docs to Pages

on:
# push:
# branches: [ main ]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install
- name: Build with VitePress
run: pnpm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vitepress/dist
.vitepress/cache
38 changes: 38 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Rune",
description: "Hello, Rune!",
base: '/rune/',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
sidebar: [
{
text: 'Introduction',
items: [
{ text: 'What is Rune?', link: '/guide/what-is-rune' },
{ text: 'Getting Started', link: '/guide/getting-started' },
]
},
{
text: 'Tutorial',
items: [
{ text: 'View', link: '/tutorial/view' },
{ text: 'View 추상화하기', link: '/tutorial/view-abstract' },
{ text: 'Enable', link: '/tutorial/enable' },
{ text: 'Markdown Examples', link: 'guide/markdown-examples' },
]
},
{
text: 'API Reference',
items: [
{ text: 'API name', link: '/api/examples' },
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/marpple/rune' }
]
}
})
49 changes: 49 additions & 0 deletions docs/api/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
---

# Runtime API Examples

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:

```md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```

<script setup>
import { useData } from 'vitepress'

const { site, theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>

## More

Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
Empty file removed docs/core/rune.$/튜토리얼.md
Empty file.
Loading

0 comments on commit dd6637d

Please sign in to comment.