Tokens.xml for M:tG
Go to file
ebbit1q 6ca51e58b9 sort all reverse-related tags
less lazy script but still bash:
\#!/bin/bash
tag="reverse-related"
relationrx="<$tag([^>]*)>([^<]*)</$tag>"
numberrx='[0-9]+'
declare -A list # associative array
while IFS= read -r line; do
  if [[ $line =~ $relationrx ]]; then
    yes=1
    name="${BASH_REMATCH[2]}"
    args="${BASH_REMATCH[1]}"
    if [[ $args =~ $numberrx ]]; then
      args="$(printf "%03d" "${BASH_REMATCH[0]}")$args"
    fi
    list[ "$name$args"]="$line"
    keys+="
$name$args"
  elif [[ $yes ]]; then
    # LC_ALL=C determines the sort behavior!
    <<<"${keys:1}" LC_ALL=C sort --ignore-case | while read -r key; do
      echo "${list[ $key]}"
    done
    yes=""
    list=()
    keys=""
    echo "$line"
  else
    echo "$line"
  fi
done <tokens.xml | sponge tokens.xml
2022-07-01 20:23:10 +02:00
.github/workflows add workflow for updating the version on pr approval (#135) 2022-02-14 22:35:46 +01:00
challenge_tokens.xml fix conflict with Unquenchable Fury from NEO (#137) 2022-02-16 21:14:11 +01:00
LICENSE Initial commit 2014-07-27 11:15:08 +08:00
README.md Improve Readme (#154) 2022-06-02 22:39:18 +02:00
tokens.xml sort all reverse-related tags 2022-07-01 20:23:10 +02:00
version.txt Update Gatherer token links that need special care to Scryfall (#162) 2022-07-01 20:18:15 +02:00

Discord Gitter Chat

Magic-Token

This repo contains token information in Cockatrice's XML card database format for Magic: The Gathering.
It describes individual tokens with linked art and the relation to their creators.

For normal tokens, save the file found here: tokens.xml

For tokens from the Theros block challege decks, save the file found here: challenge_tokens.xml