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-sourceInstalling 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 actionWeave files only contain Ruby code
This means that you can do whatever you can normally do in Ruby
See it in actionYou 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 PreformattedThis 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 ...
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
- Nagato
- Mikuru
- Tsuruya
AsciiMath 2
There is support for AsciiMath
Math is basically text
Icons
There are icons available in here since the theme uses bootstrap
User
Breadcrumbs
CSS
JavaScript
If you want to add your own JavaScript files:
Use the request_js function:
See it in actionWe 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 actionSee 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 actionSee 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 actionSee it in action
Sidebar variation
This sidebar minimizes into an icon bar instead of disappearing totally
See it in actionThere are different preset partition schemes too
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
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
Tables can also be made the standard way
Name | Class |
---|---|
Haruhi | 2-B |
Kyon | 2-B |
Mikuru | 3-A |
Bordered style
You can mix and match styles
Name | Class |
---|---|
Haruhi | 2-B |
Kyon | 2-B |
Mikuru | 3-A |
Hover style
Name | Class |
---|---|
Haruhi | 2-B |
Kyon | 2-B |
Mikuru | 3-A |
Striped style
Name | Class |
---|---|
Haruhi | 2-B |
Kyon | 2-B |
Mikuru | 3-A |
Data Table
Data table JQuery plugin
Name | Class |
---|---|
Haruhi | 2-B |
Kyon | 2-B |
Mikuru | 3-A |
Foo Table
Foo Table plugin
Name | Class | Info | Power |
---|---|---|---|
Haruhi | 2-B | Uninterested in humans | Reality change |
Kyon | 2-B | Is the real God | Control over Haruhi |
Mikuru | 3-A | Classified information | Classified information |
You can make also tables easily from an array of Hashes
name | age |
---|---|
Haruhi | 17 |
Mikuru | 18 |
Kyon | 17 |
Nagato | 17 |
Itsuki | 17 |
Tsuruya | 18 |
You can also use the styles available to tables
name | age | class |
---|---|---|
Haruhi | 17 | 2-B |
Mikuru | 18 | 3-A |
Kyon | 17 | 2-B |
Nagato | 17 | 2-A |
Itsuki | 17 | 2-C |
Tsuruya | 18 | 3-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 actionThis is usually useful if you are generating a site with multiple pages generated from some data