From f2b0f25a34ad8b28726a13aa2207519b03fdf185 Mon Sep 17 00:00:00 2001 From: Lazaro Alonso Date: Tue, 26 Dec 2023 18:18:18 +0100 Subject: [PATCH] deploy? --- .github/workflows/Documenter.yml | 59 ----------------------- .github/workflows/deployDocs.yml | 75 +++++++++++++++++++++++++++++ docs/package.json | 7 --- docs/src/.vitepress/config.mts | 8 +-- docs/src/.vitepress/theme/style.css | 55 ++++++++++++++++----- docs/src/api-examples.md | 52 ++++---------------- docs/src/index.md | 18 +++---- package.json | 7 +++ 8 files changed, 147 insertions(+), 134 deletions(-) delete mode 100644 .github/workflows/Documenter.yml create mode 100644 .github/workflows/deployDocs.yml delete mode 100644 docs/package.json create mode 100644 package.json diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml deleted file mode 100644 index 92331d91..00000000 --- a/.github/workflows/Documenter.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Documenter -on: - push: - branches: - - master - tags: '*' - pull_request: - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} -jobs: - build: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: julia-actions/setup-julia@v1 - - uses: julia-actions/cache@v1 - - uses: actions/configure-pages@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: npm # or pnpm / yarn - cache-registries: "false" - - name: Install dependencies - run: npm ci # or pnpm install / yarn install / bun install - - name: Install documentation dependencies - run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key - JULIA_DEBUG: "Documenter" - DATADEPS_ALWAYS_ACCEPT: true - run: | - julia --project=docs/ --color=yes docs/make.jl - npm --prefix /docs/ run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build - touch docs/docs/.vitepress/dist/.nojekyll - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: docs/docs/.vitepress/dist - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - needs: build - runs-on: ubuntu-latest - name: Deploy - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/deployDocs.yml b/.github/workflows/deployDocs.yml new file mode 100644 index 00000000..1e8db54c --- /dev/null +++ b/.github/workflows/deployDocs.yml @@ -0,0 +1,75 @@ +# Sample workflow for building and deploying a VitePress site to GitHub Pages +# +name: Deploy VitePress site to Pages + +on: + # Runs on pushes targeting the `main` branch. Change this to `master` if you're + # using the `master` branch as the default branch. + push: + branches: [master] + + # 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: read + pages: write + id-token: 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@v3 + with: + fetch-depth: 0 # Not needed if lastUpdated is not enabled + # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm + # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun + - name: Julia version + uses: julia-actions/setup-julia@v1 + - name: Julia cache + uses: julia-actions/cache@v1 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm # or pnpm / yarn + cache-dependency-path: 'package.json' # this should be a package-lock.json file + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Install dependencies + run: npm add -D vitepress # or pnpm install / yarn install / bun install + - name: Install documentation dependencies + run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate()' + - name: Creating docs/docs folder + run: julia --project=docs/ --color=yes docs/make.jl + - name: Build and deploy with VitePress + run: | + npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build + touch docs/docs/.vitepress/dist/.nojekyll + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: docs/docs/.vitepress/dist + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/docs/package.json b/docs/package.json deleted file mode 100644 index 45e1db29..00000000 --- a/docs/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "scripts": { - "docs:dev": "vitepress dev docs", - "docs:build": "vitepress build docs", - "docs:preview": "vitepress preview docs" - } -} \ No newline at end of file diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts index b71ecc0b..89dd426d 100644 --- a/docs/src/.vitepress/config.mts +++ b/docs/src/.vitepress/config.mts @@ -3,7 +3,7 @@ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' // https://vitepress.dev/reference/site-config export default defineConfig({ - base: '/DocumenterVitepress/', + // base: '/DocumenterVitepress/', title: "DocumenterVitepress", description: "A VitePress Site", lastUpdated: true, @@ -41,11 +41,11 @@ export default defineConfig({ ], socialLinks: [ - { icon: 'github', link: 'https://github.com/vuejs/vitepress' } + { icon: 'github', link: 'https://github.com/LuxDL/DocumenterVitepress.jl' } ], footer: { - message: 'Made with Documenter.jl & VitePress
Released under the MIT License. Powered by the Julia Programming Language.', - copyright: 'Copyright © 2023-present LuxDL' + message: 'Made with Documenter.jl & VitePress
', + copyright: `© Copyright ${new Date().getUTCFullYear()}. Released under the MIT License.` } } }) diff --git a/docs/src/.vitepress/theme/style.css b/docs/src/.vitepress/theme/style.css index 74f1024c..ee9ae2b8 100644 --- a/docs/src/.vitepress/theme/style.css +++ b/docs/src/.vitepress/theme/style.css @@ -7,6 +7,20 @@ */ /** + +/** + * Layouts + * -------------------------------------------------------------------------- */ +/* + :root { + --vp-layout-max-width: 1440px; +} */ + +.VPHero .clip { + white-space: pre; + max-width: 500px; +} + * Fonts * -------------------------------------------------------------------------- */ @@ -32,12 +46,12 @@ --julia-green: #389826; --vp-c-brand: #389826; - --vp-c-brand-light: #a0a0ab; + --vp-c-brand-light: #e3e3f3; --vp-c-brand-lighter: #9499ff; --vp-c-brand-lightest: #bcc0ff; --vp-c-brand-dark: #535bf2; --vp-c-brand-darker: #454ce1; - --vp-c-brand-dimm: rgba(100, 108, 255, 0.08); + --vp-c-brand-dimm: #212425; } /** @@ -56,6 +70,7 @@ --vp-button-brand-active-bg: var(--vp-button-brand-bg); } + /** * Component: Home * -------------------------------------------------------------------------- */ @@ -70,8 +85,9 @@ --vp-home-hero-image-background-image: linear-gradient( -45deg, - #9558B2 50%, - #CB3C33 50% + #9558B2 30%, + #389826 30%, + #CB3C33 ); --vp-home-hero-image-filter: blur(40px); } @@ -92,16 +108,32 @@ * Component: Custom Block * -------------------------------------------------------------------------- */ -:root { - --vp-custom-block-tip-border: var(--vp-c-brand); - --vp-custom-block-tip-text: var(--vp-c-brand-darker); - --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); -} - -.dark { +:root.dark { --vp-custom-block-tip-border: var(--vp-c-brand); --vp-custom-block-tip-text: var(--vp-c-brand-lightest); --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); + + /* // Tweak the color palette for blacks and dark grays */ + --vp-c-black: hsl(220 20% 9%); + --vp-c-black-pure: hsl(220, 24%, 4%); + --vp-c-black-soft: hsl(220 16% 13%); + --vp-c-black-mute: hsl(220 14% 17%); + --vp-c-gray: hsl(220 8% 56%); + --vp-c-gray-dark-1: hsl(220 10% 39%); + --vp-c-gray-dark-2: hsl(220 12% 28%); + --vp-c-gray-dark-3: hsl(220 12% 23%); + --vp-c-gray-dark-4: hsl(220 14% 17%); + --vp-c-gray-dark-5: hsl(220 16% 13%); + + /* // Backgrounds */ + /* --vp-c-bg: hsl(240, 2%, 11%); */ + --vp-custom-block-info-bg: hsl(220 14% 17%); + /* --vp-c-gutter: hsl(220 20% 9%); + + --vp-c-bg-alt: hsl(220 20% 9%); + --vp-c-bg-soft: hsl(220 14% 17%); + --vp-c-bg-mute: hsl(220 12% 23%); + */ } /** @@ -112,7 +144,6 @@ --docsearch-primary-color: var(--vp-c-brand) !important; } - /** * Component: MathJax * -------------------------------------------------------------------------- */ diff --git a/docs/src/api-examples.md b/docs/src/api-examples.md index 1c6ec8a7..2029186f 100644 --- a/docs/src/api-examples.md +++ b/docs/src/api-examples.md @@ -4,48 +4,14 @@ outline: deep --- ``` -# Runtime API Examples - -This page demonstrates usage of some of the runtime APIs provided by VitePress. - -The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: - -```md - - -## Results - -### Theme Data -
{{ theme }}
- -### Page Data -
{{ page }}
- -### Page Frontmatter -
{{ frontmatter }}
+## Public API +```@meta +DocTestSetup= quote +using DocumenterVitepress +end ``` - - -## Results - -### Theme Data -
{{ theme }}
- -### Page Data -
{{ page }}
- -### Page Frontmatter -
{{ frontmatter }}
- -## More - -Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). +```@autodocs +Modules = [DocumenterVitepress] +Private = false +``` \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index 8e4a5c3d..72332873 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -4,9 +4,9 @@ layout: home hero: - name: "DocumenterVitePress" - text: "A Documenter.jl + VitePress Site" - tagline: My great project tagline + name: "DocumenterVitepress" + text: "Document your code" + tagline: A Markdown backend designed to work with VitePress image: src: /logo_dark.png alt: DocumenterVitepress @@ -22,12 +22,12 @@ hero: link: /api-examples features: - - title: Feature A - details: Lorem ipsum dolor sit amet, consectetur adipiscing elit - - title: Feature B - details: Lorem ipsum dolor sit amet, consectetur adipiscing elit - - title: Feature C - details: Lorem ipsum dolor sit amet, consectetur adipiscing elit + - title: Markdown + details: Write in standar markdown syntax + - title: Scripts + details: Parse scripts into markdown via Literate.jl + - title: VUE components + details: Explore the possibilities with VUE components --- ``` diff --git a/package.json b/package.json new file mode 100644 index 00000000..49b32a4d --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "scripts": { + "docs:dev": "vitepress dev docs/docs", + "docs:build": "vitepress build docs/docs", + "docs:preview": "vitepress preview docs/docs" + } +} \ No newline at end of file