Markdown Converter
Agent skill for markdown-converter
Dawncaster is a mobile rogue-like card game similar to Slay The Spire. This is a static website that provides an alternative interface for browsing Dawncaster game data from the Blightbane API.
Sign in to like and favorite skills
Dawncaster is a mobile rogue-like card game similar to Slay The Spire. This is a static website that provides an alternative interface for browsing Dawncaster game data from the Blightbane API.
The site should follow best practices from the Web Content Accessibility Guidelines and be responsive for ease of use on small screens.
The site consists of two main pages:
cards.html - Browse and filter game cards, alternate interface for https://blightbane.io/cardstalents.html - Browse and filter talent information, alternate interface for https://blightbane.io/talentsBoth pages are standalone HTML files with embedded CSS and JavaScript. There is no build process, package manager, or dependencies beyond dependencies loaded from CDN.
All data comes from the Blightbane API at
https://blightbane.io/api:
GET /api/cards?search=&rarity=&category=&type=&banner=&exp=, cards returned from this endpoint don't have costsGET /api/card/{id}GET /api/card/{id}?talent=trueCRITICAL: All query parameters must be present even if empty. The search API expects:
/api/cards?search=&rarity=&category=&type=&banner=&exp=
Missing parameters will cause the query to fail. Empty values are valid and return unfiltered results for that parameter.
NEVER spam the API. Do NOT:
for id in range(1, 2000))DO use filter parameters intelligently:
?rarity=2&banner=8The API returns HTML markup in description fields, including:
<b> tags for bold text<br> or <br/> tags for line breaksDescriptions must be sanitized before rendering to prevent XSS attacks.
The Blightbane website is a client-side JavaScript application. The raw HTML does not contain dropdown options - they are dynamically generated by JavaScript. To get the authoritative, up-to-date filter values for use in the search endpoint:
Find the current bundle version:
curl -s 'https://blightbane.io' | grep -o 'index.bundle.js?v=[0-9.]*'
Example output:
index.bundle.js?v=0.20.5
Fetch the JavaScript bundle:
VERSION="0.20.5" # Use version from step 1 curl -s "https://blightbane.io/js/index.bundle.js?v=${VERSION}" > bundle.js
Extract filter arrays using regex patterns:
# Categories grep -oP '"Action","Item"[^]]*' bundle.js | head -1 # Types grep -oP '"Melee","Magic"[^]]*' bundle.js | head -1 # Rarities grep -oP '"Common","Uncommon"[^]]*' bundle.js | head -1 # Banners/Colors grep -oP '"Green","Blue","Red","Purple"[^]]*' bundle.js | head -1 # Expansions grep -oP '"Core","Metaprogress"[^]]*' bundle.js | head -1
?rarity=2)The html files have JavaScript which queries an SQLite database. The database needs to be generated ahead of time by crawling the API.
The
create-db/run.py script builds a complete SQLite database from the Blightbane API:
python run create-db/run.py dawncaster-cards.db
<br> tags, strips everything else)Database contains:
The code follows a functional approach with:
map, filter, and joinInstall dependencies with
npm i, only used for running tests.
npm run start to start a development server, then open a web browser and go to http://127.0.0.1:4173/cards.html
To run Playwright tests:
npm run test. Note: this command also runs the development server