From 9bc5c5c631e744f56077d9ec7dfdb56929b62413 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 9 Mar 2021 12:02:26 +0100 Subject: [PATCH] style: format code with prettier --- docs/config/algolia-search.md | 2 +- docs/config/homepage.md | 13 ++-- docs/guide/assets.md | 2 +- docs/guide/configuration.md | 2 +- docs/guide/customization.md | 4 +- docs/guide/deploy.md | 36 +++++----- docs/guide/frontmatter.md | 1 + docs/guide/global-computed.md | 2 +- docs/guide/markdown.md | 5 +- docs/index.md | 2 +- examples/minimal/index.md | 10 +-- src/client/app/components/Debug.vue | 12 ++-- src/client/theme-default/Layout.vue | 18 ++--- .../theme-default/components/BuySellAds.vue | 8 ++- .../theme-default/components/EditLink.vue | 8 ++- .../theme-default/components/HomeFeatures.vue | 6 +- .../theme-default/components/HomeFooter.vue | 2 +- .../theme-default/components/HomeHero.vue | 20 ++++-- .../theme-default/components/NavBar.vue | 4 +- .../theme-default/components/NavBarTitle.vue | 2 +- .../components/NavDropdownLink.vue | 9 ++- .../theme-default/components/NavLink.vue | 2 +- .../theme-default/components/NavLinks.vue | 2 +- .../components/icons/ArrowLeft.vue | 4 +- .../components/icons/ArrowRight.vue | 4 +- src/client/theme-default/styles/code.css | 12 ++-- .../theme-default/styles/custom-blocks.css | 8 +-- src/client/theme-default/styles/layout.css | 12 ++-- .../theme-default/styles/sidebar-links.css | 68 +++++++++++-------- src/client/theme-default/styles/vars.css | 26 +++---- src/client/tsconfig.json | 5 +- src/node/tsconfig.json | 5 +- src/shared/tsconfig.json | 5 +- 33 files changed, 176 insertions(+), 145 deletions(-) diff --git a/docs/config/algolia-search.md b/docs/config/algolia-search.md index 1ab1e27c..0076bcaa 100644 --- a/docs/config/algolia-search.md +++ b/docs/config/algolia-search.md @@ -4,7 +4,7 @@ The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://d ```js module.exports = { - themeConfig:{ + themeConfig: { algolia: { apiKey: 'your_api_key', indexName: 'index_name' diff --git a/docs/config/homepage.md b/docs/config/homepage.md index ccaea3bc..35f77da0 100644 --- a/docs/config/homepage.md +++ b/docs/config/homepage.md @@ -12,12 +12,13 @@ tagline: Hero subtitle actionText: Get Started actionLink: /guide/ 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 + webpack, use Vue components in markdown, and develop custom themes with Vue. -- title: Performant - details: VitePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded. + - 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 + webpack, use Vue components in markdown, and develop custom themes with Vue. + - title: Performant + details: VitePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded. footer: MIT Licensed | Copyright © 2019-present Evan You --- + ``` diff --git a/docs/guide/assets.md b/docs/guide/assets.md index fbd25cc8..acbbe57d 100644 --- a/docs/guide/assets.md +++ b/docs/guide/assets.md @@ -29,7 +29,7 @@ If your site is deployed to a non-root URL, you will need to set the `base` opti With a base URL, to reference an image in `public`, you'd have to use URLs like `/bar/image.png`. But this is brittle if you ever decide to change the base. To help with that, VitePress provides a built-in helper `$withBase` (injected onto Vue's prototype) that generates the correct path: ```html -foo +foo ``` Note you can use the above syntax not only in theme components, but in your Markdown files as well. diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index ab071a5e..7dc8d1e0 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -9,7 +9,7 @@ Without any configuration, the page is pretty minimal, and the user has no way t │ │ └─ config.js │ └─ index.md └─ package.json -```` +``` The essential file for configuring a VitePress site is `.vitepress/config.js`, which should export a JavaScript object: diff --git a/docs/guide/customization.md b/docs/guide/customization.md index 9caec3be..10cf4e0d 100644 --- a/docs/guide/customization.md +++ b/docs/guide/customization.md @@ -11,7 +11,7 @@ You can develop your custom theme by adding the `.vitepress/theme/index.js` file │ │ └─ config.js │ └─ index.md └─ package.json -```` +``` In `.vitepress/theme/index.js`, you must export theme object and register your own theme layout. Let's say you have your own `Layout` component like this. @@ -19,7 +19,7 @@ In `.vitepress/theme/index.js`, you must export theme object and register your o ``` diff --git a/docs/guide/deploy.md b/docs/guide/deploy.md index 073e6ad0..423228b0 100644 --- a/docs/guide/deploy.md +++ b/docs/guide/deploy.md @@ -128,9 +128,9 @@ deploy: 1. Set the correct `base` in `docs/.vitepress/config.js`. - If you are deploying to `https://.gitlab.io/`, you can omit `base` as it defaults to `'/'`. + If you are deploying to `https://.gitlab.io/`, you can omit `base` as it defaults to `'/'`. - If you are deploying to `https://.gitlab.io//`, for example your repository is at `https://gitlab.com//`, then set `base` to `'//'`. + If you are deploying to `https://.gitlab.io//`, for example your repository is at `https://gitlab.com//`, then set `base` to `'//'`. 2. Set `dest` in `.vitepress/config.js` to `public`. @@ -167,26 +167,26 @@ pages: 2. Create `firebase.json` and `.firebaserc` at the root of your project with the following content: - `firebase.json`: +`firebase.json`: - ```json - { - "hosting": { - "public": "./docs/.vitepress/dist", - "ignore": [] - } +```json +{ + "hosting": { + "public": "./docs/.vitepress/dist", + "ignore": [] } - ``` +} +``` - `.firebaserc`: +`.firebaserc`: - ```js - { - "projects": { - "default": "" - } - } - ``` +```js +{ + "projects": { + "default": "" + } +} +``` 3. After running `yarn docs:build` or `npm run docs:build`, deploy using the command `firebase deploy`. diff --git a/docs/guide/frontmatter.md b/docs/guide/frontmatter.md index 71f28bee..a62c2b2c 100644 --- a/docs/guide/frontmatter.md +++ b/docs/guide/frontmatter.md @@ -63,6 +63,7 @@ head: - name: keywords content: super duper SEO --- + ``` ### navbar diff --git a/docs/guide/global-computed.md b/docs/guide/global-computed.md index 384d0e38..ea46cf4f 100644 --- a/docs/guide/global-computed.md +++ b/docs/guide/global-computed.md @@ -85,5 +85,5 @@ The content value of the `` for the cur Helper method to generate correct path by prepending the `base` path configured in `.vitepress/config.js`. It's useful when you want to link to [public files with base path](./assets#public-files). ```html -foo +foo ``` diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 8245dbb6..b79eebd9 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -56,6 +56,7 @@ Outbound links automatically get `target="_blank" rel="noopener noreferrer"`: title: Blogging Like a Hacker lang: en-US --- + ``` This data will be available to the rest of the page, along with all custom and theming components. @@ -202,9 +203,7 @@ export default { ```html
    -
  • - {{ todo.text }} -
  • +
  • {{ todo.text }}
``` diff --git a/docs/index.md b/docs/index.md index ccf67e64..61c3ec02 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,7 +24,7 @@ There're couple of things that are improved from VuePress.... ### It Uses Vue 3 -Leverages Vue 3's improved template static analysis to stringify static content as much as possible. Static content is sent as string literals instead of JavaScript render function code – the JS payload is therefore *much* cheaper to parse, and hydration also becomes faster. +Leverages Vue 3's improved template static analysis to stringify static content as much as possible. Static content is sent as string literals instead of JavaScript render function code – the JS payload is therefore _much_ cheaper to parse, and hydration also becomes faster. Note the optimization is applied while still allowing the user to freely mix Vue components inside markdown content – the compiler does the static/dynamic separation for you automatically and you never need to think about it. diff --git a/examples/minimal/index.md b/examples/minimal/index.md index a0126658..b81988c5 100644 --- a/examples/minimal/index.md +++ b/examples/minimal/index.md @@ -6,7 +6,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Ut enim ad minim veniam, [link to Vue.js](https://vuejs.org) quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. -Ut enim ad minim veniam, **strong opinion** quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur *and emphasize* adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, **strong opinion** quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur _and emphasize_ adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ## Lists @@ -21,10 +21,10 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 1. Ordered item 1 - 1. Nested ordered item A - 2. Nested ordered item A -2. Ordered item 2 -3. Ordered item 3 +1. Nested ordered item A +1. Nested ordered item A +1. Ordered item 2 +1. Ordered item 3 ## Code Block and Block Quote diff --git a/src/client/app/components/Debug.vue b/src/client/app/components/Debug.vue index c20ea7dd..1081e274 100644 --- a/src/client/app/components/Debug.vue +++ b/src/client/app/components/Debug.vue @@ -34,12 +34,12 @@ watch(open, (value) => { color: #eeeeee; overflow: hidden; cursor: pointer; - background-color: rgba(0, 0, 0, .85); - transition: all .15s ease; + background-color: rgba(0, 0, 0, 0.85); + transition: all 0.15s ease; } .debug:hover { - background-color: rgba(0, 0, 0, .75); + background-color: rgba(0, 0, 0, 0.75); } .debug.open { @@ -60,7 +60,7 @@ watch(open, (value) => { } .debug.open:hover { - background-color: rgba(0, 0, 0, .85); + background-color: rgba(0, 0, 0, 0.85); } .title { @@ -72,13 +72,13 @@ watch(open, (value) => { .block { margin: 2px 0 0; - border-top: 1px solid rgba(255, 255, 255, .16); + border-top: 1px solid rgba(255, 255, 255, 0.16); padding: 8px 16px; font-family: Hack, monospace; font-size: 13px; } -.block +.block { +.block + .block { margin-top: 8px; } diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 865abfcb..e16c5ee0 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -86,15 +86,15 @@ const Home = defineAsyncComponent(() => import('./components/Home.vue')) const NoopComponent = () => null -const CarbonAds = __CARBON__ ? defineAsyncComponent( - () => import('./components/CarbonAds.vue') -) : NoopComponent -const BuySellAds = __BSA__ ? defineAsyncComponent( - () => import('./components/BuySellAds.vue') -) : NoopComponent -const AlgoliaSearchBox = __ALGOLIA__ ? defineAsyncComponent( - () => import('./components/AlgoliaSearchBox.vue') -) : NoopComponent +const CarbonAds = __CARBON__ + ? defineAsyncComponent(() => import('./components/CarbonAds.vue')) + : NoopComponent +const BuySellAds = __BSA__ + ? defineAsyncComponent(() => import('./components/BuySellAds.vue')) + : NoopComponent +const AlgoliaSearchBox = __ALGOLIA__ + ? defineAsyncComponent(() => import('./components/AlgoliaSearchBox.vue')) + : NoopComponent // generic state const route = useRoute() diff --git a/src/client/theme-default/components/BuySellAds.vue b/src/client/theme-default/components/BuySellAds.vue index 2ddccf3b..d07cf853 100644 --- a/src/client/theme-default/components/BuySellAds.vue +++ b/src/client/theme-default/components/BuySellAds.vue @@ -41,7 +41,9 @@ onMounted(() => { document.head.appendChild(s) - s.onload = () => { load() } + s.onload = () => { + load() + } } else { load() } @@ -62,7 +64,7 @@ function load() { .buy-sell-ads { margin: 0 auto; padding-top: 2rem; - font-size: .85rem; + font-size: 0.85rem; } .bsa-cpc { @@ -111,7 +113,7 @@ function load() { margin-left: 36px; padding: 0 8px; line-height: 22px; - font-size: .85em; + font-size: 0.85em; font-weight: 500; color: #1c90f3; content: 'Sponsored'; diff --git a/src/client/theme-default/components/EditLink.vue b/src/client/theme-default/components/EditLink.vue index f1587574..8d0492e7 100644 --- a/src/client/theme-default/components/EditLink.vue +++ b/src/client/theme-default/components/EditLink.vue @@ -1,6 +1,12 @@