<commit_before>h1. What is it?

I have started implementing a HAML processor in the GO language.
You can find out more about HAML at "haml-lang.com":http://haml-lang.com
You can find out more about GO at "golang.org":http://golang.org

I've tried to remain diligent about reproducing the output from the canonical Ruby-based parser, so if you feel familiar with the one, then you should feel familiar with the other.

h1. Is it done?

Well, getting closer to something useful. The *gohaml* parser now supports the following:

* Tags with
** empty content;
** attributes of the form @{:attr => "value"}@;
** id moniker using "#" (@#divId@); and,
** class moniker using "." (@.divClass@).
* Tag nesting
* Scope lookup
** Arbitrary number of keys as specified by struct (@someKeyInScope.Subkey1.Subkey2@)
** Valid as tag content (@%p= someKeyInScope@)
** Valid as tag attribute value (@%p{:attr => someKeyInScope}@)
** Valid as tag attribute name (@%p{someKeyInScope => "value"}@)
* Engine-level autoclose option (@&lt;br /&gt;@ vs. @&lt;br&gt;@)
* Tag-specific close option (@%br/@ becomes @&lt;br /&gt;@ regardless of autoclose setting)
* Whitespace removal with the @<@ operator

This parser hasn't the same level of error reporting as the Ruby-based parser. That, of course, comes next. I want to make sure that I have the same reporting style and type of messages that comes with the other parser.

-No. Not even close. I just started yesterday with a language I just found out existed three days ago. However, in just that little time, I feel like I've come pretty far.-

h1. How can I install this?

Just follow the simple directions from the command line:

pre. git clone git://github.com/realistschuckle/gohaml.git gohaml
cd lib
make install
cd ../exe
make install

h1. Wow, Five Commands? Isn't there an easier way to install this?

Go has the nifty @goinstall@ experimental package manager. You can try this, but I won't guarantee its success.

pre. goinstall "github.com/realistschuckle/gohaml/lib"
goinstall "github.com/realistschuckle/gohaml/exe"

h1. How can I use it?

How about something like this? Save it, compile it, link it, and run it!

bc.. package main

import (
	"gohaml"
	"fmt"
)

func main() {
	var scope = make(map[string]interface{})
	scope["lang"] = "HAML"
	content := "I love <\n=lang<\n!"
	engine := gohaml.NewEngine(content)
	output := engine.Render(scope)
	fmt.Println(output) // Prints "I love HAML!"
}<commit_msg>Removed the part of the documentation about supporting goinstall. That just isn't true, still, and I'd rather spend my time on something else.<commit_after>h1. What is it?

I have started implementing a HAML processor in the GO language.
You can find out more about HAML at "haml-lang.com":http://haml-lang.com
You can find out more about GO at "golang.org":http://golang.org

I've tried to remain diligent about reproducing the output from the canonical Ruby-based parser, so if you feel familiar with the one, then you should feel familiar with the other.

h1. Is it done?

Well, getting closer to something useful. The *gohaml* parser now supports the following:

* Tags with
** empty content;
** attributes of the form @{:attr => "value"}@;
** id moniker using "#" (@#divId@); and,
** class moniker using "." (@.divClass@).
* Tag nesting
* Scope lookup
** Arbitrary number of keys as specified by struct (@someKeyInScope.Subkey1.Subkey2@)
** Valid as tag content (@%p= someKeyInScope@)
** Valid as tag attribute value (@%p{:attr => someKeyInScope}@)
** Valid as tag attribute name (@%p{someKeyInScope => "value"}@)
* Engine-level autoclose option (@&lt;br /&gt;@ vs. @&lt;br&gt;@)
* Tag-specific close option (@%br/@ becomes @&lt;br /&gt;@ regardless of autoclose setting)
* Whitespace removal with the @<@ operator

This parser hasn't the same level of error reporting as the Ruby-based parser. That, of course, comes next. I want to make sure that I have the same reporting style and type of messages that comes with the other parser.

h1. How can I install this?

Just follow the simple directions from the command line:

pre. git clone git://github.com/realistschuckle/gohaml.git gohaml
cd lib
make install
cd ../exe
make install

h1. Wow, Five Commands? Isn't there an easier way to install this?

No. I've tried to get goinstall to play nice, but it doesn't. Therefore, for now, I'm not supporting it.

h1. How can I use it?

How about something like this? Save it, compile it, link it, and run it!

bc.. package main

import (
	"gohaml"
	"fmt"
)

func main() {
	var scope = make(map[string]interface{})
	scope["lang"] = "HAML"
	content := "I love <\n=lang<\n!"
	engine := gohaml.NewEngine(content)
	output := engine.Render(scope)
	fmt.Println(output) // Prints "I love HAML!"
}
{'fraction_non_alphanumeric': 0.11132234896493452, 'fraction_numerical': 0.002957329953527672, 'mean_word_length': 4.290502793296089, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4574651', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1455, 'n_words': 658}