Beetle.wiki automation repo
  • PHP 52.2%
  • Python 44.6%
  • Shell 3.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-23 19:54:47 -07:00
.gitignore Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
download_assets.py Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
gen_config.py Escape item name strings in itemtags.php 2026-05-13 22:39:00 -07:00
generate_dokuwiki.py Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
itemtags.php New items, new origin, new push 2026-07-23 19:54:47 -07:00
README.md Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
requirements.txt Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
update.local.sh.example Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00
update.sh Sanitize deploy config and update generators for trinkets/trophies 2026-05-09 13:38:56 -07:00

beetlegame_wikier

Generate DokuWiki content (pages + media + item tag config) from Remilia beetle card data.

This project automates a full pipeline for a Beetle Game wiki:

  1. Download latest beetle JSON + image assets from remilia.net
  2. Generate DokuWiki page files grouped by category and rarity
  3. Generate itemtags.php config for the DokuWiki itemtags plugin
  4. (Optional) Deploy everything to a remote DokuWiki server via rsync

What this repo contains

  • download_assets.py
    Downloads beetles.json and all referenced images (icon/background/character) into assets/.

    • Includes trinkets/trophies
    • Skips shelves (separate game system)
  • generate_dokuwiki.py
    Builds DokuWiki page text files in dokuwiki_pages/:

    • item pages by category (beetle/, junk/, trinket/, trophy/, etc.)
    • category index pages (start.txt)
    • rarity pages (rarity/*.txt, including rarity/trophy.txt)
    • skips shelves
  • gen_config.py
    Generates:

    • itemtags.php (plugin config)
    • itemtag_docs.txt (wiki docs page listing all available tags)
    • includes trinket/trophy tags and links
    • skips shelves
  • update.sh
    End-to-end script: run generators, then sync pages/media/config to a remote DokuWiki host and rebuild index/cache.

  • beetles.json
    Latest downloaded beetle data snapshot.

  • itemtags.php
    Generated plugin configuration output.


Requirements

System

  • Python 3.10+
  • rsync, ssh (for deployment)
  • Access to a Chromium profile containing valid remilia.net cookies (used by browser_cookie3)

Python

requirements.txt includes:

  • requests>=2.31.0
  • browser-cookie3>=0.20.1

Install:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Quick start

1) Download data and assets

python download_assets.py

Outputs:

  • beetles.json
  • assets/... (mirrored image structure)

2) Generate DokuWiki pages

python generate_dokuwiki.py

Output root:

  • dokuwiki_pages/

3) Generate itemtags plugin config + docs

python gen_config.py

Outputs:

  • itemtags.php
  • itemtag_docs.txt

One-command update + deploy

update.sh runs all generation steps and then deploys to a configured remote host.

./update.sh

By default, update.sh uses placeholder values and will stop until configured.

Recommended setup:

cp update.local.sh.example update.local.sh
# edit update.local.sh with your host/user/path settings

Default path assumptions (can be overridden):

  • DokuWiki path: /var/www/dokuwiki/

It will:

  • upload itemtags.php to /var/www/dokuwiki/conf
  • sync dokuwiki_pages/ to data/pages/
  • sync assets/ to data/media/
  • clear cache + run DokuWiki indexer

⚠️ update.local.sh is gitignored so you can keep deploy host/user details out of the repo.


Output structure

Typical generated tree:

dokuwiki_pages/
  artifact/
  beetle/
  cheese/
  flower/
  hammer/
  junk/
  trinket/
  trophy/
  unique/
  rarity/
  itemtag_docs.txt

assets/
  images/
    icons/
    backgrounds/
    characters/

Notes

  • Item/tag naming has special handling for keys like hammer*, junk_cube*, and pollen* (uses label-based tags/page names).
  • Supports newer item categories including Trinkets and Trophies.
  • Shelves (category 10) are intentionally excluded from asset/page/config generation.
  • Paths are generated for DokuWiki namespace/media syntax (:namespace:page style).
  • Generated files are intended to be re-generated from source data; assets/, dokuwiki_pages/, and beetles.json are gitignored.

Typical workflow

# 1) refresh data/media
python download_assets.py

# 2) regenerate pages + plugin config
python generate_dokuwiki.py
python gen_config.py

# 3) deploy
./update.sh

If you want a safer deploy flow, run steps manually first and inspect generated output before syncing to production.