A humorous markup language where indentation levels must follow the Fibonacci sequence (0, 1, 1, 2, 3, 5, 8, 13, 21, etc.) — or else!
FML is a markup language that enforces mathematical harmony in your documents by requiring all indentation levels to follow the Fibonacci sequence. If your indentation doesn't match a Fibonacci number, the parser will reject it with a snarky error message.
FML can be used in two modes:
- Standard mode: Any Fibonacci number indentation is allowed at any point
- Continuous mode: Indentation must follow a continuous progression through the Fibonacci sequence
FML serves multiple purposes:
-
Educational: Demonstrates markup language concepts, parsing techniques, and the Fibonacci sequence in an interactive way
-
Creative Programming: Shows how mathematical constraints can be applied to document formatting in a novel manner
-
Versatile Tool: Works as a command-line utility, Python library, or web application
-
Programming Portfolio: Showcases package development, error handling, and API design skills
While created with humor, FML is a fully functional markup language that can be used for documentation, presentations, educational settings, or anywhere you want to add mathematical structure to your text.
This line has 0 spaces of indentation
This line has 1 space of indentation
This line also has 1 space of indentation
This line has 2 spaces of indentation
This line has 3 spaces of indentation
This line has 5 spaces of indentation
This line has 8 spaces of indentation
This line has 13 spaces of indentation
This line has 21 spaces of indentation
- Enforces Fibonacci sequence indentation (0, 1, 1, 2, 3, 5, 8, 13, 21, etc.)
- Supports both standard and continuous Fibonacci indentation modes
- Converts valid FML documents to HTML or Markdown formats
- Provides humorous error messages for non-compliant indentation
- Includes a CLI tool for validating and converting FML files
- Features an interactive web server with live preview
- Supports code blocks with proper indentation validation
pip install fml-mdOr install from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fml-md# Validate an FML file
fml validate path/to/your/file.fml
# Convert an FML file to HTML
fml convert path/to/your/file.fml output.html
# Start the FML preview server
fml serve
# Use continuous mode (where indentation must follow continuous Fibonacci rules)
fml serve --continuousfrom fml.parser import FMLParser
from fml.renderer import FMLRenderer
# Parse FML content
parser = FMLParser()
content = """Welcome to FML
This line has 1 space indentation
This line has 2 spaces
This line has 3 spaces
This line has 5 spaces
"""
# Parse the content
parsed = parser.parse(content)
# Render to HTML
renderer = FMLRenderer()
html = renderer.to_html(parsed)
print(html)
# Or render to markdown
markdown = renderer.to_markdown(parsed)
print(markdown)Start the web server and edit FML documents in your browser:
fml serveThen open your browser to http://localhost:8000/
The FML web interface provides a live editor and preview:
Because regular markup languages are too predictable. Embrace the mathematical harmony of Fibonacci in your documents!


