Fork me on GitHub

Welcome to Weaver 0.8.10


The following is a rough documentation intended to simply demonstrate and enumerate the facilities provided by weaver

This documentation page is written in Weaver too! See

https://github.com/davidsiaw/weaver-doc-source

Installing Weaver
gem install weaver
Getting Started
weaver create my_site

This will create a folder that looks like this:

my_site/
├── Gemfile
├── Gemfile.lock
├── cache
├── js
├── css
├── images
└── source
    └── index.weave

Go to your website directory and install its dependencies:

cd my_site
bundle install

Weave files are where you describe websites. To preview your site, simply go

bundle exec weaver

By default weaver binds to port 4567, but you can change that by going:

PORT=8080 bundle exec weaver

Easy!

Building your website

To build your website simply use the following command:

bundle exec weaver build

Your website will be generated and placed in the build directory

If your website is not a root website (it is in a subdirectory), then you can add the -r parameter, as we do for this documentation site:

bundle exec weaver build -r http://davidsiaw.github.io/weaver-docs/

This sets the root for images and other things such as links

Simple example Weave file

The most basic file takes one argument: the title, and a block that contains the contents of the page

See it in action
Weave files only contain Ruby code

This means that you can do whatever you can normally do in Ruby

See it in action
You can use all the HTML tags by simply calling them as if they are methods:

This is Heading 1

This is Heading 2

This is Heading 3

This is Heading 4

This is Heading 5
This is Heading 6
This is Preformatted
This is Emphasized
This is in a Blockquote

Paragraph text

You can also put attributes on a tag

This allows you to change styles, set more attributes on it, etc ...


Some text colored red
You can also wrap content in another tag

This is the same as doing it in HTML. Instead of passing it a string, you use a block


Some text colored red

This works for all tags

Like lists:


  • Haruhi
  • Kyon
  • Itsuki
  1. Nagato
  2. Mikuru
  3. Tsuruya
AsciiMath 2

There is support for AsciiMath


$$$MATH$$$sum_(i=1)^n i^3=((n(n+1))/2)^2$$$ENDMATH$$$

Math is basically text


The formula is thus: $$$MATH$$$x = 10 / y$$$ENDMATH$$$ hence we can see that $$$MATH$$$x = 5$$$ENDMATH$$$
Icons

There are icons available in here since the theme uses bootstrap


Github
User
Breadcrumbs

CSS

If you want to add your own CSS:

Use the request_css function:

See it in action
JavaScript

If you want to add your own JavaScript files:

Use the request_js function:

See it in action

We encourage putting your JavaScript in .js files so you don't clutter your presentation with code

Images

Crossfading images

Syntax Highlighting

There are different page templates to choose from

All page templates are responsive

Structureless pages

Structureless pages allow you to directly write content

See it in action
See it in action
See it in action

Structured pages

Structured pages require all content to be placed in headers/rows and columns

See it in action
See it in action
See it in action

Navigation page brands

You can also add a brand section to pages with navigation. The brand is just a link to home.

See it in action
See it in action

Sidebar variation

This sidebar minimizes into an icon bar instead of disappearing totally

See it in action
There are different preset partition schemes too
See it in action
There are buttons












There are various types of panels available

Panel

Some content

Primary

Some content

Success

Some content

Info

Some content

Warning

Some content

Danger

Some content

Blank

Some content

Jumbotron

Jumbotron

Widgets

gray

white

blue

lazur

yellow

red

black

It is easy to make tabs

Woof

Meow

Quack

There are two other possible orientations

There is :left and :right


Woof

Meow

Quack

It is also possible to use icons

Car

Subway

Bus

It is also possible to use an accordion

Woof

Meow

Quack

Tables can also be made the standard way

NameClass
Haruhi2-B
Kyon2-B
Mikuru3-A
Bordered style

You can mix and match styles


NameClass
Haruhi2-B
Kyon2-B
Mikuru3-A
Hover style

NameClass
Haruhi2-B
Kyon2-B
Mikuru3-A
Striped style

NameClass
Haruhi2-B
Kyon2-B
Mikuru3-A
Data Table

Data table JQuery plugin


NameClass
Haruhi2-B
Kyon2-B
Mikuru3-A
Foo Table

Foo Table plugin


NameClassInfoPower
Haruhi2-BUninterested in humansReality change
Kyon2-BIs the real GodControl over Haruhi
Mikuru3-AClassified informationClassified information
You can make also tables easily from an array of Hashes

nameage
Haruhi17
Mikuru18
Kyon17
Nagato17
Itsuki17
Tsuruya18
You can also use the styles available to tables

nameageclass
Haruhi172-B
Mikuru183-A
Kyon172-B
Nagato172-A
Itsuki172-C
Tsuruya183-A
Describing multiple pages in one weave file

It is possible to describe multiple pages in one weave file. Simply pass it two arguments, the first being the path of the page, and the second the title of the page'

See it in action

This is usually useful if you are generating a site with multiple pages generated from some data