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

Hosting Documentation #101

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 50 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Documenter

on:
# Runs on pushes targeting the `main` branch.
push:
branches:
- main
tags: ['*']
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
statuses: 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
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Pull Julia cache
uses: julia-actions/cache@v1
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
#- name: Creating new mds from src
- name: Build and deploy docs
uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: "100" # for Plots.jl plots (if you have them)
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
node_modules/
package-lock.json
Manifest.toml
7 changes: 7 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"

[compat]
Documenter = "1.5"
DocumenterVitepress = "0.1"
24 changes: 24 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Documenter, DocumenterVitepress

using Subzero

makedocs(;
modules=[Subzero],
authors="Skylar Gering",
repo="https://github.com/Caltech-OCTO/Subzero.jl",
sitename="Subzero.jl",
format=DocumenterVitepress.MarkdownVitepress(
repo = "https://github.com/Caltech-OCTO/Subzero.jl",
devurl = "dev",
deploy_url = "Caltech-OCTO.github.io/Subzero.jl",
),
pages=[
"Home" => "index.md",
],
warnonly = true,
)

deploydocs(;
repo="https://github.com/Caltech-OCTO/Subzero.jl",
push_preview=true,
)
15 changes: 15 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scripts": {
"docs:dev": "vitepress dev build/.documenter",
"docs:build": "vitepress build build/.documenter",
"docs:preview": "vitepress preview build/.documenter"
},
"dependencies": {
"@shikijs/transformers": "^1.1.7",
"markdown-it": "^14.1.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-mathjax3": "^4.3.2",
"vitepress": "^1.1.4",
"vitepress-plugin-tabs": "^0.5.0"
}
}
48 changes: 48 additions & 0 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { defineConfig } from 'vitepress'
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import mathjax3 from "markdown-it-mathjax3";
import footnote from "markdown-it-footnote";

// https://vitepress.dev/reference/site-config
export default defineConfig({
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
title: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
description: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
lastUpdated: true,
cleanUrls: true,
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
head: [['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }]],
ignoreDeadLinks: true,

markdown: {
math: true,
config(md) {
md.use(tabsMarkdownPlugin),
md.use(mathjax3),
md.use(footnote)
},
theme: {
light: "github-light",
dark: "github-dark"}
},
themeConfig: {
outline: 'deep',
logo: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
search: {
provider: 'local',
options: {
detailedView: true
}
},
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
socialLinks: [
{ icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' }
],
footer: {
message: 'Made with <a href="https://luxdl.github.io/DocumenterVitepress.jl/dev/" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>',
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
}
}
})
19 changes: 19 additions & 0 deletions docs/src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// .vitepress/theme/index.ts
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'

import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
import './style.css'

export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
enhanceAppWithTabs(app)
}
} satisfies Theme
Loading
Loading