Otto Documentation
Otto is a static site generator.
Introduction
Otto is a static site generator that uses AsciiDoc as a markup language. Otto can generate and serve static websites to make profile pages, documentation, blogs, and more!
Installation
gem install ottogen
AsciiDoc Primer
AsciiDoc is a lightweight markup language designed for writing documentation, articles, books, and more in a readable plain-text format. It is a powerful alternative to Markdown, offering enhanced formatting capabilities while remaining human-friendly.
Why Use AsciiDoc?
- Human-readable and simple: Uses a clean syntax that is easy to write and understand.
- More powerful than Markdown: Supports complex formatting, document structure, cross-references, and includes.
- Convertible: Can be transformed into HTML, PDF, EPUB, DocBook, and more.
- Ideal for technical documentation: Widely used for software documentation, particularly with Asciidoctor.
Basic Syntax
Headers
Use = signs to define section titles:
= Document Title
== Section 1
=== Subsection 1.1
==== Subsection 1.1.1
Paragraphs
Plain text creates paragraphs automatically.
Bold, Italics, and Monospace
*bold*
→ bold_italic_
→ italic`monospace`
→monospace
Lists
Unordered Lists
* Item 1
* Item 2
** Sub-item 2.1
** Sub-item 2.2
Ordered Lists
. First item
. Second item
.. Sub-item 2.1
.. Sub-item 2.2
Links
https://example.com[Example]
Images
image::example.jpg[Example Image, width=300, height=200]
Code Blocks
[source,python]
----
def hello():
print("Hello, Otto!")
----
Tables
[cols="3,1,2"]
|===
| Name | Age | Country
| John | 30 | USA
| Alice | 25 | UK
|===
Creating a Blog in Otto
First, let's initialize a new Otto project.
mkdir blog && cd blog
otto init
Our initial AsciiDoc file is located in
index.adoc
= Welcome to Otto!
Otto is a static site generator that uses AsciiDoc as a markup language.
Next, we can build our static site.
otto build
Our generated HTML is generated in a subdirectory named
_build
ls _build
The files in this folder are the statically generated site. Before building the site again, you may want to clean it first.
otto clean
For easy use, Otto includes a built-in server. This server is available at
localhost:8778
otto server
Otto can also watch your project and automatically rebuild the site when changes are saved.
otto watch