Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge docs/main into docs-fr/main @ c608c011 #97

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a9706e0
docs: fix typos and tweak grammar (#94)
Oct 5, 2022
550ff2f
chore: update algolia component
antfu Oct 18, 2022
ecd8bf0
docs(search): correct credentials for docsearch (#95)
Haroenv Oct 18, 2022
7fa7d16
doc: add presenter notes export guide (#96)
lomby92 Oct 25, 2022
26a4550
docs: update for advanced navigation features (#79)
lirantal Oct 25, 2022
37da379
docs: Update showcase list (#92)
alstn2468 Oct 25, 2022
e414b8d
docs: add slidev ppt template with naive-ui (#97)
godkun Nov 4, 2022
041453d
Add slidev-theme-mokkapps (#98)
Mokkapps Nov 4, 2022
eb148aa
fix: disable search box auto open, close #99
antfu Nov 8, 2022
35a71a1
docs: add parser customization (preparser, but also link vite config)…
twitwi Nov 24, 2022
2761858
docs: update parameters in definePreparserSetup (#101)
twitwi Dec 13, 2022
5cffe3b
fix: use bold instead of code tag to avoid breaking chars on mobile (…
jdbruxelles Dec 19, 2022
c32272e
chore(typos): fix typos (#102)
stavares843 Dec 21, 2022
a89202a
docs: update syntax.md (#103)
Mokkapps Jan 10, 2023
2236db4
feat: add LightOrDark component doc (#106)
tonai Jan 20, 2023
9477d41
feat: add presenter mode documentation (#105)
tonai Jan 20, 2023
8d6e5c8
Update showcases.ts (#108)
Mokkapps Jan 23, 2023
2e53e8c
feat: page transition
antfu Jan 29, 2023
fcb11d1
docs: fix broken link in faq (#111)
jChapman Feb 3, 2023
e1c823d
docs: added an example of creating custom Mermaid styles (#110)
estruyf Feb 3, 2023
d6bb78b
docs: Added the unnamed theme (#109)
estruyf Feb 3, 2023
4e268b6
docs: add documentation for export range feature Fix #821 (#104)
neilmispelaar Feb 3, 2023
38e076f
docs: improve slide transition explanation
antfu Feb 3, 2023
8ffa1fd
Update syntax.md: Embedded Styles (#113)
yheuhtozr Feb 5, 2023
dbdc820
docs: fix typo in builtin slide transitions (#114)
matteo-azzolini Feb 6, 2023
9cb6406
docs: update Showcases (#107)
alexanderdavide Feb 7, 2023
7f25ea8
docs(themes): added dracula (#115)
jd-solanki Feb 17, 2023
6c48fa7
feat/export-options
tonai Jan 24, 2023
b66a4ce
feat: add built-in components doc and add buil-in menu (#116)
tonai Feb 24, 2023
c6bd8fa
docs: fix typo in output directory (#118)
enzonotario Mar 6, 2023
46f1104
docs: Added pnpm script (#117)
estruyf Mar 6, 2023
1317cbc
docs: updates for 0.40.5 (#119)
tonai Mar 24, 2023
c2931a4
ci: update checkout and setup-node (#120)
imanmalekian31 Apr 3, 2023
6a80cc0
fix: replace commas with underscores in atomic-css (#122)
matttrice Apr 4, 2023
86744c7
docs: grids-cols to grid-cols (#121)
matttrice Apr 4, 2023
7acc339
docs: add pnpm to install.md instructions (#123)
timozander May 18, 2023
d29625c
docs: align theme docs with types (#124)
bru02 May 21, 2023
19d3ad7
feat: configuring UnoCSS
antfu May 26, 2023
e2d97fb
docs: fix incorrect option name (#125)
kaakaa May 29, 2023
44920cd
docs: support setting startLines for codeblocks slidev (#126)
fr0zn May 31, 2023
281e164
fix: IPA correction (#127)
alephpi Jun 14, 2023
c608c01
fix: FAQ page UnoCSS url (#129)
fakelbst Jul 11, 2023
e68f0f3
docs(en): merging all conflicts
docschina-bot Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion .vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ const Customizations = [
link: '/custom/config-vite',
},
{
<<<<<<< HEAD
text: 'Configurer Windi CSS',
=======
text: 'Configure UnoCSS',
link: '/custom/config-unocss',
},
{
text: 'Configure Windi CSS',
>>>>>>> c608c011ffbff72d267a0c074a4bfa5ff4b601a7
link: '/custom/config-windicss',
},
{
Expand All @@ -165,7 +173,15 @@ const Customizations = [
link: '/custom/config-mermaid',
},
{
<<<<<<< HEAD
text: 'Configurer les Raccourcis',
=======
text: 'Configure Parser',
link: '/custom/config-parser',
},
{
text: 'Configure Shortcuts',
>>>>>>> c608c011ffbff72d267a0c074a4bfa5ff4b601a7
link: '/custom/config-shortcuts',
},
{
Expand All @@ -178,6 +194,17 @@ const Customizations = [
}
]

const BuiltIn = [
{
text: 'Components',
link: '/builtin/components',
},
{
text: 'Layouts',
link: '/builtin/layouts',
},
]

const Resources = [
{
text: 'Vitrines',
Expand Down Expand Up @@ -211,6 +238,7 @@ const slidebars = [
children: Customizations,
},
{
<<<<<<< HEAD
text: 'Intégrations',
children: [
{
Expand All @@ -222,6 +250,10 @@ const slidebars = [
link: '/builtin/layouts',
},
],
=======
text: 'Built-in',
children: BuiltIn,
>>>>>>> c608c011ffbff72d267a0c074a4bfa5ff4b601a7
},
]

Expand Down Expand Up @@ -252,7 +284,8 @@ module.exports = {
editLinkText: 'Suggérer un changement sur cette page',

algolia: {
apiKey: '1a5c5a504139c58f428974c78c55291d',
appId: 'LCBV6MIFS6',
apiKey: '1ff173fe73b20edc962c1c24c0b1c160',
indexName: 'slidev',
searchParameters: {
// for translations maintainers: change the filter to your locale code (subdomain name)
Expand All @@ -278,7 +311,15 @@ module.exports = {
items: Customizations,
},
{
<<<<<<< HEAD
text: 'Ressources',
=======
text: 'Built-in',
items: BuiltIn,
},
{
text: 'Resources',
>>>>>>> c608c011ffbff72d267a0c074a4bfa5ff4b601a7
items: Resources,
},
{
Expand Down
48 changes: 47 additions & 1 deletion .vitepress/showcases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const showcases: ShowCaseInfo[] = [
name: 'Alexander Eble',
link: 'https://github.com/alexanderdavide',
},
slidesLink: 'https://git-most-wanted.alex-eble.de',
slidesLink: 'https://alexeble.de/talks/git-most-wanted/',
sourceLink: 'https://github.com/alexanderdavide/git-most-wanted',
at: 'Internal Tech Talk',
datetime: '2022-03-11',
Expand All @@ -131,6 +131,52 @@ export const showcases: ShowCaseInfo[] = [
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',
},
// Add yours here!
{
Expand Down
168 changes: 59 additions & 109 deletions .vitepress/theme/components/AlgoliaSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,126 +4,76 @@

<script setup lang="ts">
import '@docsearch/css'
import { useRoute, useRouter } from 'vitepress'
import { getCurrentInstance, onMounted, watch } from 'vue'
import docsearch from '@docsearch/js'
import type { DocSearchHit } from '@docsearch/react/dist/esm/types'
import type { DefaultTheme } from '../config'
import { onMounted } from 'vue'
import { useRouter, useRoute, useData } from 'vitepress'

const props = defineProps<{
options: DefaultTheme.AlgoliaSearchOptions
}>()

const vm = getCurrentInstance()
const route = useRoute()
const router = useRouter()

watch(
() => props.options,
(value) => {
update(value)
},
)
const route = useRoute()
const { theme, site } = useData()

onMounted(() => {
initialize(props.options)
initialize(theme.value.algolia)
})

function isSpecialClick(event: MouseEvent) {
return (
event.button === 1
|| event.altKey
|| event.ctrlKey
|| event.metaKey
|| event.shiftKey
)
}
// @ts-expect-error
const docsearch$ = docsearch.default ?? docsearch
type DocSearchProps = Parameters<typeof docsearch$>[0]

function getRelativePath(absoluteUrl: string) {
const { pathname, hash } = new URL(absoluteUrl)

return pathname + hash
}
function initialize(userOptions: any) {
// note: multi-lang search support is removed since the theme
// doesn't support multiple locales as of now.
const options = Object.assign<{}, {}, DocSearchProps>({}, userOptions, {
container: '#docsearch',

navigator: {
navigate({ itemUrl }: any) {
const { pathname: hitPathname } = new URL(
window.location.origin + itemUrl
)

// router doesn't handle same-page navigation so we use the native
// browser location API for anchor navigation
if (route.path === hitPathname) {
window.location.assign(window.location.origin + itemUrl)
} else {
router.go(itemUrl)
}
}
},

function update(options: any) {
if (vm && vm.vnode.el) {
vm.vnode.el.innerHTML
= '<div class="algolia-search-box" id="docsearch"></div>'
initialize(options)
}
transformItems(items: any) {
return items.map((item: any) => {
return Object.assign({}, item, {
url: getRelativePath(item.url)
})
})
},

// @ts-expect-error vue-tsc thinks this should return Vue JSX but it returns the required React one
hitComponent({ hit, children }) {
return {
__v: null,
type: 'a',
ref: undefined,
constructor: undefined,
key: undefined,
props: { href: hit.url, children }
}
}
})

docsearch$(options)
}

function initialize(userOptions: any) {
docsearch(
Object.assign({}, userOptions, {
container: '#docsearch',

searchParameters: Object.assign({}, userOptions.searchParameters),

navigator: {
navigate: ({ suggestionUrl }: { suggestionUrl: string }) => {
const { pathname: hitPathname } = new URL(
window.location.origin + suggestionUrl,
)

// Router doesn't handle same-page navigation so we use the native
// browser location API for anchor navigation
if (route.path === hitPathname)
window.location.assign(window.location.origin + suggestionUrl)

else
router.go(suggestionUrl)
},
},

transformItems: (items: DocSearchHit[]) => {
return items.map((item) => {
return Object.assign({}, item, {
url: getRelativePath(item.url),
})
})
},

hitComponent: ({
hit,
children,
}: {
hit: DocSearchHit
children: any
}) => {
const relativeHit = hit.url.startsWith('http')
? getRelativePath(hit.url as string)
: hit.url

return {
type: 'a',
ref: undefined,
constructor: undefined,
key: undefined,
props: {
href: hit.url,
onClick: (event: MouseEvent) => {
if (isSpecialClick(event))
return

// we rely on the native link scrolling when user is already on
// the right anchor because Router doesn't support duplicated
// history entries
if (route.path === relativeHit)
return

// if the hits goes to another page, we prevent the native link
// behavior to leverage the Router loading feature
if (route.path !== relativeHit)
event.preventDefault()

router.go(relativeHit)
},
children,
},
}
},
}),
function getRelativePath(absoluteUrl: string) {
const { pathname, hash } = new URL(absoluteUrl)
return (
pathname.replace(
/\.html$/,
// @ts-expect-error
site.value.cleanUrls === 'disabled' ? '.html' : ''
) + hash
)
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/components/Tweet.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
A simple wrapper for embeded Tweet
A simple wrapper for embedded Tweet

Usage:

Expand Down
6 changes: 3 additions & 3 deletions .vitepress/theme/support/sideBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
isArray,
ensureSlash,
ensureStartingSlash,
removeExtention,
removeExtension,
} from '../utils'

export function isSideBarConfig(
Expand Down Expand Up @@ -33,7 +33,7 @@ export function getSideBarConfig(

// get the very first segment of the path to compare with nulti sidebar keys
// and make sure it's surrounded by slash
path = removeExtention(path)
path = removeExtension(path)
path = ensureStartingSlash(path).split('/')[1] || '/'
path = ensureSlash(path)

Expand All @@ -57,7 +57,7 @@ export function getFlatSideBarLinks(
): DefaultTheme.SideBarLink[] {
return sidebar.reduce<DefaultTheme.SideBarLink[]>((links, item) => {
if (item.link)
links.push({ text: item.text, link: removeExtention(item.link) })
links.push({ text: item.text, link: removeExtension(item.link) })

if (isSideBarGroup(item))
links = [...links, ...getFlatSideBarLinks(item.children)]
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/theme/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export function ensureEndingSlash(path: string): string {
}

/**
* Remove `.md` or `.html` extention from the given path. It also converts
* Remove `.md` or `.html` extension from the given path. It also converts
* `index` to slush.
*/
export function removeExtention(path: string): string {
export function removeExtension(path: string): string {
return path.replace(/(index)?(\.(md|html))?$/, '') || '/'
}
Loading