~{buildcraft/json/lib}
/**
 * %: The target book for all entries passed to add_basic
 */
~args 1

/**
 * %: The ending name for the page.
 * %: The json type. Like "item_stack" or "external"
 * %: The guide display type. Like "item" or "trigger"
 * %: The guide display subtype. Like "tool" or "engine"
 * %: Extra json to append to the object.
 */
alias add_basic 5 `add "%2/%0" \`{
    "type": "%1",
    "book": "${0}",
    "tag_type": "%2",
    "tag_subtype": "%3"
%4
}\``

alias item_stack 4 `add_basic "%2" "item_stack" "%0" "%1" \`,
    "stack": "%3"
\``
alias statement 4 `add_basic "%2" "statement" "%0" "%1" \`,
    "statement": "${domain}:%3"
\``

alias item 3 `item_stack "item" "%0" "%1" "%2"`
alias block_full 3 `item_stack "block" "%0" "%1" "%2"`
alias block 2 `item_stack "block" "%0" "%1" "${domain}:%1"`
alias pipe 3 `item_stack "pipe" "%0" "%1" "%2"`
alias trigger 3 `statement "trigger" "%0" "%1" "%2"`
alias action 3 `statement "action" "%0" "%1" "%2"`

alias item_tool 2 `item "tool" "%0" "%1"`
alias item_gear 2 `item "gear" "%0" "%1"`
alias item_plug 2 `item "pipe_plug" "%0" "%1"`
alias pipe_item 2 `pipe "pipe_item" "%0" "%1"`
alias pipe_fluid 2 `pipe "pipe_fluid" "%0" "%1"`
// no "pipe_power" - no point writing the pages as they will be gone soonish :)
alias block_engine 2 `block "engine" "%0" "%1"`
alias block_refining 1 `block "refining" "%0"`
alias block_fluid 1 `block "fluid" "%0"`
alias block_mining 1 `block "mining" "%0"`
alias block_auto 1 `block "automation" "%0"`
alias block_engine 2 `block_full "engine" "%0" "%1"`

alias tool 1 `item_tool "%0" "${domain}:%0"`
alias gear 1 `item_gear "%0" "${domain}:%0"`
alias plug 1 `item_plug "%0" "${domain}:%0"`

alias block_refining 1 `block "refining" "%0"`
alias block_fluid 1 `block "fluid" "%0"`
alias block_mining 1 `block "mining" "%0"`
alias block_auto 1 `block "automation" "%0"`
