The Article Title
Lets create basic sinatra app
$ mkdir sinatra-logger $ cd sinatra-logger
Create file to set project ruby version and gemset
$ echo 'ruby-2.2.0@sinatra-logger' > .ruby-version #
Activate project gemset
$ cd . # => ruby-2.2.0 - #gemset created /home/s/.rvm/gems/ruby-2.2.0@sinatra-logger ruby-2.2.0 - #generating sinatra-logger wrappers..........
Create Gemfile and Gemfile.lock
$ bundle init
Add to Gemfile
source 'htttps://rubygems.com' gem 'sinatra'
Install gems
$ bundle install
Create sinatra application
$ touch app.rb
Add to app.rb
require 'sinatra' get '/' do 'Hello World!' end
Launch our app
$ ruby app.rb # => [2015-02-10 22:15:18] INFO WEBrick 1.3.1 [2015-02-10 22:15:18] INFO ruby 2.2.0 (2014-12-25) [x86_64-linux] == Sinatra/1.4.5 has taken the stage on 4567 for development with backup from WEBrick [2015-02-10 22:15:18] INFO WEBrick::HTTPServer#start: pid=6751 port=4567
Go to http://localhost:4567
![sinatra logger start.jpg](http://github.com/sergii/sergii.github.io/images/sinatra-logger_start.jpg)
*Listing* Block Use: code or file listings
This is the optional preamble (an untitled section body). Useful for writing simple sectionless documents consisting only of a preamble.
5.times { puts 'Hello World' }
The abstract, preface, appendix, bibliography, glossary and index section titles are significant (specialsections). |
5.times { puts 'Hello World' }
Example Abstract
The optional abstract (one or more paragraphs) goes here.
This document is an AsciiDoc article skeleton containing briefly annotated element placeholders plus a couple of example index entries and footnotes.
1. The First Section
Article sections start at level 1 and can be nested up to four levels deep. [1]
And now for something completely different: monkeys, lions and tigers (Bengal and Siberian) using the alternative syntax index entries. Note that multi-entry terms generate separate index entries.
Here are a couple of image examples: an
example inline image followed by an example block image:
![Tiger image](/images/images/tiger.png)
Followed by an example table:
Option | Description |
---|---|
-a USER GROUP |
Add USER to GROUP. |
-R GROUP |
Disables access to GROUP. |
Lorum ipum…
1.1. Sub-section with Anchor
Sub-section at level 2.
1.1.1. A Nested Sub-section
Sub-section at level 3.
Yet another nested Sub-section
Sub-section at level 4.
This is the maximum sub-section depth supported by the distributed AsciiDoc configuration. [2]
2. The Second Section
Article sections are at level 1 and can contain sub-sections nested up to four deep.
An example link to anchor at start of the first sub-section.
An example link to a bibliography entry [taoup].
Appendix A: Example Appendix
AsciiDoc article appendices are just just article sections with specialsection titles.
Appendix Sub-section
Appendix sub-section at level 2.
Example Bibliography
Example Glossary
Glossaries are optional. Glossaries entries are an example of a style of AsciiDoc labeled lists.
- A glossary term
-
The corresponding (indented) definition.
- A second glossary term
-
The corresponding (indented) definition.