Convert Textile to TOML
Max file size 100mb.
Textile vs TOML Format Comparison
| Aspect | Textile (Source Format) | TOML (Target Format) |
|---|---|---|
| Format Overview |
Textile
Textile Markup Language
Lightweight markup language created by Dean Allen in 2002. Used extensively in Redmine, Textpattern CMS, and other web platforms. Provides human-readable syntax for generating HTML, with support for headings, lists, links, images, and tables. Markup Language Redmine Default |
TOML
Tom's Obvious, Minimal Language
Configuration file format created by Tom Preston-Werner in 2013. Designed to be easy to read due to its clear semantics. Uses key-value pairs, tables, and arrays with strict typing including strings, integers, floats, booleans, and datetime values. Configuration Format Typed Values |
| Technical Specifications |
Structure: Plain text with inline markup symbols
Encoding: UTF-8 Format Type: Lightweight markup language Generates: HTML output Extensions: .textile, .txt |
Structure: Key-value pairs with sections
Encoding: UTF-8 (required) Format Type: Configuration / data serialization Data Types: String, int, float, bool, datetime, array, table Extensions: .toml |
| Syntax Examples |
Textile uses symbolic markup: h1. Project Documentation p. This project uses *Textile* for formatting content. * Feature one * Feature two |_. Name |_. Status | | Alpha | Complete | | Beta | In Progress | |
TOML uses key-value pairs: [document] title = "Project Documentation" content = "This project uses Textile" [[features]] name = "Feature one" [[features]] name = "Feature two" [[table_data]] name = "Alpha" status = "Complete" |
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2002 (Dean Allen)
Current Version: Textile 2 Status: Stable, maintained Evolution: Minor updates, stable spec |
Introduced: 2013 (Tom Preston-Werner)
Current Version: TOML v1.0.0 (2021) Status: Stable, actively maintained Evolution: Growing adoption in modern tooling |
| Software Support |
Redmine: Native support
Textpattern: Native support Ruby: RedCloth library Other: PHP Textile, Python textile |
Python: tomllib (stdlib 3.11+), tomli
Rust: toml crate (native) Go: BurntSushi/toml Other: Node.js, Ruby, Java libraries |
Why Convert Textile to TOML?
Converting Textile to TOML is useful when you need to extract structured data from Textile-formatted documents and represent it as configuration or structured key-value data. This is particularly relevant when migrating content metadata from Redmine wikis or Textpattern articles into TOML-based configuration systems used by modern tools like Cargo, Hugo, or pyproject.toml.
Textile documents often contain structured information such as headings, lists, and tables that can be mapped to TOML sections, arrays, and key-value pairs. The conversion extracts this structure and organizes it into clean TOML syntax with proper typing, making it suitable for programmatic consumption by configuration parsers.
TOML's strict typing ensures that values are correctly represented as strings, numbers, booleans, or dates rather than leaving everything as untyped text. This makes the converted data more reliable for use in build systems, deployment configurations, and application settings where type safety matters.
Key Benefits of Converting Textile to TOML:
- Structured Output: Transform document content into organized key-value sections
- Type Safety: TOML enforces types (strings, numbers, booleans, dates)
- Configuration Ready: Output is directly usable in Cargo, Hugo, pyproject.toml
- Clean Syntax: TOML is easy to read and edit by hand
- Data Extraction: Pull structured data from Textile tables and lists
- Modern Tooling: TOML is adopted by many modern development tools
- Metadata Migration: Move project metadata from wikis to config files
Practical Examples
Example 1: Project Metadata Extraction
Input Textile file (project.textile):
h1. MyProject p. A web application framework for rapid development. |_. Property |_. Value | | Version | 2.1.0 | | License | MIT | | Author | Jane Smith | h2. Dependencies * Django >= 4.0 * Redis >= 7.0 * PostgreSQL >= 14
Output TOML file (project.toml):
[document] title = "MyProject" content = "A web application framework for rapid development." [properties] version = "2.1.0" license = "MIT" author = "Jane Smith" [dependencies] django = ">= 4.0" redis = ">= 7.0" postgresql = ">= 14"
Example 2: Configuration Data from Wiki
Input Textile file (settings.textile):
h1. Server Configuration h2. Database Settings |_. Setting |_. Value | | Host | db.example.com | | Port | 5432 | | Name | production_db | h2. Cache Settings * Type: Redis * TTL: 3600 seconds * Max connections: 100
Output TOML file (settings.toml):
[document] title = "Server Configuration" [database] host = "db.example.com" port = 5432 name = "production_db" [cache] type = "Redis" ttl = 3600 max_connections = 100
Example 3: Feature List Conversion
Input Textile file (features.textile):
h1. Application Features h2. Core Features # User authentication # Role-based access control # API rate limiting h2. Optional Features # Email notifications # Webhook integrations # Custom themes
Output TOML file (features.toml):
[document]
title = "Application Features"
[core_features]
items = [
"User authentication",
"Role-based access control",
"API rate limiting"
]
[optional_features]
items = [
"Email notifications",
"Webhook integrations",
"Custom themes"
]
Frequently Asked Questions (FAQ)
Q: What is TOML format?
A: TOML (Tom's Obvious, Minimal Language) is a configuration file format created by Tom Preston-Werner, co-founder of GitHub. It uses key-value pairs organized into sections (tables) with strict typing. TOML is designed to be unambiguous and easy to read, making it ideal for configuration files like Cargo.toml (Rust) and pyproject.toml (Python).
Q: How is Textile content mapped to TOML structure?
A: Textile headings become TOML table names (sections), lists become arrays, and tables become key-value pairs within sections. The document title and body text are placed under a [document] table. The converter intelligently maps Textile's hierarchical structure to TOML's flat table-based organization.
Q: Does TOML preserve Textile formatting?
A: No, TOML is a data format, not a document format. Bold, italic, and other Textile formatting are stripped during conversion. The focus is on extracting the content and structure, not preserving visual formatting. Text content is stored as plain strings in TOML.
Q: Can I use the TOML output in Rust or Python projects?
A: Yes! The generated TOML files are fully valid and can be parsed by any TOML library. In Python, use the built-in tomllib module (3.11+) or the tomli package. In Rust, use the toml crate. The output follows the TOML v1.0.0 specification for maximum compatibility.
Q: How are Textile tables converted to TOML?
A: Textile tables with header rows are converted to TOML tables or arrays of tables. If the table has two columns (key-value pattern), it becomes key-value pairs. Multi-column tables become arrays of inline tables with named fields derived from the header row.
Q: What happens to Textile links and images?
A: Links are converted to string values containing the URL. Images are stored as string paths or URLs. The formatting syntax is stripped, but the actual URLs and paths are preserved in the TOML output for reference.
Q: Is TOML better than YAML for configuration?
A: TOML and YAML serve similar purposes but have different design philosophies. TOML is simpler and more strict, making it less error-prone (no indentation issues, explicit typing). YAML is more flexible and supports more complex data structures. TOML is preferred for simple configuration, while YAML is better for complex hierarchical data.
Q: Can I convert large Textile documents to TOML?
A: Yes, our converter handles Textile documents of any size. Large documents with many sections, tables, and lists are efficiently processed and organized into well-structured TOML output. The conversion maintains logical grouping based on the document's heading hierarchy.