Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package documentation via VuePress #22

Merged
merged 21 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0ce45d1
Ci: remove redundant `CNAME` file
mihaiconstantin Jul 30, 2022
4081120
Build: initiate `npm` project for docs website
mihaiconstantin Jul 30, 2022
c20fd96
Docs: add icons and logo
mihaiconstantin Jul 30, 2022
ecdb732
Docs: add preliminary config files
mihaiconstantin Jul 30, 2022
a6c6d2d
Docs: add preliminary style files
mihaiconstantin Jul 30, 2022
3d79574
Docs: add landing page text and images
mihaiconstantin Jul 31, 2022
2fd30f5
Fix: update logo name in `VuePress` config
mihaiconstantin Jul 31, 2022
7b29ce5
Docs: add images for the documentation content
mihaiconstantin Aug 18, 2022
2bdd051
Build(docs): add equation and highlighting plugins
mihaiconstantin Aug 18, 2022
8b98043
Build(docs): enable contributors in `VuePress` config
mihaiconstantin Aug 18, 2022
6223af5
Docs: rename `Extensions` menu to `News`
mihaiconstantin Aug 18, 2022
92ea695
Docs: update sidebar items
mihaiconstantin Aug 18, 2022
b0ee99c
Docs: update color scheme
mihaiconstantin Aug 18, 2022
8efe804
Docs: add `R` to `SASS` languages variable
mihaiconstantin Aug 18, 2022
fd8ae97
Docs(style): add custom styles
mihaiconstantin Aug 18, 2022
840ac53
Docs: update landing page content
mihaiconstantin Aug 18, 2022
7353ae4
Docs: add tutorial introduction content
mihaiconstantin Aug 18, 2022
3424085
Docs: add tutorial method content
mihaiconstantin Aug 18, 2022
7a3faa3
Docs: add content placeholder for docs pages
mihaiconstantin Aug 18, 2022
81df57f
Docs: add changes to `NEWS`
mihaiconstantin Aug 18, 2022
7b7d5d5
Ci(docs): add `GitHub` workflow for the docs
mihaiconstantin Aug 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ archive
^man-roxygen$
CNAME
temp.R
docs/
package-lock.json
package.json
node_modules/
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Workflow name.
name: docs

# Events.
on:
# Trigger on push to branch.
push:
branches: [main]
# Trigger manually via the GitHub UI.
workflow_dispatch:

# Jobs.
jobs:
docs:
# Virtual machine type.
runs-on: ubuntu-latest

# Job steps.
steps:
# Fetch all commits to get all `.git` info logs.
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

# Install `Node.js`.
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14'

# Cache `node_modules`.
- name: Cache dependencies
uses: actions/cache@v2
id: yarn-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

# Install `Node.js` dependencies if the cache did not hit.
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

# Run build script.
- name: Build VuePress site
run: yarn docs:build

# Deploy website.
# https://github.com/crazy-max/ghaction-github-pages.
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
# Deploy to `gh-pages` branch.
target_branch: gh-pages
# Deploy the default output dir of VuePress.
build_dir: docs/.vuepress/dist
# Write the given domain name to the CNAME file.
fqdn: powerly.dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ archive
powerly.Rcheck/
*.tar.gz
**/temp*
node_modules/
.temp
.cache
dist
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## development
### Added
- Add starter package documentation via `VuePress`. The deployed documentation
files can be accessed at [powerly.dev](https://powerly.dev).

## 1.8.2 - 2022-07-22
### Fixed
- Remove square brackets from version numbers in `NEWS.md` to allow CRAN to
Expand Down
38 changes: 38 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineUserConfig } from "vuepress"
import { defaultTheme } from "vuepress";
import { sidebar, navbar, head } from "./configs";
import { katexPlugin } from "@renovamen/vuepress-plugin-katex";
import { shikiPlugin } from '@vuepress/plugin-shiki';

/**
* VuePress config.
*/
export default defineUserConfig({
base: "/",
lang: "en-US",
title: "powerly",
description: "Sample Size Analysis for Psychological Networks and more...",
head: head,
theme: defaultTheme({
docsDir: "docs",
docsBranch: "main",
repoLabel: "GitHub",
lastUpdated: true,
contributors: true,
navbar: navbar,
sidebar: sidebar,
sidebarDepth: 2,
logo: "/images/logos/powerly-logo.png",
repo: "https://github.com/mihaiconstantin/powerly",
editLinkText: "Edit this page on GitHub"
}),
plugins: [
// LaTeX plugin.
katexPlugin(),

// Syntax highlighting plugin.
shikiPlugin({
theme: "dark-plus"
})
]
})
33 changes: 33 additions & 0 deletions docs/.vuepress/configs/head.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { HeadConfig } from '@vuepress/core'


/**
* Header links.
*/
export const head: HeadConfig[] = [
[
'link',
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: `/images/icons/favicon-16x16.png`,
},
],
[
'link',
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: `/images/icons/favicon-32x32.png`,
},
],
['meta', { name: 'application-name', content: 'powerly' }],
['meta', { name: 'apple-mobile-web-app-title', content: 'powerly' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
[
'link',
{ rel: 'apple-touch-icon', href: `/images/icons/apple-touch-icon.png` },
],
]
3 changes: 3 additions & 0 deletions docs/.vuepress/configs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './head';
export * from './sidebar';
export * from './navbar';
32 changes: 32 additions & 0 deletions docs/.vuepress/configs/navbar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { NavbarConfig } from '@vuepress/theme-default';


/**
* Navbar links.
*/
export const navbar: NavbarConfig = [
{
text: "Tutorials",
link: "/tutorial/"
},
{
text: "Reference",
link: "/reference/"
},
{
text: "Publications",
link: "/publication/"
},
{
text: "Developer",
link: "/developer/"
},
{
text: "News",
link: "https://github.com/mihaiconstantin/powerly/blob/main/NEWS.md"
},
{
text: "CRAN",
link: "https://CRAN.R-project.org/package=powerly"
}
]
39 changes: 39 additions & 0 deletions docs/.vuepress/configs/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { SidebarConfig } from '@vuepress/theme-default';


/**
* Sidebar links.
*/
export const sidebar: SidebarConfig = {
"/tutorial/": [
"/tutorial/index.md",
"/tutorial/method.md",
{
text: 'Applications',
collapsible: true,
children: [
"/tutorial/application/power-psychological-networks.md",
"/tutorial/application/power-structural-equation-modeling.md",
"/tutorial/application/power-multilevel-models.md",
]
},
{
text: 'FAQ',
collapsible: true,
children: [
"/tutorial/faq/choosing-the-initial-range.md",
"/tutorial/faq/validating-the-results.md",
"/tutorial/faq/choosing-the-true-model.md",
]
},
],
"/reference/": [
"/reference/index.md",
],
"/publication/": [
"/publication/index.md",
],
"/developer/": [
"/developer/index.md",
]
}
Binary file added docs/.vuepress/public/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading