Knitout Headers

Headers comprise the very first section of a knitout file after the magic string, and contain overarching specifications which influence how the file should be interpreted. No comments can appear in a knitout file until after the headers section. Every header is a single line starting with ;;, followed by the name of the header, then the string : , then the header value. Knitout allows for extension headers whose names start with X-.

Required Headers

Every knitout file must contain these headers.

  • ;;Carriers: X blue C 1 3 Yellow

    A space-separated list of carrier names (they can be any string) that backends will map to carriers on the machine. Carriers are given in front-to-back order. NOTE: the header should name all carriers on the machine; not just the ones used in that particular piece. NOTE: some backends require specific carrier names.

Optional Headers

These headers serving informational/organizational purposes, or signify particular features when parsed by a backend.

  • ;;Position: Left

    Tells the backend how to map between knitout needle names and machine needles: ;;Position: Center (the default) centers the range of needle numbers mentioned in the pattern on the machine; ;;Position: Left aligns the smallest needle number mentioned in the file with the leftmost needle on the machine; ;;Position: Right aligns the largest needle number mentioned in the file with the rightmost needle on the machine; and ;;Position: Keep translates knitout needle numbers directly to machine needle numbers.

  • ;;Machine: SWGN2

    Gives the name of the machine the file is intended to be run on. Backends may warn if this does not match the machine they are generating code for.

  • ;;Gauge: 15

    Gives the gauge (in needles-per-inch) of the machine the file is intended to be run on. Backends currently ignore this value.

  • ;;Yarn-blue: Tamm Petit Light Blue

    Describes the yarn that should be loaded into a given carrier (e.g., ;;Yarn-X: for carrier X). This is purely informational is ignored by backends.