<?xml version="1.0" encoding="UTF-8"?>

<?context-directive job ctxfile x-setups.ctx ?>

<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">

    <cd:command name="definesidebar" level="style" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupsidebar"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupsidebar" level="style" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="rulethickness">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="rulecolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="alternative">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="topoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="bottomoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="distance">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="leftmargindistance">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="level">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="setupsidebars" level="style" category="rules" file="anch-bar.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-name-list-optional"/>
                <cd:assignments list="yes">
                    <cd:inherit name="setupsidebar"/>
                </cd:assignments>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="sidebar" type="environment" level="document" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupsidebar"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupmarginrule" level="style" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-number-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupsidebar"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupmarginrules" level="style" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-number-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupmarginrule"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="marginrule" type="environment" level="document" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-number-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="marginrule" type="environment" variant="assignment" level="document" category="rules" file="anch-bar.mkiv">
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupmarginrule"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

</cd:interface>