Skip to content

Commit

Permalink
📝 data no longer available
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Aug 13, 2024
1 parent 329d762 commit 9c30e45
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 53 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/tools-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Tools release cache key
id: test-data-key
run: |
# LATEST_RELEASE=$(curl -sLH 'Accept: application/json' https://api.github.com/repos/5etools-mirror-2/5etools-mirror-2.github.io/releases/latest)
# LATEST_VERSION=$(echo $LATEST_RELEASE | grep tag_name | sed -e 's/.*"tag_name": "\([^"]*\)".*/\1/')
# echo $LATEST_VERSION
LATEST_VERSION="v1.209.3"
echo "🔹 Use $LATEST_VERSION"
Expand Down
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@ If there isn't an issue yet, open one! Be as specific as you can, and include th
- **Use maven:** `./mvnw install`
- **Use the Quarkus CLI**: `quarkus build`

To test with actual/live data, clone 5eTools and/or PF2eTools into a `sources` directory.
To test with actual/live data, add 5eTools and/or PF2eTools into a `sources` directory.

Using the GitHub CLI:

```shell
mkdir -p sources
# 5eTools
gh repo clone 5etools-mirror-2/5etools-mirror-2.github.io sources/5etools-mirror-2.github.io -- --depth=1
gh repo clone TheGiddyLimit/homebrew sources/5e-homebrew -- --depth=1
gh repo clone TheGiddyLimit/unearthed-arcana sources/5e-unearthed-arcana -- --depth=1
# Optional: 5eTools images; requires an extra config step
gh repo clone 5etools-mirror-2/5etools-img sources/5etools-img -- --depth=1

# PF2eTools
gh repo clone Pf2eToolsOrg/Pf2eTools sources/Pf2eTools -- --depth=1
Expand Down Expand Up @@ -118,7 +112,7 @@ Next navigate to *Java* -> *Code Style* -> *Organize Imports*. Click *Import* an
""
],
```

#### IntelliJ

1. Open the *Settings* window
Expand All @@ -129,7 +123,7 @@ Next navigate to *Java* -> *Code Style* -> *Organize Imports*. Click *Import* an
6. Ensure that the *Layout static imports separately* checkbox is checked
7. Underneath that, change the entries so that they look like this:

```
```shell
import static all other imports
<blank line>
import java.*
Expand Down
95 changes: 58 additions & 37 deletions README-WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
[TTRPG-Convert-CLI PF2e]: https://obsidianttrpgtutorials.com/Obsidian+TTRPG+Tutorials/Plugin+Tutorials/TTRPG-Convert-CLI/TTRPG-Convert-CLI+PF2e

## Requirements

- [Git][] is recommended to easily download and update the JSON sources
- Existing experience with using a command line isn't required, but may be useful. These instructions should be
sufficient, but you can look at the following resources for additional background on how to use the Windows
command line:
- [A Beginner's Guide to the Windows Command Line](https://www.makeuseof.com/tag/a-beginners-guide-to-the-windows-command-line/)
- [How to Open Command Prompt in a Folder](https://www.lifewire.com/open-command-prompt-in-a-folder-5185505)
- [A Beginner's Guide to the Windows Command Line](https://www.makeuseof.com/tag/a-beginners-guide-to-the-windows-command-line/)
- [How to Open Command Prompt in a Folder](https://www.lifewire.com/open-command-prompt-in-a-folder-5185505)

## Instructions

Expand All @@ -27,7 +28,7 @@
- `ttrpg-convert-cli-2.3.18-windows-x86_64.zip`
- `ttrpg-convert-cli-2.3.18-examples.zip`

2. Unzip the downloaded files into a place you'll remember. For example, `Downloads`.
2. Unzip the downloaded files into a place you'll remember. For example, `Downloads`.
3. Navigate to the `bin` directory inside the unzipped files. It might be nested within another folder. You should see a `ttrpg-convert` EXE file in the folder - see the screenshot below.
4. In Explorer, hold **Shift** and **Right Click** within the folder (not on any particular file). Select
*Open in Terminal* (this may also be *Open PowerShell window here*, or *Open command window here* if you
Expand All @@ -40,46 +41,52 @@
![A screenshot of a Windows Powershell window opened to the ttrpg-convert-cli directory](docs/screenshots/windows-powershell-open.png)

6. Acquire the JSON data sources following the instructions in [Convert 5eTools JSON data][] or [Convert Pf2eTools JSON data][] by entering commands in this window and pressing **Enter**.
- For example, for 5eTools, run the following command (assuming that you have [Git][] installed):
```
git clone --depth 1 https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git
```
- Or, for Pf2eTools:
```

- For example, for Pf2eTools:

```shell
git clone --depth 1 https://github.com/Pf2eToolsOrg/Pf2eTools.git
```
- If you don't have Git, you can instead manually download the latest [5eTools release](https://github.com/Pf2eToolsOrg/Pf2eTools/releases/latest) or [Pf2eTools release](https://github.com/Pf2eToolsOrg/Pf2eTools/releases/latest) and extract the zip file to the `bin/` directory, so that it sits alongside the `ttrpg-convert.exe` file.

- If you don't have Git, you can instead manually download the latest [Pf2eTools release](https://github.com/Pf2eToolsOrg/Pf2eTools/releases/latest) and extract the zip file to the `bin/` directory, so that it sits alongside the `ttrpg-convert.exe` file.
- At this point, it should look like this:
![A screenshot of a Windows Explorer window with a ttrpg-convert.exe file next to a 5etools-mirror-2.github.io folder, and a Powershell window showing the output of the git command to download the sources](docs/screenshots/windows-explorer-powershell-with-sources.png)
7. Run the tool to check that it works. Enter `./ttrpg-convert --version` following into the terminal and press Enter
to run the command. You should see something like the following:
```
PS C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.14-windows-x86_64\bin> .\ttrpg-convert --version
ttrpg-convert version 2.3.14
Git commit: 6ecb310
Build time: 2024-05-18T12:36:51Z
```
```shell
PS C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.14-windows-x86_64\bin> .\ttrpg-convert --version
ttrpg-convert version 2.3.14
Git commit: 6ecb310
Build time: 2024-05-18T12:36:51Z
```
If this works, then you're good to run the command to generate your notes. Otherwise, look below
for troubleshooting instructions

8. Run the tool to generate your notes. What this looks like depends on what you want the tool to do
and is described more in detail elsewhere in the README. For example, to generate notes from the
D&D5e SRD into a folder called `dm`, run:
```
./ttrpg-convert --index -o dm 5etools-mirror-2.github.io-master/data
```
- You should see output like the following, listing out how many notes of each type were generated, and a new `dm` folder should be in that directory.

![A screenshot of a Windows Explorer window with a ttrpg-convert.exe file next to a 5etools-mirror-2.github.io folder and a dm folder, and a Powershell window showing the output of the ttrpg-convert command](docs/screenshots/windows-explorer-powershell-after-run.png)
```shell
./ttrpg-convert --index -o dm 5etools-mirror-2.github.io-master/data
```

- You should see output like the following, listing out how many notes of each type were generated, and a new `dm` folder should be in that directory.

![A screenshot of a Windows Explorer window with a ttrpg-convert.exe file next to a 5etools-mirror-2.github.io folder and a dm folder, and a Powershell window showing the output of the ttrpg-convert command](docs/screenshots/windows-explorer-powershell-after-run.png)

9. To use additional sources, templates, or books, or for more configuration options,
[create a config file][3] and [see the main README][4].
- For example, assuming you have a custom configuration located in a file called `dm-sources.json`, you can
use this command to generate notes using that configuration:
```
./ttrpg-convert --index -o dm -c dm-sources.json 5etools-mirror-2.github.io-master/data
```

- For example, assuming you have a custom configuration located in a file called `dm-sources.json`, you can use this command to generate notes using that configuration:

```shell
./ttrpg-convert --index -o dm -c dm-sources.json 5etools-mirror-2.github.io-master/data
```

[Convert 5eTools JSON data]: https://github.com/ebullient/ttrpg-convert-cli/tree/main?tab=readme-ov-file#convert-5etools-json-data
[Convert Pf2eTools JSON data]: https://github.com/ebullient/ttrpg-convert-cli/tree/main?tab=readme-ov-file#convert-pf2etools-json-data
Expand All @@ -91,33 +98,42 @@
## Uh oh, something went wrong

### What are the weird characters in the output?

On Windows, the command output will look like this, with weird characters at the start of lines.
```

```shell
[ ✅ OK] Finished reading config.
⏱️ Reading C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.18-windows-x86_64\ttrpg-convert-cli-2.3.18-windows-x86_64\bin\5etools-mirror-2.github.io\data
[ ✅ OK] Finished reading data.
```

These are emoji that Windows is having trouble displaying. This doesn't affect the functionality at all, but
if you want to see these properly, choose a font with emoji support in the command line, and run the following:
```
```shell
chcp 65001
```
You should then start seeing the emoji correctly:
```
```shell
[ ✅ OK] Finished reading config.
⏱️ Reading C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.18-windows-x86_64\ttrpg-convert-cli-2.3.18-windows-x86_64\bin\5etools-mirror-2.github.io\data
[ ✅ OK] Finished reading data.
```
### 'ttrpg-convert' is not recognized
If you see the following:
```
```shell
'ttrpg-convert' is not recognized as an internal or external command,
operable program or batch file.
```
or
```
```shell
ttrpg-convert : The term 'ttrpg-convert' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
Expand All @@ -131,7 +147,8 @@ This means that the command line can't find the program. This is usually because
the wrong directory, or there's a typo somewhere in the name of the command.

Type in `dir` and press **Enter**. You should see output similar to this:
```

```shell
Directory:
C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.18-windows-x86_64\ttrpg-convert-cli-2.3.18-windows-x86_64\bin
Expand All @@ -148,21 +165,25 @@ file to the wrong directory. Make sure that you're opening the command line in t

If there *is* a `ttrpg-convert.exe` in the list, then the next most likely culprit is a typo. Make sure that the
command starts with `./ttrpg-convert`. Try copy/pasting this command:
```

```shell
./ttrpg-convert --help
```

If everything is set up correctly, you should see output starting with the following:
```

```shell
Convert TTRPG JSON data to markdown
Usage: ttrpg-convert [-dhlvV] [--index] [-c=<configPath>] [-g=<datasource>]
-o=<outputPath> [] [<input>...] [COMMAND]
```

### No output at all

If you don't get any output at all when running the `ttrpg-convert` command, try running
`./ttrpg-convert --help`. If you still get no output, like this:
```
```shell
C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.14-windows-x86_64\bin>.\ttrpg-convert --help
C:\Users\Kelly\Downloads\ttrpg-convert-cli-2.3.14-windows-x86_64\bin>
Expand Down
4 changes: 0 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,6 @@ The following configuration options allow you to change how the CLI treats these

- Create a shallow clone of the images repository, and set `images.internalRoot` in your configuration file to tell the CLI where it can locally find "internal" images.

```shell
git clone --depth 1 https://github.com/5etools-mirror-2/5etools-img.git
```

```json
"images": {
"copyInternal": true,
Expand Down

0 comments on commit 9c30e45

Please sign in to comment.