Own Your Infrastructure:
Self-Host Traven
This page is for self-hosting. If you prefer to load Traven via CDN, follow the steps in the Quick Start Guide (CDN) instead.
Traven is built to respect user privacy and operate completely offline. While loading via CDN is the fastest way to get started, self-hosting is the ideal choice for air-gapped systems, secure internal dashboards, and performance-critical deployments.
Essential Core Files
The minimal set of files required to mount the editor and render standard rich Markdown fields.
CSS AUTO-INJECTION: By default, traven.js automatically looks for and injects traven.css from the same folder it resides in. If you plan to split these files into separate directories (e.g. js/ and css/), File Placement shows how to manually link the CSS and configure autoLoadStyles: false
Themes & Toolbars
Optional custom styling presets to skin the editor interface or restrict toolbar configurations.
These are a few samples. Traven has many more skins and more toolbars to customize with, and you can also make your own.
- Strategy 1: Keep Together (Easiest)
Drop bothtraven.jsandtraven.cssinto a shared libraries directory (e.g.,js/lib/orassets/vendor/) next to other third-party files like Alpine.js or Leaflet. Traven will auto-detect and load the stylesheet automatically. - Strategy 2: Place Separately (Custom Layout)
If placingtraven.jsin yourjs/folder andtraven.cssin yourcss/folder, you must manually link the CSS in your HTML header and setautoLoadStyles: falsein your configuration options to prevent 404 resource errors.
Integration & Calling Recipes
The standard, form-associated custom element behaves exactly like a native <textarea>. Ideal for server-side forms (PHP, Laravel, Django) and quick static integration.
<form method="POST" action="/save.php">
<!-- The editor registers its value directly with the form -->
<traven-editor name="content"># Write your Markdown here...</traven-editor>
<button type="submit">Save Post</button>
</form>
<!-- Load the ES Module script -->
<script type="module" src="/js/lib/traven.js"></script>
<!-- Manually link stylesheet in <head> -->
<link rel="stylesheet" href="/css/traven.css">
<!-- Inside the form, pass the auto-load bypass attribute -->
<traven-editor name="content" auto-load-styles="false"># Markdown content...</traven-editor>
Mount the editor directly inside any HTML container and bind custom event listeners or state hooks in JavaScript. Perfect for client-side frameworks (Alpine.js, React, Vue).
<div id="editor-mount"></div>
<script type="module">
import { TravenEditor } from "/js/lib/traven.js";
const editor = new TravenEditor({
element: document.getElementById("editor-mount"),
initialValue: "# Initial Content\nType something here...",
onChange: (val) => {
console.log("Editor value updated:", val);
}
});
</script>
<!-- Manually link stylesheet -->
<link rel="stylesheet" href="/css/traven.css">
<div id="editor-mount"></div>
<script type="module">
import { TravenEditor } from "/js/traven.js";
const editor = new TravenEditor({
element: document.getElementById("editor-mount"),
initialValue: "# Custom separated paths setup",
autoLoadStyles: false // Bypasses auto-injection lookup
});
</script>