amp / site / src / learn / index.haml

!!! 1.1
%html{ :xmlns => "" }
    %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }
      Amp | Version Control Revolution | Learn Amp
    = stylesheets :reset, :amp, :all_themes
    = javascripts "jquery-1.3.2.min.js", "jquery.cookie.js"
    - @selected = "learn"
    = render("include/_header.haml", :selected => "learn")
        .floatleft{ :style => "width:90%; padding:8px 0em 6px; margin-left:5%;"}
          %h2 Learning #{blue_amp("Amp")}
            Amp is still in its building stages, but there are some things to learn about it that are different from other VCS software.
            Currently, the main commands are (nearly) identical to #{hg_link}'s, so you should know how to use Mercurial before using
            #{blue_amp}. There's still plenty of other things that are different.
          %h2 Templates
            Templates are damn important to us. We're still hammering out the API, but if you run
            %span.shellscript amp templates
            you can use our interactive template editor. You can write templates in #{link_to "", "ERb"}, and access all the variables #{blue_amp} has. At the moment, #{blue_amp} only comes with one template for viewing changesets (such as in
            %span.shellscript amp log
            %span.shellscript amp head
            ), and one template for commit messages. Both match (roughly) the default templates used by #{hg_link}. However, you can add your own, and save them as either global templates (usable in any repository) or local (usable only in the current repository).
          %h2 Ampfiles
            The #{ampfile_link} is how you handle high-level configuration of an #{blue_amp} repository. This is where you add commands, hooks, modify command defaults, and so on. We have a full page discussing ampfiles #{ampfile_link "here"}, but we'll leave you with this snippet.
              command :push do |c|
                c.before { system "rake test" }
            Those 3 lines add a block of code which will run every time you run
            %span.shellscript amp push
            , right before the actual push happens, which will run unit tests. If a test fails, the block returns false, which cancels the push. If the tests pass, the block returns true, and the push happens.
            = link_to "/docs/", "API Documentation"
            One of the most important aspects of our code is that it should be highly documented. We're sitting at around 45% comment/LOC ratio, and there's still plenty of places we want more documentation. We use #{yard_link} to document our code. You can find the complete documentation for our code (and the dependencies we've included in the #{blue_amp} source) by clicking "API Documentation" above, or just clicking #{link_to "/docs/", "right here"}.
    = render("include/_footer.haml")