Skip to content

A parser for knitting patterns in Rust.

License

Notifications You must be signed in to change notification settings

jamesmahler/knitting_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knitting_parser

LICENSE Rust Crates.io Version

A library designed to assist with parsing knitting patterns.

There seems to be no real standard for the syntax of a knitting pattern, so we are going to do our best at describing our own.

Syntax

  • All stitch names are lower case
  • A comma , separates stitches
  • Stitches can be grouped in parenthesis ( and )
  • Multipliers can be provided after a group or stitch: k x12 for twelve knits in a row
  • Groups can be embedded: (k, (p, ml)x2)x2 to produce k, p, ml, p, ml, k, p, ml, p, ml
  • Line starting with ## are for options
    • in_round : used to say the pattern is in the round.
    • start_wrong_side : used to say the pattern starts on the wrong side.
    • first_line=X : used to say the first line is X
  • Lines starting with # are ignored

Stitches

  • 1lcf
  • 1rcb
  • 2lcf
  • 2rcb
  • 3lcf
  • 3rcb
  • 4lcf
  • 4rcb
  • bead
  • bo
  • bobble
  • k
  • k2tog
  • kbf
  • kfb
  • ktbl
  • m kwise
  • m pwise
  • ml
  • mr
  • nostitch
  • p
  • p2tog
  • pbf
  • pfb
  • ptbl
  • sl kwise
  • sl pwise
  • ssk
  • ssp
  • yo

Documentation

docs.rs