Skip to content

Commit

Permalink
v1.9.1 release and some fixes in tests and docs files
Browse files Browse the repository at this point in the history
  • Loading branch information
TaTo30 committed Jan 3, 2024
1 parent b41f82b commit 1d17230
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
# deploy to gh-pages branch
target_branch: gh-pages
# deploy the default output dir of VuePress
# deploy the default output dir of VitePress
build_dir: docs/.vitepress/dist
env:
# @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width=250 src="./docs/.vuepress/public/logo.png" />
<img width=250 src="./docs/public/logo.png" />
<h1>VuePDF</h1>
</div>

Expand Down
54 changes: 26 additions & 28 deletions docs/examples/advanced/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,44 @@

```vue
<script setup>
import { ref, triggerRef, watchEffect } from 'vue';
import { ref, triggerRef, watchEffect } from 'vue'
import { VuePDF, usePDF } from '@tato30/vue-pdf';
import { withBase } from '@vuepress/client';
import ChaptersList from './ChaptersList.vue';
import { VuePDF, usePDF } from '@tato30/vue-pdf'
const { pdf, info, getPDFDestination } = usePDF(withBase('/example_045.pdf'))
const outlineTree = ref([])
import ChaptersList from './ChaptersList.vue'
watchEffect(() => {
if (info.value.outline !== undefined) {
outlineTree.value = info.value.outline.map(function convert(node) {
return {
title: node.title,
destination: getPDFDestination(info.value.document, node.dest),
items: node.items.map((item) => {
return convert(item)
}),
}
})
}
})
triggerRef(info)
const { pdf, info, getPDFDestination } = usePDF('/example_045.pdf')
const outlineTree = ref([])
function onChapterClick(value) {
value.then(v => {
console.log(v)
watchEffect(() => {
if (info.value.outline !== undefined) {
outlineTree.value = info.value.outline.map(function convert(node) {
return {
title: node.title,
destination: getPDFDestination(info.value.document, node.dest),
items: node.items.map((item) => {
return convert(item)
}),
}
})
}
})
triggerRef(info)
function onChapterClick(value) {
value.then((v) => {
console.log(v)
})
}
</script>
<template>
<div id="toc_wrapper">
<div class="toc">
<ChaptersList
:items="outlineTree"
@chapterClick="onChapterClick"
>
</ChaptersList>
:items="outlineTree"
@chapterClick="onChapterClick"
/>
</div>
<div class="container">
<VuePDF :pdf="pdf" />
Expand Down
19 changes: 0 additions & 19 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,3 @@ features:
- icon: 📖
title: Layers
details: Render text, annotation and XFA layers
# features:
# - title: Simplicity First
# details: Minimal setup with markdown-centered project structure helps you focus on writing.
# - title: Vue-Powered
# details: Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue.
# - title: Performant
# details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
# - title: Themes
# details: Providing a default theme out of the box. You can also choose a community theme or create your own one.
# - title: Plugins
# details: Flexible plugin API, allowing plugins to provide lots of plug-and-play features for your site.
# - title: Bundlers
# details: Default bundler is Vite, while Webpack is also supported. Choose the one you like!
# footer: MIT Licensed | Copyright © 2018-present Evan You
---
<!--
<ClientOnly>
<OnePage />
</ClientOnly> -->
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tato30/vue-pdf",
"version": "1.9.0",
"version": "1.9.1",
"description": "PDF viewer for Vue 3",
"author": {
"name": "Aldo Hernandez",
Expand Down
6 changes: 3 additions & 3 deletions tests/layers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { mount } from '@vue/test-utils'
import type { HighlightEventPayload } from '../src'
import { VuePDF, usePDF } from '../src'

import a14PDF from '../docs/.vuepress/public/example_014.pdf'
import a45PDF from '../docs/.vuepress/public/example_045.pdf'
import xfaPDF from '../docs/.vuepress/public/example_xfa.pdf'
import a14PDF from '../docs/public/example_014.pdf'
import a45PDF from '../docs/public/example_045.pdf'
import xfaPDF from '../docs/public/example_xfa.pdf'

describe('Text Layer', () => {
const { pdf } = usePDF(
Expand Down

0 comments on commit 1d17230

Please sign in to comment.