Skip to content

Commit 71c13a4

Browse files
Merge pull request #22 from mihaiconstantin/feat/package-docs
Add package documentation via `VuePress`. Closes #7.
2 parents 5209e60 + 7b7d5d5 commit 71c13a4

Some content is hidden

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

42 files changed

+6177
-1
lines changed

.Rbuildignore

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ archive
99
^man-roxygen$
1010
CNAME
1111
temp.R
12+
docs/
13+
package-lock.json
14+
package.json
15+
node_modules/

.github/workflows/docs.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Workflow name.
2+
name: docs
3+
4+
# Events.
5+
on:
6+
# Trigger on push to branch.
7+
push:
8+
branches: [main]
9+
# Trigger manually via the GitHub UI.
10+
workflow_dispatch:
11+
12+
# Jobs.
13+
jobs:
14+
docs:
15+
# Virtual machine type.
16+
runs-on: ubuntu-latest
17+
18+
# Job steps.
19+
steps:
20+
# Fetch all commits to get all `.git` info logs.
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
# Install `Node.js`.
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: '14'
31+
32+
# Cache `node_modules`.
33+
- name: Cache dependencies
34+
uses: actions/cache@v2
35+
id: yarn-cache
36+
with:
37+
path: |
38+
**/node_modules
39+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-yarn-
42+
43+
# Install `Node.js` dependencies if the cache did not hit.
44+
- name: Install dependencies
45+
if: steps.yarn-cache.outputs.cache-hit != 'true'
46+
run: yarn --frozen-lockfile
47+
48+
# Run build script.
49+
- name: Build VuePress site
50+
run: yarn docs:build
51+
52+
# Deploy website.
53+
# https://github.com/crazy-max/ghaction-github-pages.
54+
- name: Deploy to GitHub Pages
55+
uses: crazy-max/ghaction-github-pages@v2
56+
with:
57+
# Deploy to `gh-pages` branch.
58+
target_branch: gh-pages
59+
# Deploy the default output dir of VuePress.
60+
build_dir: docs/.vuepress/dist
61+
# Write the given domain name to the CNAME file.
62+
fqdn: powerly.dev
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ archive
66
powerly.Rcheck/
77
*.tar.gz
88
**/temp*
9+
node_modules/
10+
.temp
11+
.cache
12+
dist

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format
33
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
44
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## development
7+
### Added
8+
- Add starter package documentation via `VuePress`. The deployed documentation
9+
files can be accessed at [powerly.dev](https://powerly.dev).
10+
611
## 1.8.2 - 2022-07-22
712
### Fixed
813
- Remove square brackets from version numbers in `NEWS.md` to allow CRAN to

docs/.vuepress/config.ts

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { defineUserConfig } from "vuepress"
2+
import { defaultTheme } from "vuepress";
3+
import { sidebar, navbar, head } from "./configs";
4+
import { katexPlugin } from "@renovamen/vuepress-plugin-katex";
5+
import { shikiPlugin } from '@vuepress/plugin-shiki';
6+
7+
/**
8+
* VuePress config.
9+
*/
10+
export default defineUserConfig({
11+
base: "/",
12+
lang: "en-US",
13+
title: "powerly",
14+
description: "Sample Size Analysis for Psychological Networks and more...",
15+
head: head,
16+
theme: defaultTheme({
17+
docsDir: "docs",
18+
docsBranch: "main",
19+
repoLabel: "GitHub",
20+
lastUpdated: true,
21+
contributors: true,
22+
navbar: navbar,
23+
sidebar: sidebar,
24+
sidebarDepth: 2,
25+
logo: "/images/logos/powerly-logo.png",
26+
repo: "https://github.com/mihaiconstantin/powerly",
27+
editLinkText: "Edit this page on GitHub"
28+
}),
29+
plugins: [
30+
// LaTeX plugin.
31+
katexPlugin(),
32+
33+
// Syntax highlighting plugin.
34+
shikiPlugin({
35+
theme: "dark-plus"
36+
})
37+
]
38+
})

docs/.vuepress/configs/head.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { HeadConfig } from '@vuepress/core'
2+
3+
4+
/**
5+
* Header links.
6+
*/
7+
export const head: HeadConfig[] = [
8+
[
9+
'link',
10+
{
11+
rel: 'icon',
12+
type: 'image/png',
13+
sizes: '16x16',
14+
href: `/images/icons/favicon-16x16.png`,
15+
},
16+
],
17+
[
18+
'link',
19+
{
20+
rel: 'icon',
21+
type: 'image/png',
22+
sizes: '32x32',
23+
href: `/images/icons/favicon-32x32.png`,
24+
},
25+
],
26+
['meta', { name: 'application-name', content: 'powerly' }],
27+
['meta', { name: 'apple-mobile-web-app-title', content: 'powerly' }],
28+
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
29+
[
30+
'link',
31+
{ rel: 'apple-touch-icon', href: `/images/icons/apple-touch-icon.png` },
32+
],
33+
]

docs/.vuepress/configs/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './head';
2+
export * from './sidebar';
3+
export * from './navbar';

docs/.vuepress/configs/navbar.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { NavbarConfig } from '@vuepress/theme-default';
2+
3+
4+
/**
5+
* Navbar links.
6+
*/
7+
export const navbar: NavbarConfig = [
8+
{
9+
text: "Tutorials",
10+
link: "/tutorial/"
11+
},
12+
{
13+
text: "Reference",
14+
link: "/reference/"
15+
},
16+
{
17+
text: "Publications",
18+
link: "/publication/"
19+
},
20+
{
21+
text: "Developer",
22+
link: "/developer/"
23+
},
24+
{
25+
text: "News",
26+
link: "https://github.com/mihaiconstantin/powerly/blob/main/NEWS.md"
27+
},
28+
{
29+
text: "CRAN",
30+
link: "https://CRAN.R-project.org/package=powerly"
31+
}
32+
]

docs/.vuepress/configs/sidebar.ts

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { SidebarConfig } from '@vuepress/theme-default';
2+
3+
4+
/**
5+
* Sidebar links.
6+
*/
7+
export const sidebar: SidebarConfig = {
8+
"/tutorial/": [
9+
"/tutorial/index.md",
10+
"/tutorial/method.md",
11+
{
12+
text: 'Applications',
13+
collapsible: true,
14+
children: [
15+
"/tutorial/application/power-psychological-networks.md",
16+
"/tutorial/application/power-structural-equation-modeling.md",
17+
"/tutorial/application/power-multilevel-models.md",
18+
]
19+
},
20+
{
21+
text: 'FAQ',
22+
collapsible: true,
23+
children: [
24+
"/tutorial/faq/choosing-the-initial-range.md",
25+
"/tutorial/faq/validating-the-results.md",
26+
"/tutorial/faq/choosing-the-true-model.md",
27+
]
28+
},
29+
],
30+
"/reference/": [
31+
"/reference/index.md",
32+
],
33+
"/publication/": [
34+
"/publication/index.md",
35+
],
36+
"/developer/": [
37+
"/developer/index.md",
38+
]
39+
}

docs/.vuepress/public/favicon.ico

14.7 KB
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)