-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move documentation to Vitepress (#256)
* Update to DocumenterVitepress backend * Ignore Node packages * Temporarily disable raw HTML image inclusion * update alternatives * big docs update * more doc changes * update type hierarchy diagram * update * format code * configure vitepress * split API into sections * rename "alternatives" to "friends" * comment `baseTemp` * add icons for friends and api sections * fix versioned docs * try fix navigation bar * fix path to versions.js * add missing import
- Loading branch information
Showing
30 changed files
with
823 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/ | ||
node_modules/ | ||
package-lock.json | ||
Manifest.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' | ||
import mathjax3 from "markdown-it-mathjax3"; | ||
import footnote from "markdown-it-footnote"; | ||
|
||
const baseTemp = { | ||
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs! | ||
} | ||
|
||
const navTemp = { | ||
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS', | ||
} | ||
|
||
const nav = [ | ||
...navTemp.nav, | ||
{ | ||
component: 'VersionPicker' | ||
} | ||
] | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
base: baseTemp.base, | ||
title: 'REPLACE_ME_DOCUMENTER_VITEPRESS', | ||
description: 'Documentation of Tenet.jl library', | ||
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' }], | ||
["script", { src: `/Tenet.jl/versions.js` }], | ||
["script", { src: `${baseTemp.base}siteinfo.js` }], | ||
], | ||
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: { | ||
light: '/logo.svg', | ||
dark: '/logo-dark.svg', | ||
}, | ||
search: { | ||
provider: 'local', | ||
options: { | ||
detailedView: true | ||
} | ||
}, | ||
nav, | ||
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()} Barcelona Supercomputing Center - Centro Nacional de Supercomputación` | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- Adapted from https://github.com/MakieOrg/Makie.jl/blob/master/docs/src/.vitepress/theme/VersionPicker.vue --> | ||
|
||
<script setup lang="ts"> | ||
import { computed, ref, onMounted } from 'vue' | ||
import { useRoute } from 'vitepress' | ||
import VPNavBarMenuGroup from 'vitepress/dist/client/theme-default/components/VPNavBarMenuGroup.vue' | ||
import VPNavScreenMenuGroup from 'vitepress/dist/client/theme-default/components/VPNavScreenMenuGroup.vue' | ||
const props = defineProps<{ | ||
screenMenu?: boolean | ||
}>() | ||
const route = useRoute() | ||
const versions = ref([]); | ||
const currentVersion = ref('Versions'); | ||
const waitForGlobalDocumenterVars = () => { | ||
return new Promise((resolve) => { | ||
const checkInterval = setInterval(() => { | ||
if (window.DOC_VERSIONS && window.DOCUMENTER_CURRENT_VERSION) { | ||
clearInterval(checkInterval); | ||
resolve({ | ||
versions: window.DOC_VERSIONS, | ||
currentVersion: window.DOCUMENTER_CURRENT_VERSION | ||
}); | ||
} | ||
}, 100); // Check every 100ms | ||
}); | ||
}; | ||
onMounted(async () => { | ||
const globalvars = await waitForGlobalDocumenterVars(); | ||
versions.value = globalvars.versions.map((v) => { | ||
return { text: v, link: `${window.location.origin}/${v}/` } | ||
}); | ||
currentVersion.value = globalvars.currentVersion; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<VPNavBarMenuGroup v-if="!screenMenu" :item="{ text: currentVersion, items: versions }" class="VPVersionPicker" /> | ||
<VPNavScreenMenuGroup v-else :text="currentVersion" :items="versions" class="VPVersionPicker" /> | ||
</template> | ||
|
||
<style scoped> | ||
.VPVersionPicker :deep(button .text) { | ||
color: var(--vp-c-text-1) !important; | ||
} | ||
.VPVersionPicker:hover :deep(button .text) { | ||
color: var(--vp-c-text-2) !important; | ||
} | ||
</style> |
Oops, something went wrong.