Skip to content

Commit

Permalink
Add pre-commit hook to run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed May 9, 2024
1 parent 5965d52 commit 118381a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
files: ^web/docusaurus/
types_or: [javascript, jsx, ts, tsx, mdx]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
hooks:
Expand Down
4 changes: 2 additions & 2 deletions web/docusaurus/docs/02-getting-started/01-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ To simplify the setup process, hexdoc provides [Copier](https://copier.readthedo

## Templates

* [hexdoc-mod-template](https://github.com/hexdoc-dev/hexdoc-mod-template): Generic template.
* [hexdoc-hexcasting-template](https://github.com/hexdoc-dev/hexdoc-hexcasting-template): Template for Hex Casting addons. Also compatible with [HexDummy](https://github.com/FallingColors/hexdummy)!
- [hexdoc-mod-template](https://github.com/hexdoc-dev/hexdoc-mod-template): Generic template.
- [hexdoc-hexcasting-template](https://github.com/hexdoc-dev/hexdoc-hexcasting-template): Template for Hex Casting addons. Also compatible with [HexDummy](https://github.com/FallingColors/hexdummy)!
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ For a complete example, see [examples/model_rendering](https://github.com/hexdoc
## Setup

1. In a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments), install the following Python packages:
* `hexdoc>=1!0.1.0a15`
* `hexdoc-minecraft~={GAME_VERSION}.0` (eg. `hexdoc-minecraft~=1.19.2.0`)
- `hexdoc>=1!0.1.0a15`
- `hexdoc-minecraft~={GAME_VERSION}.0` (eg. `hexdoc-minecraft~=1.19.2.0`)
2. Create a [`hexdoc.toml` config file](../../configuration):

```toml title="hexdoc.toml"
#:schema https://hexdoc.hexxy.media/schema/core/Properties.json

# for standalone model rendering, just leave this as "hexdoc"
modid = "hexdoc"

resource_dirs = [
# path(s) to "resources" folders, resource packs, and/or mod jars where your models and textures are located
"resources",
{ glob="mods/*.jar" },
# required if your models depend on vanilla resources
{ modid="minecraft" },
{ modid="hexdoc" },
]

# folder where loaded resources (not rendered models) should be copied to
export_dir = "out/export"

[textures]
strict = false
missing = [
# add item/block/model IDs to ignore missing or broken models
"emi:*",
]
```
```toml title="hexdoc.toml"
#:schema https://hexdoc.hexxy.media/schema/core/Properties.json

# for standalone model rendering, just leave this as "hexdoc"
modid = "hexdoc"

resource_dirs = [
# path(s) to "resources" folders, resource packs, and/or mod jars where your models and textures are located
"resources",
{ glob="mods/*.jar" },
# required if your models depend on vanilla resources
{ modid="minecraft" },
{ modid="hexdoc" },
]

# folder where loaded resources (not rendered models) should be copied to
export_dir = "out/export"

[textures]
strict = false
missing = [
# add item/block/model IDs to ignore missing or broken models
"emi:*",
]
```

## Usage

Expand Down
4 changes: 2 additions & 2 deletions web/docusaurus/src/remark/internalPathnameLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function processLinkNode(node: Link) {
type: "mdxJsxAttribute",
name: "rel",
value: nullExpression,
}
},
);

if (node.title) {
Expand Down Expand Up @@ -317,7 +317,7 @@ export default function plugin(): Transformer {

if (!includesImportLink) {
tree.children.unshift(
defaultImportNode({ name: "Link", source: "@docusaurus/Link" })
defaultImportNode({ name: "Link", source: "@docusaurus/Link" }),
);
}
};
Expand Down

0 comments on commit 118381a

Please sign in to comment.