Simple router for static documentation. Map a folder of Markdown, textile, or other files to URLs and render them with minimal templates. Drop it into Rack, Rails, or Sinatra.
Part of the Trifle ecosystem.
gem 'trifle-docs'require 'trifle/docs'
Trifle::Docs.configure do |config|
config.path = File.join(__dir__, 'docs')
config.views = File.join(__dir__, 'templates')
config.register_harvester(Trifle::Docs::Harvester::Markdown)
config.register_harvester(Trifle::Docs::Harvester::File)
enddocs/
├── index.md
├── getting-started/
│ ├── index.md
│ └── installation.md
└── api/
├── index.md
└── reference.md
# Rack middleware
use Trifle::Docs::Middleware
# Rails
Rails.application.routes.draw do
mount Trifle::Docs::Engine => '/docs'
end<!-- templates/layout.erb -->
<!DOCTYPE html>
<html lang="en">
<head><title>Docs</title></head>
<body><%= yield %></body>
</html>
<!-- templates/page.erb -->
<%= content %>Template variables: sitemap, collection, content, meta.
- File-based routing. Folder structure becomes URL paths.
- Multiple harvesters. Markdown (with frontmatter), static files, custom processors.
- Template system. ERB templates with layout support.
- Flexible integration. Rack, Rails, Sinatra.
- Navigation helpers. Automatic menu and breadcrumb generation.
- Sitemap XML. Auto-generated with configurable base URL.
Full guides and API reference at docs.trifle.io/trifle-docs
| Component | What it does |
|---|---|
| Trifle App | Dashboards, alerts, scheduled reports, AI-powered chat. |
| Trifle::Stats | Time-series metrics for Ruby (Postgres, Redis, MongoDB, MySQL, SQLite). |
| Trifle CLI | Terminal access to metrics. MCP server mode for AI agents. |
| Trifle::Traces | Structured execution tracing for background jobs. |
| Trifle::Logs | File-based log storage with ripgrep-powered search. |
Bug reports and pull requests are welcome on GitHub at https://github.com/trifle-io/trifle-docs.
The gem is available as open source under the terms of the MIT License.
