Added: EnvironmentBlock < Extensions::BlockProcessor

The EnvironmentBlock detects [env.joke], [env.theorem], etc., in the source text and creates
an "environment" block with given content, and with a title  constructed from the role
and a counter.  The title is not currently used -- see below -- but will be.  The created
block is subsequently processed by `converter.rb`in the backend.

Example:  The source text

```
[env.joke]
--
An engineer, a philosopher, and a mathematician met
at the bar for a drink.  (To be continued).
-- 
```
produces this latex:
```
\begin{joke}
An engineer, a philosopher, and a mathematician met
at the bar for a drink.  (To be continued).
\end{joke}
```
What will also be needed is an addition to the html backend, or a customized version of it for
use with mathematical text so that the source will be accepted without error and produce output
equivalent to that of the input

```
.Joke {counter:joke}
--
An engineer, a philosopher, and a mathematician met
at the bar for a drink.  (To be continued).
--
```

Note that the EnvironmentBlock provides the latex backend with `title=Joke 1`.  This information is not needed by the latex backend, but it would be by a modified html backend (can we use an extension to avoid modifying it)?

@jirukta, I noticed your work on slim.  Perhaps you would like to work on this also?

The goal of all this is to be able to have one `.adoc` file produce both the `.tex` and the `.html`.

See comments in `environment_block.rb` and use `samples/env.adoc` for testing.

PS.  I am in Beijing till Dec 2.  No google search, twitter, New York Times, etc.  The Great Firewall!

Thanks for the all the comments.  Will amend the code accordingly.

— and will take out a lot of the coloration  once I am sure I understand what I am doing.
Just there now as a crutch/diagnostic.


> On Nov 16, 2014, at 5:07 PM, Dan Allen <notifications@github.com> wrote:
> 
> In lib/asciidoctor-latex/environment_block.rb:
> 
> > +
> > +  def process parent, reader, attrs
> > +    
> > +    puts "begin EnvironmentBlock".blue if DEVELOPMENT
> > +    env_name = attrs["role"]
> > +    
> > +    if $counter[env_name] == nil
> > +      $counter[env_name] = 1
> > +    else
> > +      $counter[env_name] += 1
> > +    end
> > +      
> > +    attrs["title"] = env_name.capitalize + " " + $counter[env_name].to_s 
> > +    
> > +    puts "env_name: #{env_name}".cyan if DEVELOPMENT 
> > +    puts "end EnvironmentBlock\n".blue if DEVELOPMENT  
> These should be warn ... if $VERBOSE
> 
> You turn on $VERBOSE mode from the commandline using:
> 
> asciidoctor -v ...
> —
> Reply to this email directly or view it on GitHub <https://github.com/asciidoctor/asciidoctor-latex/pull/7/files#r20408134>.
>