-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
711 additions
and
186 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
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,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
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,66 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' | ||
import mathjax3 from "markdown-it-mathjax3"; | ||
import footnote from "markdown-it-footnote"; | ||
|
||
const navTemp = { | ||
nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS', | ||
} | ||
|
||
const nav = [ | ||
...navTemp.nav, | ||
{ text: 'Benchmarks', link: 'https://qutip.org/QuantumToolbox.jl/benchmarks/' }, | ||
{ | ||
component: 'VersionPicker' | ||
} | ||
] | ||
|
||
// 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, | ||
|
||
// options for @mdit-vue/plugin-toc | ||
// https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc#options | ||
toc: { level: [1, 2] }, | ||
|
||
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, | ||
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://documenter.juliadocs.org/stable/" target="_blank"><strong>Documenter.jl</strong></a>, <a href="https://vitepress.dev" target="_blank"><strong>VitePress</strong></a> and <a href="https://luxdl.github.io/DocumenterVitepress.jl/stable" target="_blank"><strong>DocumenterVitepress.jl</strong></a><br>Released under the BSD 3-Clause License. Powered by the <a href="https://www.julialang.org" target="_blank">Julia Programming Language</a>.<br>', | ||
copyright: `© Copyright ${new Date().getUTCFullYear()} <a href="https://qutip.org/" target="_blank"><strong>QuTiP.org</strong></a>.` | ||
} | ||
} | ||
}) |
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,64 @@ | ||
<!-- 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.