package
0.0.0-20240808151852-3363955b67b3
Repository: https://github.com/sethcurry/stax.git
Documentation: pkg.go.dev
# README
ruleparser
ruleparser
is a utility format for parsing the Magic: The Gathering
comprehensive rules into an intermediate format that can be used to
generate HTML, JSON, or other formats.
Usage
You will typically only need to interact with ruleparser.ParseRulesFile
if
you have a .txt of the comprehensive rules that you would like to parse. If
you have an io.Reader, you can use ruleparser.ParseRules
instead.
You can get a copy of the rules from the Wizards of the Coast website. Download the TXT file.
package main
import (
"fmt"
"os"
"github.com/SethCurry/stax/pkg/ruleparser"
)
func main() {
rules, err := ruleparser.ParseRulesFile("rules.txt")
if err != nil {
panic(err)
}
// do something with the rules
}
# Functions
NewRule creates a new rule.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
ContentReference represents a reference to another rule.
ContentSymbol represents a symbol in the contents, such as a mana symbol or the tap symbol.
ContentText represents a plain text content element.
# Variables
ErrInvalidRuleLine means that the line could not be parsed as a rule.
ErrInvalidRuleNumber indicates that the rule number could not be parsed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
Rule represents a rule in the ruleset.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
ContentType represents the type of content in a rule, such as text, a reference to another rule, or a symbol.