New Pattern Editor Milestone Released 
You can access the latest download here. I fixed a couple of issues related to Java settings. If you were using Java 5 to run the editor (particularly on Mac OS X Tiger), you probably noticed that the editor wouldn't come up properly. Sorry about that! That's now been fixed.

Important Note: I made two significant changes to the KnitML schemas in this release that might affect you.

The first was that I broke up the two schema files (pattern-0.6.xsd and pattern-header-types-0.6.xsd) into three schema files with separate namespaces (pattern-0.6.xsd, operations-0.6.xsd, common-0.6.xsd). If you are using the KEL syntax (or the new KEL2 syntax in the 0.3.0 editor), you do not need to change anything. If you are using the raw XML syntax for development, take a look at the schema files to see what moved into which namespaces. Essentially, pattern structure elements moved into the pattern namespace (pattern, header and sub-elements, instruction-definitions, directions, section, instruction-group), needle yarn and stitch holder definitions moved into the common namespace, and everything else moved into the operations namespace. All this was done in preparation for imports of instruction libraries (i.e., for integration with other software which may only be producing charts, not full patterns).

The second change was to how needles and yarns are defined in the header. If you are using the new KEL2 syntax in the 0.3.0 editor (your file name ends with .kel2), you do not need to change anything. If you are using the older KEL syntax (your file name ends with .kel), you now need to group yarns by yarn type and needles by needle type.

Here is a sample of the KEL syntax you need to use:

Supplies {
YarnTypes {
YarnType 'lornas-1' [brand:"Lorna's Laces",category:"Shepherd Sock",weight:"fingering"] {
BallWeight: 50 g
Yarns {
Yarn 'main-color' withKey {
TotalLength: 430 yd
TotalWeight: 100 g
Color "Mixed Berries" [number:38]
NeedleTypes {
NeedleType 'size1circ' circ [brand:"Knitpicks"] {
Length: 24 inches
Size: US 1
Needles {
Needle 'needle1' withKey
Needle 'needle2' withKey

Notice how they're grouped together now under their type. You no longer need the typeref attribute as a result. Also note that YarnTypes and NeedleTypes are the new names for Yarns and Needles. Make sure you change the name of that, else the parser will get confused.

[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink
Quick and dirty tutorial for the new editor 
I've created a very basic tutorial for using the new editor and navigating around the new syntax.

I'd love help adding to this document. It's a Wiki page on Google Code, so all you need is a Google account and interest in helping out. Please let me know!

[ 3 comments ] ( 53 views )   |  [ 0 trackbacks ]   |  permalink
Pattern Editor 0.3.0 (milestone 1) released 
Download the newest editor here. And let me know what you think!

[ 1 comment ] ( 25 views )   |  [ 0 trackbacks ]   |  permalink
Here is the latest 
So this code in KEL:
Pattern 'en' {
Directions {
CastOn 24
Instruction 'stockinette-st' {
Row: k to end
Row: p to end
Repeat 'stockinette-st' until measures 4 in
NextRow: BindOff all sts

becomes this in the new DSL:
Cast on 24 sts

Instruction Stockinette:
Row 1: k to end
Row 2: p to end

Repeat Stockinette for 4 in
Next Row: BO all sts

And, you get a nice editor that provides you with suggestions!

What do you think?

[ 6 comments ] ( 66 views )   |  [ 0 trackbacks ]   |  permalink
A New Approach 
My interest in KnitML has come and gone over the years. (Has it really been years? Yikes!) Usually I give some attention to the project a couple times a year. This time was sparked by a talk I recently attended about Groovy's support for domain-specific languages (DSLs). It got me thinking about the appropriateness of Groovy as a platform for the Knitting Expression Language.

Most DSLs written to be understood by a computer don't exist before they're implemented for the computer; they usually evolve organically as the language's requirements are iterated over. I've known for awhile that knitting patterns are perhaps a somewhat unusual case for DSLs because the language already exists and is reasonably standard. Most pattern designers, for instance, can write:

Row 1: k to end

and almost every English-speaking knitter who reads patterns will know exactly what to do. So subjecting an existing DSL to a general programming language which has an entirely different set of syntactic conventions was, in retrospect, not a great idea. Just to get that row syntax I mentioned above to work in Groovy, I had to do back flips both within the language and as a pre-processing step. Plus I essentially lost the ability to implement editor help when I did that.

XText, however, is a far more flexible platform for creating new DSLs... because it was written solely for that purpose. I had looked into XText a couple of years back, but the project was in its infancy and I found it hard to wrap my head around. A couple of years really can give a guy some perspective, so I took another look, played around with it a bit, and now I'm convinced it's the way to go. Not only will you get a knitting language that looks much, much more like a real pattern, but you will also get direct help from the editor as you type and suggestions for completion.

I'll keep the Groovy-based DSL around for awhile, but I'm not going to enhance it further.

Interestingly, the knitting engine, validator, and pattern renderer don't need to change at all to support this new DSL. That's because I completely decoupled the DSL from the domain model used by those components. That's the architect in me coming out, I suppose. It really paid off, because my focus is going to be a lot less on the specification itself and a lot more on getting the editor to be usable and nice.

So stayed tuned! There are big changes afoot!

[ 1 comment ] ( 21 views )   |  [ 0 trackbacks ]   |  permalink

<Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>