Skip to content

Commit

Permalink
Merge pull request #78 from TaTo30/vitepress
Browse files Browse the repository at this point in the history
Vitepress
  • Loading branch information
TaTo30 authored Jan 2, 2024
2 parents 94843ea + 1dff657 commit e172ed5
Show file tree
Hide file tree
Showing 37 changed files with 2,927 additions and 2,149 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ on:
push:
branches:
- 'master'
path:
- 'docs/**'
# trigger deployment manually
workflow_dispatch:
paths:
- 'docs/**/*'

jobs:
docs:
Expand All @@ -31,7 +29,7 @@ jobs:
run: npm install

# run build script
- name: Build VuePress site
- name: Build VitePress site
working-directory: docs
run: npm run docs:build

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ lerna-debug.log*

node_modules
.ghpages
.cache
.temp
cache
temp
.vscode
playground/pdf/*
playground/samples/*
Expand Down
196 changes: 196 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
import { version } from '../package.json'

export default {
title: 'VuePDF',
description: 'PDF Viewer for Vue 3',
base: '/VuePDF/',
lastUpdated: true,
themeConfig: {
logo: '/logo.png',
editLink: {
pattern: 'https://github.com/TaTo30/VuePDF/edit/master/docs/:path',
},
socialLinks: [
{
icon: 'github',
link: 'https://github.com/TaTo30/VuePDF',
},
],
search: {
provider: 'local',
},
nav: [
{
text: 'Guide',
link: '/guide/introduction.md',
},
{
text: 'Examples',
items: [
{
text: 'Basic usages',
link: '/examples/basic/one_page.md',
},
{
text: 'Advanced usages',
link: '/examples/advanced/fit_parent.md',
},
{
text: 'Events',
link: '/examples/loaded_events/loaded.md',
},
],
},
{
text: `v${version}`,
items: [
{
text: 'Changelog',
link: 'https://github.com/TaTo30/VuePDF/releases',
},
{
text: 'Contributing',
link: 'https://github.com/TaTo30/VuePDF#contributing',
},
],
},
],
sidebar: {
'/guide/': {
base: '/guide/',
items: [
{
text: 'Guide',
items: [
{
text: 'Introduction',
link: 'introduction',
},
{
text: 'Composables',
link: 'composables',
},
],
},
{
text: 'Reference',
items: [
{
text: 'Props',
link: 'props',
},
{
text: 'Events',
link: 'events',
},
{
text: 'Methods',
link: 'methods',
},
{
text: 'Slots',
link: 'slots',
},
],
},
],
},
'/examples/': {
items: [
{
text: 'Basic usages',
base: '/examples/basic/',
items: [
{
text: 'One Page',
link: 'one_page',
},
{
text: 'All Pages',
link: 'all_pages',
},
{
text: 'Scale',
link: 'scale',
},
{
text: 'Rotation',
link: 'rotation',
},
{
text: 'Text Layer',
link: 'text_layer',
},
{
text: 'Annotation Layer',
link: 'annotation_layer',
},
{
text: 'XFA Layer',
link: 'xfa_layer',
},
],
},
{
text: 'Advanced usages',
base: '/examples/advanced/',
items: [
{
text: 'Watermark',
link: 'watermark',
},
{
text: 'Highlight Text',
link: 'highlight_text',
},
{
text: 'Annotation Filter',
link: 'annotation_filter',
},
{
text: 'Multiple PDF',
link: 'multiple_pdf',
},
{
text: 'TOC',
link: 'toc',
},
],
},
{
text: 'Events',
base: '/examples/',
items: [
{
text: 'Loaded Event',
link: '/loaded_events/loaded',
},
{
text: 'Highlight Event',
link: '/text_events/text_highlight',
},
{
text: 'Annotation Events',
base: '/examples/annotation_events/',
items: [
{
text: 'Form fields',
link: 'annotation_forms',
},
{
text: 'Links',
link: 'annotation_links',
},
{
text: 'Attachment',
link: 'annotation_attachment',
},
],
},
],
},
],
},
},
},
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.button-example {
background-color: var(--c-brand);
background-color: var(--vp-c-brand-2);
color: white;
padding: 10px;
margin: 7px;
Expand All @@ -9,7 +9,7 @@
}

.button-example:hover {
background-color: var(--c-brand-light);
background-color: var(--vp-c-brand-1);
}

.checkbox-example {
Expand All @@ -27,19 +27,19 @@
}
.input-example:focus{
cursor: auto;
border-color: var(--search-accent-color);
border-color: var(--vp-c-brand-1);
}

.select-example {
background-color: var(--c-brand);
background-color: var(--vp-c-brand-2);
color: white;
padding: 10px;
margin: 7px;
border-radius: 4px;
border: none;
}

.container {
.vue-pdf-container {
display: flex;
align-items:center;
flex-direction: column
Expand Down
46 changes: 46 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import DefaultTheme from 'vitepress/theme'
import '../styles/index.scss'

import AllPages from '../../components/AllPages.vue'
import AnnoAttachment from '../../components/AnnoAttachment.vue'
import AnnoForms from '../../components/AnnoForms.vue'
import AnnoLinks from '../../components/AnnoLinks.vue'
import AnnotationFilter from '../../components/AnnotationFilter.vue'
import AnnotationLayer from '../../components/AnnotationLayer.vue'
import FitParent from '../../components/FitParent.vue'
import Loaded from '../../components/Loaded.vue'
import MultiplePDF from '../../components/MultiplePDF.vue'
import OnePage from '../../components/OnePage.vue'
import Rotation from '../../components/Rotation.vue'
import Scale from '../../components/Scale.vue'
import TextLayer from '../../components/TextLayer.vue'
import XFALayer from '../../components/XFALayer.vue'
import Watermark from '../../components/Watermark.vue'
import TOC from '../../components/TOC.vue'
import HighlightText from '../../components/HighlightText.vue'
import TextHighlight from '../../components/TextHighlight.vue'

/** @type {import('vitepress').Theme} */
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
app.component('OnePage', OnePage)
app.component('Watermark', Watermark)
app.component('AllPages', AllPages)
app.component('Scale', Scale)
app.component('Rotation', Rotation)
app.component('TextLayer', TextLayer)
app.component('AnnotationLayer', AnnotationLayer)
app.component('XFALayer', XFALayer)
app.component('FitParent', FitParent)
app.component('AnnotationFilter', AnnotationFilter)
app.component('MultiplePDF', MultiplePDF)
app.component('AnnoAttachment', AnnoAttachment)
app.component('AnnoForms', AnnoForms)
app.component('AnnoLinks', AnnoLinks)
app.component('Loaded', Loaded)
app.component('TOC', TOC)
app.component('HighlightText', HighlightText)
app.component('TextHighlight', TextHighlight)
},
}
1 change: 0 additions & 1 deletion docs/.vuepress/.gh-pages
Submodule .gh-pages deleted from b19e41
45 changes: 0 additions & 45 deletions docs/.vuepress/client.js

This file was deleted.

Loading

0 comments on commit e172ed5

Please sign in to comment.