Skip to content

Commit

Permalink
chore: fix some docs links (#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema authored Apr 15, 2024
1 parent 061c67e commit 51efc17
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 96 deletions.
12 changes: 6 additions & 6 deletions docs/src/content/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ $color-font-tertiary: #cccccc;
```

That's it! There is a lot more you can do with your style dictionary than generating files with color values. Take a look
at some [examples](examples.md) or take a deeper dive into [package structure](package_structure.md), [extending](extending.md), or how the [build process](build_process.md) works.
at some [examples](examples.md) or take a deeper dive into [package structure](/info/package_structure) or how the [build process](/info/architecture) works.

## Basic Usage

Expand All @@ -301,13 +301,13 @@ at some [examples](examples.md) or take a deeper dive into [package structure](p
style-dictionary build
```

Call this in the root directory of your project, which must include a [configuration](config.md) file.
Call this in the root directory of your project, which must include a [configuration](/reference/config) file.

More detailed information about [using the Style Dictionary CLI is available here](using_the_cli.md).
More detailed information about [using the Style Dictionary CLI is available here](/getting-started/using_the_cli).

### NodeJS

You can also use the Style Dictionary build system in node if you want to [extend](extending.md) the functionality or use it in another build system like Grunt or Gulp.
You can also use the Style Dictionary build system in Node if you want to [extend](/getting-started/using_the_npm_module) the functionality or use it in another build system like Grunt or Gulp.

```javascript title="build-tokens.js"
import StyleDictionary from 'style-dictionary';
Expand All @@ -316,7 +316,7 @@ const sd = new StyleDictionary('config.json');
await sd.buildAllPlatforms();
```

The StyleDictionary constructor can also take a [configuration](config.md) object.
The StyleDictionary constructor can also take a [configuration](/reference/config) object.

```javascript title="build-tokens.js"
import StyleDictionary from 'style-dictionary';
Expand All @@ -341,4 +341,4 @@ const sd = new StyleDictionary({
await sd.buildAllPlatforms();
```

More detailed information about [using the Style Dictionary npm module is available here](using_the_npm_module.md).
More detailed information about [using the Style Dictionary npm module is available here](/getting-started/using_the_npm_module).
2 changes: 1 addition & 1 deletion docs/src/content/docs/reference/Hooks/Formats/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Filtering tokens works by adding a `filter` attribute on the file object, where
}
```

The design token that is passed to the filter function has already been [transformed](transforms.md) and has [default metadata](tokens.md?id=default-design-token-metadata) added by Style Dictionary.
The design token that is passed to the filter function has already been [transformed](/reference/hooks/transforms) and has [default metadata](/info/tokens#default-design-token-metadata) added by Style Dictionary.

## References in output files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ You can find the source code of the built-in transforms here:
:::

:::note
All the pre-defined transforms included in Style Dictionary **up until version 3** were using the [CTI structure](tokens.md?id=category-type-item) for matching tokens.
If you structure your design tokens differently you will need to write [custom transforms](transforms.md?id=defining-custom-transforms) or make sure the proper CTIs are on the attributes of your design tokens.
All the pre-defined transforms included in Style Dictionary **up until version 3** were using the [CTI structure](/info/tokens#category-type-item) for matching tokens.
If you structure your design tokens differently you will need to write [custom transforms](/reference/hooks/transforms#defining-custom-transforms) or make sure the proper CTIs are on the attributes of your design tokens.

From **version 4 onwards**, instead of using the CTI structure of a token object, we're determining the token's `type` by the `token.type` property.
Or, the `$type` property if you're using the [DTCG spec format](https://design-tokens.github.io/community-group/format/).
Expand Down
20 changes: 10 additions & 10 deletions docs/src/content/docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ StyleDictionary.registerAction({
Add a custom [fileHeader](/reference/hooks/file_headers) to the Style Dictionary. File headers are used in
formats to display some information about how the file was built in a comment.

| Param | Type | Description |
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | `Object` | |
| options.name | `string` | Name of the format to be referenced in your config.json |
| options.fileHeader | `function` | Function that returns an array of strings, which will be mapped to comment lines. It takes a single argument which is the default message array. See [file headers](/references/hooks/formats.md#file-headers) for more information. Can be async. |
| Param | Type | Description |
| ------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | `Object` | |
| options.name | `string` | Name of the format to be referenced in your config.json |
| options.fileHeader | `function` | Function that returns an array of strings, which will be mapped to comment lines. It takes a single argument which is the default message array. See [file headers](/references/hooks/formats#file-headers) for more information. Can be async. |

Example:

Expand Down Expand Up @@ -342,11 +342,11 @@ StyleDictionary.registerFilter({

Add a custom [format](/reference/hooks/formats) to the Style Dictionary.

| Param | Type | Description |
| ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| format | `Object` | |
| format.name | `string` | Name of the format to be referenced in your config.json |
| format.formatter | `function` | Function to perform the format. Takes a single argument. See [creating custom formats](/references/hooks/formats.md#creating-formats) Must return a string, which is then written to a file. Can be async |
| Param | Type | Description |
| ---------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| format | `Object` | |
| format.name | `string` | Name of the format to be referenced in your config.json |
| format.formatter | `function` | Function to perform the format. Takes a single argument. See [creating custom formats](/references/hooks/formats#creating-formats) Must return a string, which is then written to a file. Can be async |

Example:

Expand Down
Loading

0 comments on commit 51efc17

Please sign in to comment.