Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
docs: ensure consistent casing of section headers (#6578)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianGlowala committed Aug 13, 2022
1 parent 47eaaa1 commit 92a04cc
Show file tree
Hide file tree
Showing 85 changed files with 254 additions and 253 deletions.
8 changes: 4 additions & 4 deletions docs/content/1.getting-started/1.quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Starting fresh? Getting started with Nuxt 3 is straightforward!

## Play online
## Play Online

You can start playing with Nuxt 3 in your browser using our online sandboxes:

Expand Down Expand Up @@ -35,7 +35,7 @@ export default defineNuxtConfig({

::

## New project
## New Project

Open a terminal, or from [Visual Studio Code](https://code.visualstudio.com/), open an [integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal) and use the following command to create a new starter project:

Expand Down Expand Up @@ -75,7 +75,7 @@ pnpm install --shamefully-hoist

::

## Development server
## Development Server

Now you'll be able to start your Nuxt app in development mode:

Expand All @@ -99,7 +99,7 @@ pnpm run dev -o
Well done! A browser window should automatically open for <http://localhost:3000>.
::

## Next steps
## Next Steps

Now that you've created your Nuxt 3 project, you are ready to start building your application.

Expand Down
6 changes: 3 additions & 3 deletions docs/content/2.guide/1.concepts/1.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Nuxt takes care of this so you can focus on what matters: **creating your web ap

On top of this setup, Nuxt provides a [directory structure](/guide/directory-structure) to follow, focused on specific features to keep your focus on creating, not configuring.

## How does it work?
## How Does It Work?

Nuxt is composed of different [core packages](https://github.com/nuxt/framework/tree/main/packages):
::list{type=info}
Expand All @@ -35,7 +35,7 @@ Nuxt is composed of different [core packages](https://github.com/nuxt/framework/

We recommend reading each concept to have a full vision of Nuxt capabilities and the scope of each package.

## Are you Nuxt?
## Are You Nuxt?

Nuxt is the backbone of your Vue.js project, giving structure to build your project with confidence while keeping flexibility.

Expand All @@ -45,6 +45,6 @@ Extendable with a strong module ecosystem and hooks engine, it makes it easy to
Ready to try? Head over to the [Installation section](/getting-started/quick-start).
::

### Are you *courageously* Nuxt?
### Are You *Courageously* Nuxt?

Take a stab at an open [issue](https://github.com/nuxt/framework/issues). This is the best way to learn Nuxt, by actually diving into the code. You may even bring an approach or alternative solution that makes Nuxt even better! So, what are you waiting for? Let's go!
10 changes: 5 additions & 5 deletions docs/content/2.guide/1.concepts/2.vuejs-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Nuxt has always used Vue as a frontend framework. We chose to build Nuxt on top

## Vue with Nuxt

### Single file components
### Single File Components

[Vue’s single-file components](https://v3.vuejs.org/guide/single-file-component.html) (SFC, or `*.vue` files) encapsulate the markup (`<template>`), logic (`<script>`) and styling (`<style>`) of a Vue component. Nuxt provides a zero-config experience for SFCs with [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) that offers a seamless developer experience.

### Components auto-imports
### Components Auto-imports

Every Vue component created in the [`components/` directory](/guide/directory-structure/components) of a Nuxt project will be available in your project without having to import it. If a component is not used anywhere, your production’s code will not include it.

Expand Down Expand Up @@ -54,13 +54,13 @@ Nuxt 3 is based on Vue 3. The new major Vue version introduces several changes t
- Composition API
- TypeScript support

### Faster rendering
### Faster Rendering

The Vue Virtual DOM (VDOM) has been rewritten from the ground up and allows for better rendering performance. On top of that, when working with compiled Single-File Components, the Vue compiler can further optimize them at build time by separating static and dynamic markup.

This results in faster first rendering (component creation) and updates, and less memory usage. In Nuxt 3, it enables faster server-side rendering as well.

### Smaller bundle
### Smaller Bundle

With Vue 3 and Nuxt 3, a focus has been put on bundle size reduction. With version 3, most of Vue’s functionality, including template directives and built-in components, is tree-shakable. Your production bundle will not include them if you don’t use them.

Expand Down Expand Up @@ -103,7 +103,7 @@ The goal of Nuxt 3 is to provide a great developer experience around the Composi
- Use auto-imported [Reactivity functions](https://vuejs.org/api/reactivity-core.html) from Vue and Nuxt 3 [built-in composables](/api/composables/use-async-data).
- Write your own auto-imported reusable functions in the `composables/` directory.

### TypeScript support
### TypeScript Support

Both Vue 3 and Nuxt 3 are written in TypeScript. A fully typed codebase prevents mistakes and documents APIs usage. This doesn’t mean that you have to write your application in TypeScript to take advantage of it. With Nuxt 3, you can opt-in by renaming your file from `.js` to `.ts` , or add `<script lang="ts">` in a component.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.guide/1.concepts/3.rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Both the browser and server can interpret JavaScript code to render Vue.js components into HTML elements. This step is called **rendering**. Nuxt supports both **client-side** and **universal** rendering. The two approaches have pros and cons that we will cover in this section.

## Client-side only rendering
## Client-side Only Rendering

Out of the box, a traditional Vue.js application is rendered in the browser (or **client**). Then, Vue.js generates HTML elements after the browser downloads and parses all the JavaScript code containing the instructions to create the current interface.

Expand Down Expand Up @@ -71,7 +71,7 @@ At the moment, every page (or **route**) of a Nuxt application must use the same

[Read the open RFC discussing implementation and gathering community feedback.](https://github.com/nuxt/framework/discussions/560)

### Rendering on CDN edge workers
### Rendering on CDN Edge Workers

Traditionally, server-side and universal rendering was only possible using Node.js. Nuxt 3 takes it to another level by directly rendering code in CDN edge workers, reducing latency and costs.

Expand Down
8 changes: 4 additions & 4 deletions docs/content/2.guide/1.concepts/4.auto-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can find a reference for auto-imported [composables](/api/composables/use-as
Auto imports don't currently work within the [server directory](/guide/directory-structure/server).
::

## Nuxt auto-imports
## Nuxt Auto-imports

Nuxt auto-imports functions and composables to perform [data fetching](/guide/features/data-fetching), get access to the [app context](/api/composables/use-nuxt-app) and [runtime config](/guide/features/runtime-config), manage [state](/guide/features/state-management) or define components and plugins.

Expand All @@ -24,7 +24,7 @@ Nuxt auto-imports functions and composables to perform [data fetching](/guide/fe
</script>
```

## Vue auto-imports
## Vue Auto-imports

Vue 3 exposes Reactivity APIs like `ref` or `computed`, as well as lifecycle hooks and helpers that are auto-imported by Nuxt.

Expand All @@ -36,14 +36,14 @@ Vue 3 exposes Reactivity APIs like `ref` or `computed`, as well as lifecycle hoo
</script>
```

## Directory-based auto-imports
## Directory-based Auto-imports

Nuxt directly auto-imports files created in defined directories:

- `components/` for [Vue components](/guide/directory-structure/components).
- `composables/` for [Vue composables](/guide/directory-structure/composables).

## Explicit imports
## Explicit Imports

Nuxt exposes every auto-import with the `#imports` alias that can be used to make the import explicit if needed:

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.guide/1.concepts/4.server-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Check out [the h3 docs](https://github.com/unjs/h3) for more information.
Learn more about the API layer in the [`server/`](/guide/directory-structure/server) directory.
::

## Direct API calls
## Direct API Calls

Nitro allows 'direct' calling of routes via the globally-available `$fetch` helper. This will make an API call to the server if run on the browser, but will directly call the relevant function if run on the server, **saving an additional API call**.

Expand All @@ -40,7 +40,7 @@ Nitro allows 'direct' calling of routes via the globally-available `$fetch` help

For more information on `$fetch` features, check out [ohmyfetch](https://github.com/unjs/ohmyfetch).

## Typed API routes
## Typed API Routes

When using API routes (or middleware), Nitro will generate typings for these routes as long as you are returning a value instead of using `res.end()` to send a response.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.guide/1.concepts/6.typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ By default, Nuxt doesn't check types when you run `nuxi dev` or `nuxi build`, fo
yarn nuxi typecheck
```

## Auto-generated types
## Auto-generated Types

When you run `nuxi dev` or `nuxi build`, Nuxt generates the following files for IDE type support (and type checking):

Expand All @@ -37,7 +37,7 @@ Overwriting options such as `"compilerOptions.paths"` with your own configuratio
In case you need to extend options provided by `./.nuxt/tsconfig.json` further, you can use the `alias` property within your `nuxt.config`. `nuxi` will pick them up and extend `./.nuxt/tsconfig.json` accordingly.
::

## Stricter checks
## Stricter Checks

TypeScript comes with certain checks to give you more safety and analysis of your program.

Expand Down
6 changes: 3 additions & 3 deletions docs/content/2.guide/2.features/10.runtime-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it at runtime by setting environment variables.

## Exposing runtime config
## Exposing Runtime Config

To expose config and environment variables to the rest of your app, you will need to define runtime configuration in your `nuxt.config` file, using the [`runtimeConfig` option](/guide/directory-structure/nuxt.config#runtimeconfig).

Expand Down Expand Up @@ -66,9 +66,9 @@ export default defineNuxtConfig({
})
```

## Accessing runtime config
## Accessing Runtime Config

### Vue app
### Vue App

Within the Vue part of your Nuxt app, you will need to call `useRuntimeConfig()` to access the runtime config.

Expand Down
5 changes: 3 additions & 2 deletions docs/content/2.guide/2.features/11.teleports.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vue 3 provides the [`<Teleport>` component](https://vuejs.org/guide/built-ins/te

The `to` target of `<Teleport>` expects a CSS selector string or an actual DOM node. Nuxt currently has SSR support for teleports to `body` only, with client-side support for other targets using a `<ClientOnly>` wrapper.

## Example: body teleport
## Example: `body` Teleport

```vue
<template>
Expand All @@ -22,9 +22,10 @@ The `to` target of `<Teleport>` expects a CSS selector string or an actual DOM n
</template>
```

## Example: client-side teleport
## Example: Client-side Teleport

```vue
<template>
<ClientOnly>
<Teleport to="#some-selector">
<!-- content -->
Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.guide/2.features/13.modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Nuxt provides a module system to extend the framework core and simplify integrat

When developing production-grade applications with Nuxt you might find that the framework's core functionality is not enough. Nuxt can be extended with configuration options and plugins, but maintaining these customizations across multiple projects can be tedious, repetitive and time-consuming. On the other hand, supporting every project's needs out of the box would make Nuxt very complex and hard to use.

This is one of the reasons why Nuxt provides a module system that makes it possible to extend the core. Nuxt modules are async functions that sequentially run when starting nuxt in development mode using `nuxi dev` or building a project for production with `nuxi build`. They can override templates, configure webpack loaders, add CSS libraries, and perform many other useful tasks.
This is one of the reasons why Nuxt provides a module system that makes it possible to extend the core. Nuxt modules are async functions that sequentially run when starting Nuxt in development mode using `nuxi dev` or building a project for production with `nuxi build`. They can override templates, configure webpack loaders, add CSS libraries, and perform many other useful tasks.

Best of all, Nuxt modules can be distributed in npm packages. This makes it possible for them to be reused across projects and shared with the community, helping create an ecosystem of high-quality add-ons.

Expand Down Expand Up @@ -39,7 +39,7 @@ export default defineNuxtConfig({
Nuxt modules are now build-time-only, and the `buildModules` property used in Nuxt 2 is deprecated in favor of `modules`.
::

## Module development
## Module Development

Everyone has the opportunity to develop modules. Read more about developing modules in the [Module Author Guide](/guide/going-further/modules).

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.guide/2.features/3.assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Nuxt uses two directories to handle assets like stylesheets, fonts or images:
- The [`public/` directory](/guide/directory-structure/public) content is served at the server root as-is.
- The [`assets/` directory](/guide/directory-structure/assets) contains by convention every asset that you want the build tool (Vite or Webpack) to process.

## `public/` directory
## `public/` Directory

The [`public/` directory](/guide/directory-structure/public) is used as a public server for static assets publicly available at a defined URL of your application.

Expand All @@ -21,7 +21,7 @@ For example, referencing an image file in the `public/img/` directory, available
</template>
```

## `assets/` directory
## `assets/` Directory

Nuxt uses [Vite](https://vitejs.dev/guide/assets.html) or [Webpack](https://webpack.js.org/guides/asset-management/) to build and bundle your application. The main function of these build tools is to process JavaScript files, but they can be extended through [plugins](https://vitejs.dev/plugins/) (for Vite) or [loaders](https://webpack.js.org/loaders/) (for Webpack) to process other kind of assets, like stylesheets, fonts or SVG. This step transforms the original file mainly for performance or caching purposes (such as stylesheets minification or browser cache invalidation).

Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.guide/2.features/4.head-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const title = ref('Hello World')
</template>
```

## Example: usage with definePageMeta
## Example: Usage With `definePageMeta`

Within your `pages/` directory, you can use `definePageMeta` along with `useHead` to set metadata based on the current route.

Expand Down
10 changes: 5 additions & 5 deletions docs/content/2.guide/2.features/5.data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ When we call `fetch` in the browser, user headers like `cookie` will be directly
::ReadMore{link="/api/utils/$fetch"}
::

### Example: Pass client headers to the API
### Example: Pass Client Headers to the API

We can use [`useRequestHeaders`](/api/composables/use-request-headers) to access and proxy cookies to the API from server-side.

Expand All @@ -207,7 +207,7 @@ Here is a list of common headers that are NOT to be proxied:
* `cf-connecting-ip`, `cf-ray`
::

### Example: Pass on cookies from server-side API calls on SSR response
### Example: Pass Cookies From Server-side API Calls on SSR Response

If you want to pass on/proxy cookies in the other direction, from an internal request back to the client, you will need to handle this yourself.

Expand All @@ -234,7 +234,7 @@ onMounted(() => console.log(document.cookie))
</script>
```

## Best practices
## Best Practices

The data returned by these composables will be stored inside the page payload. This means that every key returned that is not used in your component will be added to the payload.

Expand Down Expand Up @@ -271,7 +271,7 @@ const { data: mountain } = await useFetch('/api/mountains/everest', { pick: ['ti
</template>
```

## Using async setup
## Using Async Setup

If you are using `async setup()`, the current component instance will be lost after the first `await`. (This is a Vue 3 limitation.) If you want to use multiple async operations, such as multiple calls to `useFetch`, you will need to use `<script setup>` or await them together at the end of setup.

Expand Down Expand Up @@ -304,7 +304,7 @@ export default defineComponent({
</template>
```

## Directly calling an API Endpoint
## Directly Calling an API Endpoint

There are instances where you may need to directly call the API. Nuxt 3 provides a globally available `$fetch` method using [unjs/ohmyfetch](https://github.com/unjs/ohmyfetch) (in addition to `fetch`)
with the same API as the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
Expand Down
6 changes: 3 additions & 3 deletions docs/content/2.guide/2.features/6.state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Nuxt provides `useState` composable to create a reactive and SSR-friendly shared
Because the data inside `useState` will be serialized to JSON, it is important that it does not contain anything that cannot be serialized, such as classes, functions or symbols.
::

## Best practices
## Best Practices

::alert{type=danger icon=🚨}
Never define `const state = ref()` outside of `<script setup>` or `setup()` function.<br>
Expand All @@ -26,7 +26,7 @@ Instead use `const useX = () => useState('x')`

## Examples

### Basic usage
### Basic Usage

In this example, we use a component-local counter state. Any other component that uses `useState('counter')` shares the same reactive state.

Expand Down Expand Up @@ -59,7 +59,7 @@ In this example, we use a composable that detects the user's default locale from

:LinkExample{link="/examples/other/locale"}

## Shared state
## Shared State

By using [auto-imported composables](/guide/directory-structure/composables) we can define global type-safe states and import them across the app.

Expand Down
Loading

0 comments on commit 92a04cc

Please sign in to comment.