Skip to content

Commit 6c66da9

Browse files
committed
feat!: sphinx-in-browser and nuxt 4 version
# Conflicts: # public/index.html # src/main.js
1 parent bceaa4d commit 6c66da9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+11961
-33572
lines changed

.browserslistrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Sample workflow for building and deploying a site to GitHub Pages
2-
name: Deploy web with GitHub Pages
1+
name: Deploy to GitHub Pages
32

43
on:
54
# Runs on pushes targeting the default branch
@@ -22,7 +21,6 @@ concurrency:
2221
cancel-in-progress: false
2322

2423
jobs:
25-
# Build job
2624
build:
2725
runs-on: ubuntu-latest
2826
steps:
@@ -31,27 +29,21 @@ jobs:
3129
- name: Setup Node
3230
uses: actions/setup-node@v4
3331
with:
34-
node-version: 20
32+
# Use the same value as package.json's engines.node
33+
node-version: 22.16.0
3534
- name: Install Node dependencies
3635
run: npm ci
3736
- name: Build
38-
run: |
39-
export NODE_OPTIONS=--openssl-legacy-provider
40-
export VUE_APP_API_BASE_URL=https://snippets-api.documatt.com/api/v1
41-
export VUE_APP_RUNNING_ENV=prod
42-
npm run build
37+
run: npm run generate
4338
- name: Upload artifact
4439
uses: actions/upload-pages-artifact@v3
4540
with:
4641
# Artifact name
4742
# name: # optional, default is github-pages
4843
# Path of the directory containing the static assets.
4944
# default is _site/
50-
path: dist
51-
# Duration after which artifact will expire in days.
52-
# retention-days: # optional, default is 1
45+
path: ./.output/public
5346

54-
# Deployment job
5547
deploy:
5648
environment:
5749
name: github-pages

.gitignore

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
.DS_Store
2-
node_modules
3-
/dist
4-
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
58

6-
# local env files
7-
.env.local
8-
.env.*.local
9+
# Node dependencies
10+
node_modules
911

10-
# Log files
11-
npm-debug.log*
12-
yarn-debug.log*
13-
yarn-error.log*
14-
pnpm-debug.log*
12+
# Logs
13+
logs
14+
*.log
1515

16-
# Editor directories and files
16+
# Misc
17+
.DS_Store
18+
.fleet
1719
.idea
18-
.vscode
19-
*.suo
20-
*.ntvs*
21-
*.njsproj
22-
*.sln
23-
*.sw?
2420

25-
todo
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example

.gitlab-ci.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/app.vue

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div class="flex flex-col h-screen">
3+
<!-- header -->
4+
<div><Header /></div>
5+
<!-- editor, preview, console -->
6+
<div class="border-b border-t border-slate-300 h-full overflow-y-auto">
7+
<splitpanes vertical class="default-theme">
8+
<pane size="50" min-size="20" class="p-2">
9+
<EditorPane />
10+
</pane>
11+
<pane size="50" min-size="20" class="p-2"><PreviewPane /></pane>
12+
</splitpanes>
13+
</div>
14+
<!-- Footer -->
15+
<div><Footer /></div>
16+
</div>
17+
</template>
18+
19+
<script lang="ts" setup>
20+
import { Splitpanes, Pane } from "splitpanes";
21+
import "splitpanes/dist/splitpanes.css";
22+
23+
// For performance, SEO meta tags will only be added during server-side rendering
24+
if (import.meta.server) {
25+
useSeoMeta({
26+
title:
27+
"Documatt Snippets - Sphinx reStucturedText and Markdown online preview and editor",
28+
ogTitle: "Sphinx reStucturedText and Markdown online preview and editor",
29+
description:
30+
"Preview and edit reStructuredText or Markdown (MyST) documents online with Sphinx and Docutils without installing it.",
31+
ogDescription:
32+
"Preview and edit reStructuredText or Markdown (MyST) documents online with Sphinx and Docutils without installing it.",
33+
ogImage: "/images/og_image.png",
34+
twitterCard: "summary_large_image",
35+
});
36+
}
37+
38+
// Boot Sphinx
39+
const previewStore = usePreviewStore();
40+
onMounted(() => {
41+
previewStore.bootPreview();
42+
});
43+
</script>
44+
45+
<style lang="css">
46+
.default-theme.splitpanes .splitpanes__pane {
47+
background-color: transparent;
48+
}
49+
.default-theme.splitpanes .splitpanes__splitter:before,
50+
.default-theme.splitpanes .splitpanes__splitter:after {
51+
background-color: var(--color-slate-400);
52+
}
53+
.default-theme.splitpanes--vertical > .splitpanes__splitter,
54+
.default-theme .splitpanes--vertical > .splitpanes__splitter {
55+
border-left: 1px solid var(--color-slate-300);
56+
}
57+
</style>
7.32 KB
Binary file not shown.

app/assets/styles/main.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import "./sphinx-preview.css";
2+
@import "tailwindcss";
3+
@plugin "@tailwindcss/typography";
4+
@plugin "daisyui";
5+
6+
:root {
7+
/* No font import from Google because Nuxt Fonts will download and cache it automatically */
8+
font-family: Rubik, sans-serif;
9+
}

0 commit comments

Comments
 (0)