Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport the hexdoc-hexcasting web book to 1.18 #548

Merged
merged 41 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a8ec68a
fix draining items having weird behavior if passed a stack it can dra…
yrsegal Oct 24, 2022
6900328
fix documentation not taking into account %%
yrsegal Oct 24, 2022
e17868d
Add properties, remove unnecessary files
object-Object Sep 2, 2023
9a7a503
Fix validation errors
object-Object Sep 2, 2023
6b79cbb
Serve static resources on this branch so we don't try to build langua…
object-Object Sep 10, 2023
9c8252f
Fix relative path
object-Object Sep 10, 2023
08d70bb
Add linkout translation
object-Object Sep 26, 2023
625dce2
Update props for dev15
object-Object Oct 17, 2023
c15f71b
Add namespaced template imports
object-Object Oct 19, 2023
8efa1dc
Merge remote-tracking branch 'origin/0.9.5-docs' into 1.18
object-Object Nov 21, 2023
718af55
Copy hexdoc-hexcasting plugin into 1.18
object-Object Nov 21, 2023
90c070e
Copy hexdoc-hexcasting workflow into 1.18
object-Object Nov 21, 2023
c56e217
oops
object-Object Nov 21, 2023
e94f2c2
Remove --allow-missing from nodemon.json
object-Object Nov 23, 2023
92ae0c8
Use TRACE instead of DEBUG
object-Object Nov 23, 2023
f93c24c
Remove outdated README info
object-Object Nov 26, 2023
7e3d02f
Remove hexdoc resources
object-Object Nov 26, 2023
b099df0
Use TypeTaggedTemplate for brainsweep recipes instead of macros
object-Object Dec 2, 2023
900e4cd
Add workflow_call event
object-Object Dec 2, 2023
a3e7722
Add build-group-id and bump hatch-gradle-version
object-Object Dec 2, 2023
0c51376
Maybe fix build-group-id
object-Object Dec 2, 2023
abae2a5
Bump web book version from refs/heads/1.18
object-Object Dec 2, 2023
86ecbda
Switch to new context style [ci skip]
object-Object Dec 17, 2023
1cc7347
Add link_overrides
object-Object Dec 17, 2023
3088c97
Fix ci
object-Object Dec 18, 2023
7c05411
Bump required hexdoc version
object-Object Dec 18, 2023
87f3e31
Bump version to 1.0.dev22
object-Object Dec 18, 2023
57ccee6
Add warning if no patterns were found
object-Object Dec 28, 2023
6e098dc
Bump version to 1.0.dev23
object-Object Jan 12, 2024
fd0500d
Bump hexdoc dependency to a10
object-Object Mar 29, 2024
8f7984e
Merge remote-tracking branch 'upstream/1.18' into 1.18
object-Object Mar 29, 2024
feedaf7
Integrated new rendering options using a Rust -> WASM
JohnDog3112 Jan 8, 2024
42c0ca7
Switched color palettes to match HexBug better.
JohnDog3112 Jan 12, 2024
084e8db
Renamed render.js to hexcasting_render.js and added the animated opti…
JohnDog3112 Jan 12, 2024
1ff61ce
Removed inline styles for CSS
JohnDog3112 Jan 12, 2024
83984f7
Renamed colors, switched them to what HexBug uses, and removed transp…
JohnDog3112 Jan 12, 2024
8cb5471
Setup all of the names/interfaces to be localized
JohnDog3112 Jan 18, 2024
beb5c08
Improve appearance of pattern rendering dropdown
object-Object Mar 29, 2024
f604a19
Bump version to 1.0.dev24
object-Object Mar 29, 2024
bb601ed
Update hexdoc plugin license
object-Object Mar 29, 2024
5bb710e
Merge branch '1.18' into 1.18
object-Object Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 52 additions & 21 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,60 @@
name: Build the Python doc-gen
name: Build the web book

on:
push:
branches: [main]
branches: '1.18'
workflow_dispatch:
inputs:
release:
description: Release this version
type: boolean
default: false
publish:
description: Package index to publish to
type: choice
options:
- none
- PyPI

env:
PYPI_PACKAGE: hexdoc-hexcasting

permissions:
contents: read

jobs:
build_docs:
runs-on: ubuntu-latest
hexdoc:
uses: hexdoc-dev/hexdoc/.github/workflows/hexdoc.yml@main
permissions:
contents: write
pages: read
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
python-version: "3.11"
release: |-
${{
github.event_name != 'push' && inputs.release
|| github.event_name == 'push' && startsWith(github.event.head_commit.message, '[Release]')
}}

publish-pypi:
runs-on: ubuntu-latest
needs: hexdoc
if: |-
needs.hexdoc.outputs.release == 'true' &&
(github.event_name == 'push' || inputs.publish == 'PyPI')
environment:
name: pypi
url: https://pypi.org/p/${{ env.PYPI_PACKAGE }}
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Generate file
run: doc/collate_data.py Common/src/main/resources hexcasting thehexbook doc/template.html index.html.uncommitted
- name: Check out gh-pages
uses: actions/checkout@v3
with:
clean: false
ref: gh-pages
- name: Overwrite file and commmit
run: |
mv index.html.uncommitted index.html
git config user.name "Documentation Generation Bot"
git config user.email "[email protected]"
git add index.html
git diff-index --quiet HEAD || git commit -m "Update docs at index.html from $GITHUB_REF"
- name: Upload changes
run: git push
- name: Download package artifact
uses: actions/download-artifact@v3
with:
name: hexdoc-build
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
166 changes: 166 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# hexdoc
doc/**/_export/generated/
/_site/
/_checkout/
__gradle_version__.py
.hexdoc/

# eclipse
bin
*.launch
Expand All @@ -21,9 +28,168 @@ build
eclipse
run

# MacOS moment
.DS_Store

# Files from Forge MDK
forge*changelog.txt

Session.vim
plot/


# Python

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
6 changes: 3 additions & 3 deletions Common/src/main/resources/assets/hexcasting/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
"_comment": "Продвинутые руны",

"hexcasting.entry.itempicking": "Работа с предметами",
"hexcasting.page.itempicking.1": "Некоторые руны, такие как $(l:hexcasting:patterns/spells/blockworks#OpPlaceBlock)$(action)Поставить блок/$, потребляют дополнительные предметы из инвентаря. Руна ищёт предмет для использования.",
"hexcasting.page.itempicking.1": "Некоторые руны, такие как $(l:hexcasting:patterns/spells/blockworks#hexcasting:place_block)$(action)Поставить блок/$, потребляют дополнительные предметы из инвентаря. Руна ищёт предмет для использования.",
"hexcasting.page.itempicking.2": "$(li)Сначала, руна ищёт первый подходящий предмет в хотбаре около $(italic)Посоха/$.$(li)Во вторых, руна использует $(italic)самый далёкий предмет из инвентаря/$.",
"hexcasting.page.itempicking.3": "Так можно выбрать какой предмет какое заклинание будет использовать.",

Expand Down Expand Up @@ -867,7 +867,7 @@
"hexcasting.page.flight.1": "The power of flight! I have wrestled Nature to its knees. But Nature is vengeful, and itches for me to break its contract so it may break my shins.",
"hexcasting.page.flight.2": "The entity (which must be a player) will be endowed with flight. The first number is the number of seconds they may fly for, and the second number is the radius of the zone they may fly in. If the recipient exits that zone, or their timer runs out while midair, the gravity that they spurned will get its revenge. Painfully.$(br2)It costs approximately 1 $(item)Amethyst Dust/$ multiplied by the radius, per second of flight.",

"hexcasting.page.teleport.1": "Куда мощнее $(l:patterns/spells/basic#OpBlink)$(action)Блинка/$, это позволит мне телепортироваться на невероятные расстония, пускай ограничение и есть, но оно $(italic)куда больше/$.",
"hexcasting.page.teleport.1": "Куда мощнее $(l:patterns/spells/basic#hexcasting:blink)$(action)Блинка/$, это позволит мне телепортироваться на невероятные расстония, пускай ограничение и есть, но оно $(italic)куда больше/$.",
"hexcasting.page.teleport.2": "The entity will be teleported by the given vector, which is an offset from its given position. No matter the distance, it always seems to cost about ten $(item)Charged Crystal/$s.$(br2)The transference is not perfect, and it seems when teleporting something as complex as a player, their inventory doesn't $(italic)quite/$ stay attached, and tends to splatter everywhere at the destination.",

"hexcasting.entry.zeniths": "Zeniths",
Expand All @@ -878,7 +878,7 @@
"hexcasting.page.zeniths.5": "Bestows haste. Base cost is one $(item)Amethyst Dust/$ per 3 seconds.",
"hexcasting.page.zeniths.6": "Bestows strength. Base cost is one $(item)Amethyst Dust/$ per 3 seconds.",

"hexcasting.page.greater_sentinel.1": "Summon a greater version of my $(l:patterns/sentinels)$(thing)Sentinel/$. Costs about 2 $(item)Amethyst Dust/$s.",
"hexcasting.page.greater_sentinel.1": "Summon a greater version of my $(l:patterns/spells/sentinels)$(thing)Sentinel/$. Costs about 2 $(item)Amethyst Dust/$s.",
"hexcasting.page.greater_sentinel.2": "The stronger sentinel acts like the normal one I can summon without the use of a Great Spell, if a little more visually interesting. However, the range in which my spells can work is extended to a small region around my greater sentinel, about 16 blocks. In other words, no matter where in the world I am, I can interact with things around my sentinel (the mysterious forces of chunkloading notwithstanding).",

"hexcasting.page.make_battery.1": "Infuse a bottle with _media to form a $(item)Phial./$",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"name": "hexcasting.entry.greatwork",
"description": "hexcasting.entry.greatwork.desc",
"icon": "minecraft:music_disc_11",
"sortnum": 3,
"entry_color": "54398a"
"sortnum": 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:sentinel/create/great",
"anchor": "hexcasting:sentinel/create/great",
"text": "hexcasting.page.greater_sentinel.1",
"input": "vector",
"output": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "hexcasting:patterns/great_spells",
"icon": "minecraft:potion{Potion:'minecraft:regeneration'}",
"advancement": "hexcasting:root",
"sort_num": 4,
"sortnum": 4,
"read_by_default": true,
"pages": [
{
Expand Down
21 changes: 21 additions & 0 deletions doc/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 object-Object, Alwinfy, gamma-delta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# hexdoc-hexcasting

Python web book docgen and [hexdoc](https://pypi.org/project/hexdoc) plugin for Hex Casting.

## Version scheme

We use [hatch-gradle-version](https://pypi.org/project/hatch-gradle-version) to generate the version number based on whichever mod version the docgen was built with.

The version is in this format: `mod-version.python-version.mod-pre.python-dev.python-post`

For example:
* Mod version: `0.11.1-7`
* Python package version: `1.0.dev0`
* Full version: `0.11.1.1.0rc7.dev0`

## Setup

```sh
python3.11 -m venv venv

.\venv\Scripts\activate # Windows
. venv/bin/activate.fish # fish
source venv/bin/activate # everything else

# run from the repo root, not doc/
pip install -e .[dev]
```

## Usage

For local testing, create a file called `.env` in the repo root following this template:
```sh
GITHUB_REPOSITORY=gamma-delta/HexMod
GITHUB_SHA=main
GITHUB_PAGES_URL=https://gamma-delta.github.io/HexMod
```

Useful commands:
```sh
# show help
hexdoc -h

# render and serve the web book in watch mode
nodemon --config doc/nodemon.json

# render and serve the web book
hexdoc serve

# export, render, and merge the web book
hexdoc export
hexdoc render
hexdoc merge

# start the Python interpreter with some extra local variables
hexdoc repl
```
Loading
Loading