diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index b525c011..861a5379 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -48,4 +48,5 @@ jobs: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key GKSwstype: "100" # for Plots.jl plots (if you have them) JULIA_DEBUG: "Documenter" + DEBUG: true DATADEPS_ALWAYS_ACCEPT: true diff --git a/docs/package.json b/docs/package.json index 71458cb5..dc71fad5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,10 +1,9 @@ { "devDependencies": { - "markdown-it": "^14.0.0", + "markdown-it": "^14.1.0", "markdown-it-mathjax3": "^4.3.2", - "vitepress": "^1.0.0-rc.43", - "vitepress-plugin-tabs": "^0.5.0", - "vitest": "^1.3.0" + "vitepress": "^1.0.2", + "vitepress-plugin-tabs": "^0.5.0" }, "scripts": { "docs:dev": "vitepress dev build/.documenter", @@ -12,7 +11,6 @@ "docs:preview": "vitepress preview build/.documenter" }, "dependencies": { - "@shikijs/transformers": "^1.1.7", "markdown-it-footnote": "^4.0.0" } } diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts index e03cd3b9..c001ce84 100644 --- a/docs/src/.vitepress/config.mts +++ b/docs/src/.vitepress/config.mts @@ -2,17 +2,15 @@ import { defineConfig } from 'vitepress' import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' import mathjax3 from "markdown-it-mathjax3"; import footnote from "markdown-it-footnote"; -import { transformerMetaWordHighlight } from '@shikijs/transformers'; // 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', + title: 'DocumenterVitepress', + description: 'Document your code', 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' }]], markdown: { math: true, @@ -25,13 +23,11 @@ export default defineConfig({ light: "github-light", dark: "github-dark" }, - codeTransformers: [ transformerMetaWordHighlight(), ], - }, themeConfig: { outline: 'deep', // https://vitepress.dev/reference/default-theme-config - logo: 'REPLACE_ME_DOCUMENTER_VITEPRESS', + logo: { src: '/logo.png', width: 24, height: 24 }, search: { provider: 'local', options: { @@ -46,7 +42,13 @@ export default defineConfig({ { text: 'API', link: '/api' } ], - sidebar: 'REPLACE_ME_DOCUMENTER_VITEPRESS', + sidebar: [ + { text: 'Home', link: '/' }, + { text: 'Getting Started', link: '/getting_started' }, + { text: 'Markdown', link: '/markdown-examples' }, + { text: 'Code', link: '/code_example' }, + { text: 'API', link: '/api' } + ], editLink: 'REPLACE_ME_DOCUMENTER_VITEPRESS', socialLinks: [ { icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' } diff --git a/docs/src/.vitepress/theme/index.ts b/docs/src/.vitepress/theme/index.ts index 5ac1c911..86e5219a 100644 --- a/docs/src/.vitepress/theme/index.ts +++ b/docs/src/.vitepress/theme/index.ts @@ -1,21 +1,13 @@ // .vitepress/theme/index.ts -import { h } from 'vue' import type { Theme } from 'vitepress' import DefaultTheme from 'vitepress/theme' -import AsideTrustees from '../../components/AsideTrustees.vue' import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' import './style.css' export default { extends: DefaultTheme, - Layout() { - return h(DefaultTheme.Layout, null, { - // 'home-hero-info-after': () => h(HomeTrustees), - 'aside-ads-before': () => h(AsideTrustees), - }) - }, - enhanceApp({ app, router, siteData }) { + enhanceApp({ app }) { enhanceAppWithTabs(app) } -} satisfies Theme \ No newline at end of file +} satisfies Theme diff --git a/docs/src/.vitepress/theme/style.css b/docs/src/.vitepress/theme/style.css index af3f2e43..e25a5642 100644 --- a/docs/src/.vitepress/theme/style.css +++ b/docs/src/.vitepress/theme/style.css @@ -15,37 +15,37 @@ https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/var } /* Fonts */ - +/* @font-face { font-family: JuliaMono-Regular; src: url("https://cdn.jsdelivr.net/gh/cormullion/juliamono/webfonts/JuliaMono-Regular.woff2"); -} +} */ :root { /* Typography */ - --vp-font-family-base: "Barlow", "Inter var experimental", "Inter var", + --vp-font-family-base: "Inter", "Inter var experimental", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; /* Code Snippet font */ - --vp-font-family-mono: JuliaMono-Regular, monospace; + --vp-font-family-mono: "Fira Code", monospace; } -.mono { +/* .mono { */ /* Disable contextual alternates (kind of like ligatures but different) in monospace, which turns `/>` to an up arrow and `|>` (the Julia pipe symbol) to an up arrow as well. This is pretty bad for Julia folks reading even though copy+paste retains the same text. */ - font-feature-settings: 'calt' 0; - pre { + /* font-feature-settings: 'calt' 0; */ + /* pre { font-family: JuliaMono-Light; }; code { font-family: JuliaMono-Light; - }; -} + }; */ +/* } */ /* Colors */ diff --git a/docs/src/index.md b/docs/src/index.md index 23d0533a..513bf01d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -23,39 +23,14 @@ hero: features: - - icon: markdown - title: Markdown + - title: Markdown details: Write in standard markdown syntax link: /markdown-examples - - icon: - title: Literate.jl + - title: Literate.jl details: Parse scripts into markdown via Literate.jl link: https://github.com/fredrikekre/Literate.jl - - icon: - title: VUE components + - title: VUE components details: Explore the possibilities with VUE components link: https://vuejs.org/guide/essentials/component-basics --- -``` - -```@raw html -

- -
- -

What is DocumenterVitepress.jl?

- -DocumenterVitepress is a Markdown backend for Documenter.jl which is designed to work with the [`VitePress`](https://vitepress.dev/) site generator, which is built off `Vue.js`. - -It is meant to be used in conjunction with the `vitepress` Node.js package, which is why so much customization is required! - -

Basic usage

- -If you copy the contents of the `template/` directory into your `docs/` and the `.github/Documenter.yml` file to your repo, you should be good to go and edit docs as usual! - -Just remember to edit the navbar in `docs/src/.vitepress/config.mts`, if you want it to be different from the sidebar. - -To install a logo or favicon, you can put `logo.png` and `favicon.ico` in `docs/src/assets`, and they will be automatically detected. - -
``` \ No newline at end of file diff --git a/template/src/.vitepress/theme/index.ts b/template/src/.vitepress/theme/index.ts index 463b5d85..d93a3863 100644 --- a/template/src/.vitepress/theme/index.ts +++ b/template/src/.vitepress/theme/index.ts @@ -1,5 +1,4 @@ // .vitepress/theme/index.ts -import { h } from 'vue' import type { Theme } from 'vitepress' import DefaultTheme from 'vitepress/theme' @@ -8,12 +7,7 @@ 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 }) { + enhanceApp({ app }) { enhanceAppWithTabs(app) } } satisfies Theme \ No newline at end of file