Proposed approach was adopted by official TWDA repository, so this repo is not required anymore and archived.
neoTWDA is a set of utilities to generate static TWDA (Tournament Winning Decks Archive) pages from separate deck files for Vampire the Eternal Struggle (VTES) collectible card game.
Existing TWDA is maintained (updated with new TWDs) by editing single html file in TWDA repository which later served to the public.
- Target file is very big (hundreds of thousand lines) which is not very convenient to edit/navigate
- Editing require manual ordering by date
- Require manual Table of Content creation
- Relatively high bar of technical knowledge for contribution as each new deck addition requires at least to get html file from git and then careful edit it
- Prone to human errors like typos in html tags
- Prone to duplications (especially when several people commit addition of same deck)
- No simple way of changing styles (including not only visual, but also the structure of the document or deck representation)
- No simple way of generating Hall of Fame
- Each deck is stored as txt file of already established human-readable twd format (in
./decks
folder) - Static files generated by running two script (
create_twd_html.py
andcreate_hall_of_fame_html.py
) which uses deck files to create main part of the documents, and adds html header/footer from static files (twd_html_header.txt
,twd_html_footer.txt
,hall_of_fame_header.txt
andhall_of_fame_footer.txt
)
File name must be event id. First 6 lines order (Event...Player) is important, as their values used for ToC generation. The rest may be in arbitrary order/style (i.e. script will reuse it as-is[1] just like plain text - this allows custom style like author card comments in deck list).
[1] Except text wrapping up to STRING_LIMIT
from create_twd_html.py
which allows both one-long-line descriptions in deck file as well as pre-trimmed lines.
- Put deck file
event-id.txt
file into./decks
- Re-run
python create_twd_html.py
Similar works to edit/delete the deck.
- Deck files are standard txt files, so 'simplest' (not easiest!) way is to type it in your favorite text editor
- Deck-building software (Amaranth, VDB, etc) can to export deck to Text or TWD format, then edit header fields (Event, Date, etc) in text editor.
- To help verify deck file integrity it is possible to use VDB Check TWD page (under construction, not fully working yet), but it's not mandatory and approach designed to avoid any format/vendor-locking and to be plain-text-driven.
- Final entry (with filled fields) could then be attached as file to TWD Report post in the forum or pasted as text, and is ready to be add to TWD with minimal overhead for TWDA maintainers.
- Python (v3.10+)
git clone https://github.com/smeea/neoTWDA.git
cd neoTWDA
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
python create_twd_html.py // TO GENERATE NEW TWD.HTM
python create_hall_of_fame_html.py // TO GENERATE NEW HALL_OF_FAME.HTM
Hosted examples of generated static html from the repo: