diff --git a/.gitignore b/.gitignore index b186e94..c62e6a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist .vitepress/@slidev +.vitepress/cache diff --git a/.npmrc b/.npmrc index bf2e764..cf04042 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ shamefully-hoist=true +strict-peer-dependencies=false diff --git a/.vitepress/config.js b/.vitepress/config.ts similarity index 51% rename from .vitepress/config.js rename to .vitepress/config.ts index 8690db6..94a2839 100644 --- a/.vitepress/config.js +++ b/.vitepress/config.ts @@ -1,6 +1,10 @@ -// @ts-check +import type { DefaultTheme } from 'vitepress' +import { defineConfig } from 'vitepress' +import { transformerTwoslash } from '@shikijs/vitepress-twoslash' -const Guide = [ +const CURRENT_VERSION = '0.48.0-beta.22' + +const Guide: DefaultTheme.NavItemWithLink[] = [ { text: 'Por que Slidev', link: '/guide/why', @@ -26,8 +30,25 @@ const Guide = [ link: '/guide/animations', }, { +<<<<<<< HEAD:.vitepress/config.js text: 'Exportando', link: '/guide/exporting', +======= + text: 'Draggable Elements', + link: '/guide/draggable', + }, + { + text: 'Presenter Mode', + link: '/guide/presenter-mode', + }, + { + text: 'Slides Overview', + link: '/guide/overview', + }, + { + text: 'Drawing & Annotations', + link: '/guide/drawing', +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, { text: 'Hospedagem Estática', @@ -55,7 +76,18 @@ const Guide = [ }, ] -const Theme = [ +const BuiltIn: DefaultTheme.NavItemWithLink[] = [ + { + text: 'Components', + link: '/builtin/components', + }, + { + text: 'Layouts', + link: '/builtin/layouts', + }, +] + +const Theme: (DefaultTheme.NavItemWithLink | DefaultTheme.NavItemChildren)[] = [ { text: 'Usar um Tema', link: '/themes/use', @@ -70,8 +102,9 @@ const Theme = [ }, ] -const Translations = [ +const Addon: DefaultTheme.NavItemWithLink[] = [ { +<<<<<<< HEAD:.vitepress/config.js text: 'Português (BR)', }, { @@ -105,10 +138,18 @@ const Translations = [ { text: 'Ελληνικά', link: 'https://el.sli.dev{{pathname}}', +======= + text: 'Use Addon', + link: '/addons/use', + }, + { + text: 'Write an Addon', + link: '/addons/write-an-addon', +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, ] -const Customizations = [ +const Customizations: (DefaultTheme.NavItemWithLink | DefaultTheme.NavItemChildren)[] = [ { text: 'Customizações', link: '/custom/', @@ -134,8 +175,13 @@ const Customizations = [ link: '/custom/config-vite', }, { +<<<<<<< HEAD:.vitepress/config.js text: 'Configurar Windi CSS', link: '/custom/config-windicss', +======= + text: 'Configure UnoCSS', + link: '/custom/config-unocss', +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, { text: 'Configurar Monaco', @@ -150,20 +196,44 @@ const Customizations = [ link: '/custom/config-mermaid', }, { +<<<<<<< HEAD:.vitepress/config.js text: 'Configurar Atalhos', link: '/custom/config-shortcuts', }, { text: 'Contexto Global do Vue', +======= + text: 'Configure Parser', + link: '/custom/config-parser', + }, + { + text: 'Configure Routes', + link: '/custom/config-routes', + }, + { + text: 'Configure Shortcuts', + link: '/custom/config-shortcuts', + }, + { + text: 'Configure Code Runners', + link: '/custom/config-code-runners', + }, + { + text: 'Configure Context Menu', + link: '/custom/config-context-menu', + }, + { + text: 'Vue Global Context', +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts link: '/custom/vue-context', }, { text: 'Camadas Globais', link: '/custom/global-layers', - } + }, ] -const Resources = [ +const Resources: DefaultTheme.NavItemWithLink[] = [ { text: 'Galeria', link: '/showcases', @@ -178,8 +248,9 @@ const Resources = [ }, ] -const slidebars = [ +const slidebars: DefaultTheme.SidebarItem[] = [ { +<<<<<<< HEAD:.vitepress/config.js text: 'Guia', children: Guide, }, @@ -203,13 +274,34 @@ const slidebars = [ link: '/builtin/layouts', }, ], +======= + text: 'Guide', + items: Guide, + }, + { + text: 'Themes', + items: Theme, + }, + { + text: 'Addons', + items: Addon, + }, + { + text: 'Customizations', + items: Customizations, + }, + { + text: 'Built-in', + items: BuiltIn, + }, + { + text: 'Resources', + items: Resources, +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, ] -/** - * @type {import('vitepress').UserConfig} - */ -module.exports = { +export default defineConfig({ title: 'Slidev', description: 'Apresentação de slides para desenvolvedores', head: [ @@ -225,9 +317,27 @@ module.exports = { ['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.gstatic.com' }], ['link', { href: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@200;400;500&family=Inter:wght@200;400;500;600', rel: 'stylesheet' }], ], + markdown: { + theme: { + light: 'vitesse-light', + dark: 'vitesse-dark', + }, + async shikiSetup(shiki) { + await shiki.loadLanguage( + 'html', + 'xml', + 'vue', + 'markdown', + ) + }, + codeTransformers: [ + transformerTwoslash(), + ], + }, + cleanUrls: true, themeConfig: { - repo: 'slidevjs/docs', logo: '/logo.svg', +<<<<<<< HEAD:.vitepress/config.js docsBranch: 'main', editLinks: true, editLinkText: 'Sugerir mudanças à essa página', @@ -239,6 +349,15 @@ module.exports = { // for translations maintainers: change the filter to your locale code (subdomain name) facetFilters: ['language:br'] } +======= + editLink: { + pattern: 'https://github.com/slidevjs/slidev/edit/main/docs/:path', + text: 'Suggest changes to this page', + }, + + search: { + provider: 'local', +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, nav: [ @@ -247,30 +366,112 @@ module.exports = { items: Guide, }, { +<<<<<<< HEAD:.vitepress/config.js text: 'Temas', items: Theme, }, { text: 'Customizações', items: Customizations, +======= + text: 'Theme', + items: [ + ...Theme, + { + text: 'Built-in', + items: BuiltIn, + }, + ], + }, + { + text: 'Customize', + items: [ + ...Customizations, + { + text: 'Addon', + items: Addon, + }, + ], +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, { text: 'Recursos', items: Resources, }, { +<<<<<<< HEAD:.vitepress/config.js text: 'Português (BR)', items: Translations, +======= + text: `v${CURRENT_VERSION}`, + items: [ + { text: 'Release Notes', link: 'https://github.com/slidevjs/slidev/releases' }, + ], +>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3:.vitepress/config.ts }, ], + socialLinks: [ + { icon: 'github', link: 'https://github.com/slidevjs/slidev' }, + { icon: 'twitter', link: 'https://twitter.com/slidevjs' }, + { icon: 'discord', link: 'https://chat.sli.dev' }, + ], + sidebar: { '/guide/': slidebars, '/themes/': slidebars, + '/addons/': slidebars, '/custom/': slidebars, '/builtin/': slidebars, '/resources/': slidebars, '/': slidebars, }, + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2020 Anthony Fu.', + }, + }, + + locales: { + root: { + label: 'English', + }, + zh: { + label: '简体中文', + link: 'https://cn.sli.dev/', + }, + fr: { + label: 'Français', + link: 'https://fr.sli.dev/', + }, + es: { + label: 'Español', + link: 'https://es.sli.dev/', + }, + ru: { + label: 'Русский', + link: 'https://ru.sli.dev/', + }, + vn: { + label: 'Việt Nam', + link: 'https://vn.sli.dev/', + }, + de: { + label: 'Deutsch', + link: 'https://de.sli.dev/', + }, + br: { + label: 'Português (BR)', + link: 'https://br.sli.dev/', + }, + el: { + label: 'Ελληνικά', + link: 'https://el.sli.dev/', + }, + ja: { + label: '日本語', + link: 'https://ja.sli.dev/', + }, }, -} +}) diff --git a/.vitepress/scripts/prepare.js b/.vitepress/scripts/prepare.js index c0e13b3..661b2a1 100644 --- a/.vitepress/scripts/prepare.js +++ b/.vitepress/scripts/prepare.js @@ -1,8 +1,8 @@ -const fs = require('fs-extra') +import { copy, remove } from 'fs-extra' -async function main(){ - await fs.remove('.vitepress/@slidev') - await fs.copy('node_modules/@slidev', '.vitepress/@slidev', { dereference: true }) +async function main() { + await remove('.vitepress/@slidev') + await copy('node_modules/@slidev', '.vitepress/@slidev', { dereference: true }) } main() diff --git a/.vitepress/showcases.ts b/.vitepress/showcases.ts index dd7136b..497c1b0 100644 --- a/.vitepress/showcases.ts +++ b/.vitepress/showcases.ts @@ -20,8 +20,8 @@ export const showcases: ShowCaseInfo[] = [ name: 'Anthony Fu', link: 'https://github.com/antfu', }, - slidesLink: 'https://sli.dev/demo/composable-vue', - sourceLink: 'https://github.com/antfu/talks/tree/master/2021-04-29', + slidesLink: 'https://talks.antfu.me/2021/composable-vue/', + sourceLink: 'https://github.com/antfu/talks/tree/main/2021-04-29', at: 'VueDay 2021', datetime: '2021-04-29', }, @@ -49,29 +49,29 @@ export const showcases: ShowCaseInfo[] = [ at: 'Enter.js Vue Day', datetime: '2021-06-15', }, - { - title: 'Simply Publish Your Package to npm', - author: { - name: 'Lucky Dewa Satria', - link: 'https://github.com/lucky401', - }, - at: 'Weekly sharing', - slidesLink: 'https://masukin.link/talks/simply-publish-your-package-to-npm', - cover: 'https://masukin.link/talks-cover-npm.png', - datetime: '2021-06-12', - }, - { - title: 'Create Icon Package With Vue and Rollup', - author: { - name: 'Lucky Dewa Satria', - link: 'https://github.com/lucky401', - }, - at: 'Weekly Sharing', - slidesLink: 'https://masukin.link/talks/create-icon-package-with-vue-and-rollup', - sourceLink: 'https://github.com/lucky401/Create-Icon-Package-With-Vue-and-Rollup', - cover: 'https://masukin.link/talks-cover-create-icon-package-with-vue-and-rollup.png', - datetime: '2021-06-19', - }, + // { + // title: 'Simply Publish Your Package to npm', + // author: { + // name: 'Lucky Dewa Satria', + // link: 'https://github.com/lucky401', + // }, + // at: 'Weekly sharing', + // slidesLink: 'https://masukin.link/talks/simply-publish-your-package-to-npm', + // cover: 'https://masukin.link/talks-cover-npm.png', + // datetime: '2021-06-12', + // }, + // { + // title: 'Create Icon Package With Vue and Rollup', + // author: { + // name: 'Lucky Dewa Satria', + // link: 'https://github.com/lucky401', + // }, + // at: 'Weekly Sharing', + // slidesLink: 'https://masukin.link/talks/create-icon-package-with-vue-and-rollup', + // sourceLink: 'https://github.com/lucky401/Create-Icon-Package-With-Vue-and-Rollup', + // cover: 'https://masukin.link/talks-cover-create-icon-package-with-vue-and-rollup.png', + // datetime: '2021-06-19', + // }, { title: 'BeAPT', author: { @@ -108,6 +108,112 @@ export const showcases: ShowCaseInfo[] = [ at: 'Thoughtworks Internal Lunch & Learn', datetime: '2021-11-12', }, + { + title: 'Git\'s Most Wanted', + cover: 'https://cdn.jsdelivr.net/gh/alexanderdavide/git-most-wanted@assets/slides-export/01.png', + author: { + name: 'Alexander Eble', + link: 'https://github.com/alexanderdavide', + }, + slidesLink: 'https://alexeble.de/talks/git-most-wanted/', + sourceLink: 'https://github.com/alexanderdavide/git-most-wanted', + at: 'Internal Tech Talk', + datetime: '2022-03-11', + }, + { + title: 'OpenFunction 202', + cover: 'https://s2.loli.net/2022/05/22/4zsCnkQRFoAU1E5.png', + author: { + name: 'Haili Zhang', + link: 'https://github.com/webup', + }, + slidesLink: 'https://openfunction-talks.netlify.app/2022/202-node-async/', + sourceLink: 'https://github.com/webup/openfunction-talks/tree/main/202-node-async', + at: 'OpenFunction Tutorial Sharing', + datetime: '2022-05-08', + }, + { + title: 'Is it Okay to Pursue Functional Programming on Frontend?', + author: { + name: 'Minsu Kim , Changhui Lee', + }, + at: '2022 JSConf Korea', + slidesLink: 'https://moonlit-nougat-422445.netlify.app/1', + sourceLink: 'https://github.com/alstn2468/2022-jsconf-presentation', + cover: 'https://raw.githubusercontent.com/alstn2468/2022-jsconf-presentation/main/public/images/og.png', + datetime: '2022-09-16', + }, + { + title: 'Blazing slidev ppt template with naive-ui', + author: { + name: 'godkun', + }, + at: 'personal sharing', + slidesLink: 'https://ppt.godkun.top', + sourceLink: 'https://github.com/godkun/ppt-template', + cover: 'https://github.com/godkun/ppt-template/raw/main/public/show.gif', + datetime: '2022-10-24', + }, + { + title: 'Building a Polite Popup with Nuxt 3', + author: { + name: 'Michael Hoffmann', + link: 'https://github.com/mokkapps', + }, + at: 'Vue.js Nation 2023', + slidesLink: 'https://vuejsnation-2023-talk-polite-popup.netlify.app', + sourceLink: 'https://github.com/Mokkapps/vuejsnation-2023-lightning-talk-polite-popup-nuxt-3-slides', + cover: 'https://raw.githubusercontent.com/Mokkapps/vuejsnation-2023-lightning-talk-polite-popup-nuxt-3-slides/main/screenshots/001.png', + datetime: '2023-01-25', + }, + { + title: 'Dev Environment as Code', + cover: 'https://cdn.jsdelivr.net/gh/alexanderdavide/dev-environment-as-code@assets/slides-export/001.png', + author: { + name: 'Alexander Eble', + link: 'https://github.com/alexanderdavide', + }, + slidesLink: 'https://alexeble.de/talks/dev-environment-as-code/', + sourceLink: 'https://github.com/alexanderdavide/dev-environment-as-code', + at: 'Internal Tech Talk', + datetime: '2022-12-01', + }, + { + title: 'Exploring Social Engineering', + cover: 'https://raw.githubusercontent.com/zyf722/exploring-social-engineering-slides/main/assets/Screenshot_Cover.png', + author: { + name: 'zyf722', + link: 'https://github.com/zyf722', + }, + slidesLink: 'https://zyf722.github.io/exploring-social-engineering-slides/', + sourceLink: 'https://github.com/zyf722/exploring-social-engineering-slides', + at: 'Presentation on Social Engineering in Computers in Society class', + datetime: '2023-10-20', + }, + { + title: 'Diablo Health Orb Shader', + author: { + name: 'SuneBear', + link: 'https://github.com/sunebear', + }, + at: 'rctAI Sessions', + slidesLink: 'https://rct-ai.github.io/frontend-slides/diablo-health-orb-shader/', + sourceLink: 'https://github.com/rct-ai/frontend-slides', + cover: 'https://github-production-user-asset-6210df.s3.amazonaws.com/7693264/284304324-db973b4c-a043-4644-932c-826169a1b4d8.gif', + datetime: '2022-09-01', + }, + { + title: 'How Rust error handling ease web development', + author: { + name: 'Nguyễn Hồng Quân', + link: 'https://quan.hoabinh.vn', + }, + at: 'FOSSASIA Summit 2024', + slidesLink: 'https://talk.quan.hoabinh.vn/rust-error-handling-ease-web-dev/', + sourceLink: 'https://hongquan@bitbucket.org/hongquan/rust-error-handling-ease-web-dev.git', + cover: 'https://i.imgur.com/2eBJofY.png', + datetime: '2024-04-10', + }, // Add yours here! { title: 'Yours?', @@ -117,6 +223,6 @@ export const showcases: ShowCaseInfo[] = [ at: 'Submit your talk/presentation to be list here!', slidesLink: 'https://github.com/slidevjs/docs/edit/main/.vitepress/showcases.ts', cover: `${import.meta.env.BASE_URL}theme-placeholder.png`, - datetime: '2021-04-29', + datetime: '2020-1-1', }, -] +].sort((a, b) => new Date(b.datetime).getTime() - new Date(a.datetime).getTime()) diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue deleted file mode 100644 index 4e72fba..0000000 --- a/.vitepress/theme/Layout.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - diff --git a/.vitepress/theme/NotFound.vue b/.vitepress/theme/NotFound.vue deleted file mode 100644 index 999af58..0000000 --- a/.vitepress/theme/NotFound.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/.vitepress/theme/components/AlgoliaSearchBox.vue b/.vitepress/theme/components/AlgoliaSearchBox.vue deleted file mode 100644 index 3961a51..0000000 --- a/.vitepress/theme/components/AlgoliaSearchBox.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/.vitepress/theme/components/BooleanDisplay.vue b/.vitepress/theme/components/BooleanDisplay.vue deleted file mode 100644 index 3aa15b7..0000000 --- a/.vitepress/theme/components/BooleanDisplay.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/.vitepress/theme/components/DarkModeSwitch.vue b/.vitepress/theme/components/DarkModeSwitch.vue deleted file mode 100644 index a3c39a0..0000000 --- a/.vitepress/theme/components/DarkModeSwitch.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/.vitepress/theme/components/demo/Demo.vue b/.vitepress/theme/components/Demo.vue similarity index 78% rename from .vitepress/theme/components/demo/Demo.vue rename to .vitepress/theme/components/Demo.vue index e4532bf..32a97a8 100644 --- a/.vitepress/theme/components/demo/Demo.vue +++ b/.vitepress/theme/components/Demo.vue @@ -1,18 +1,23 @@ diff --git a/.vitepress/theme/components/DemoEditor.vue b/.vitepress/theme/components/DemoEditor.vue new file mode 100644 index 0000000..9abb5b5 --- /dev/null +++ b/.vitepress/theme/components/DemoEditor.vue @@ -0,0 +1,39 @@ + + + diff --git a/.vitepress/theme/components/demo/DemoSlide.vue b/.vitepress/theme/components/DemoSlide.vue similarity index 59% rename from .vitepress/theme/components/demo/DemoSlide.vue rename to .vitepress/theme/components/DemoSlide.vue index 3aa68be..4ba7c28 100644 --- a/.vitepress/theme/components/demo/DemoSlide.vue +++ b/.vitepress/theme/components/DemoSlide.vue @@ -1,21 +1,26 @@ - diff --git a/.vitepress/theme/components/EditLink.vue b/.vitepress/theme/components/EditLink.vue deleted file mode 100644 index 7504e01..0000000 --- a/.vitepress/theme/components/EditLink.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/.vitepress/theme/components/Environment.vue b/.vitepress/theme/components/Environment.vue index a4291be..7138b8b 100644 --- a/.vitepress/theme/components/Environment.vue +++ b/.vitepress/theme/components/Environment.vue @@ -1,10 +1,9 @@