This repository contains nLab content pages converted from HTML to HAML format using the html2haml tool.
- Total Files Converted: 20,384
- Success Rate: 100%
- Format: HTML → HAML
- Tool Used: html2haml 2.3.0
The repository maintains the same directory structure as the original:
pages/
├── 0/
├── 1/
├── 2/
...
└── 9/
└── [hierarchical page storage]
├── content.html (original HTML)
├── content.haml (converted HAML)
├── name (page name)
└── revision_id (revision identifier)
The conversion was performed using a Ruby script (convert_to_haml.rb) that:
-
Handles Complex Doctypes: The nLab content uses XHTML 1.1 with MathML and SVG doctypes, which required a custom monkey patch to the html2haml library.
-
Preserves Structure: All HTML structural elements, attributes, CSS, and JavaScript are faithfully converted to HAML format.
-
Maintains Quality: The conversion maintains semantic equivalence with the original HTML.
The nLab pages use a complex doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >This is converted to HAML as:
!!! XML
!!! 1.1To run the conversion script:
# Install the required gem
gem install html2haml
# Run the conversion
ruby convert_to_haml.rbconvert_to_haml.rb- Main conversion script for batch processingtest_conversion.rb- Script for testing individual file conversionstest_sample_conversion.rb- Script for testing on a sample of files
HAML (HTML Abstraction Markup Language) offers several advantages:
- Cleaner Syntax: More readable and maintainable than HTML
- Less Verbose: Reduced code volume compared to HTML
- Automatic Closing: No need for closing tags
- Better Structure: Indentation-based hierarchy
Content follows the original nLab licensing terms.