Skip to content

Commit

Permalink
Fix model_ids being treated as an option instead of an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed May 2, 2024
1 parent e9714d9 commit d3c872c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/hexdoc/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import typer
from packaging.version import Version
from typer import Option
from typer import Argument, Option
from yarl import URL

from hexdoc.__version__ import VERSION
Expand Down Expand Up @@ -473,7 +473,7 @@ def render_model(

@app.command()
def render_models(
model_ids: list[str] = [],
model_ids: Annotated[Optional[list[str]], Argument()] = None,
*,
props_file: PropsOption,
render_all: Annotated[bool, Option("--all")] = False,
Expand Down Expand Up @@ -504,6 +504,8 @@ def render_models(
)
render_textures_and_export_metadata(loader, asset_loader)

logger.info("Done.")


@app.command(deprecated=True)
def export(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ hexdoc includes a fairly advanced module for rendering block models. It runs by

For a complete example, see [examples/model_rendering](https://github.com/hexdoc-dev/hexdoc/tree/main/examples/model_rendering) in hexdoc's GitHub repo.

## Steps
## 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>=1!0.1.0a16`
* `hexdoc-minecraft~={GAME_VERSION}.0` (eg. `hexdoc-minecraft~=1.19.2.0`)
2. Create a [`hexdoc.toml` config file](../../configuration):

Expand Down Expand Up @@ -37,7 +37,15 @@ For a complete example, see [examples/model_rendering](https://github.com/hexdoc
]
```

3. To render all available models, run this command: `hexdoc render-models --all`
## Usage

```sh
# render all available models
hexdoc render-models --all

# render one or more specific models
hexdoc render-models minecraft:block/anvil hexcasting:amethyst_sconce
```

## Example renders

Expand Down

0 comments on commit d3c872c

Please sign in to comment.