Skip to content

πŸš€ Core spec, parser, CLI & converters for OmniScript Format (OSF) β€” Universal document DSL: Documents, Slides, Spreadsheets, Charts, Diagrams & Code in one plain-text format

License

OmniScriptOSF/omniscript-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

OmniScript Format (OSF)

OmniScript Logo

🌟 The Universal Document DSL

One format to generate documents, slides, sheets, charts, diagrams, and more

License: MIT v1.2.0 Tests Security Production Ready

πŸš€ Quick Start β€’ πŸ“¦ Packages β€’ 🎯 Features β€’ πŸ“– Documentation β€’ πŸ§ͺ Playground


πŸŽ‰ v1.2.0 Released - Tables, Includes, and Enterprise-Grade Security!

OmniScript Format v1.2.0 brings major new features and security hardening:

πŸ†• New Features

  • ✨ @table - Markdown-style tables with alignment, captions, and styling
  • ✨ @include - Modular documents with file composition
  • πŸ—οΈ Refactored Architecture - 85-91% code reduction, highly modular
  • πŸ“Š 130 tests - 70% more test coverage including 19 security tests

πŸ”’ Security (Grade A+)

  • πŸ›‘οΈ Path traversal protection - Prevents directory escape attacks
  • πŸ›‘οΈ ReDoS prevention - Bounded regex quantifiers
  • πŸ›‘οΈ Strict input validation - All inputs validated at multiple layers
  • πŸ›‘οΈ Defense-in-depth - Multi-layer security architecture
  • βœ… All P0-P2 security issues fixed

πŸ’― Quality Improvements

  • βœ… 130/130 tests passing (was 56 - +132% increase)
  • βœ… Zero breaking changes - Fully backward compatible
  • βœ… Better error messages - Contextual debugging information
  • βœ… Type-safe - Zero 'any' types, strict TypeScript mode

View Full Release Notes β†’ | Security Review β†’


πŸ’‘ What is OmniScript?

OmniScript Format (OSF) is a universal document description language that lets you write structured content once and export it to multiple formats:

@meta {
  title: "My Document";
  author: "John Doe";
}

@doc {
  # Hello World

  This is **OmniScript** - write once, export everywhere!
}

@table {
  caption: "Sales Report";
  style: "bordered";
  alignment: ["left", "right", "center"];

  | Product | Revenue | Status |
  | --- | --- | --- |
  | Widget A | $100K | βœ“ Growth |
  | Widget B | $85K | β†’ Stable |
}

@chart {
  type: "bar";
  title: "Sales Data";
  data: [
    { label: "Q1"; values: [100]; },
    { label: "Q2"; values: [150]; }
  ];
}

@include { path: "./sections/summary.osf"; }

@slide {
  title: "Presentation Slide";
  layout: TitleAndContent;

  - Point 1
  - Point 2
}

@sheet {
  name: "Data";
  cols: [Name, Value];

  A1 = "Product"; B1 = "Price";
  A2 = "Widget";  B2 = 99;
}

Export to: PDF πŸ“„ β€’ DOCX πŸ“ β€’ PPTX 🎞️ β€’ XLSX πŸ“Š


πŸš€ Quick Start

Install CLI

npm install -g omniscript-cli

Create Your First Document

# Create a new OSF file
cat > hello.osf << 'EOF'
@meta {
  title: "My First Document";
}

@doc {
  # Hello, OmniScript!

  Welcome to the **universal document format**.
}
EOF

# Parse and validate
osf parse hello.osf

# Export to PDF
osf export hello.osf --format pdf --output hello.pdf

Install as Library

npm install omniscript-parser omniscript-converters
import { parse } from 'omniscript-parser';
import { PDFConverter } from 'omniscript-converters';

const osf = `
@doc {
  # My Document
  Content here...
}
`;

const doc = parse(osf);
const converter = new PDFConverter();
const result = await converter.convert(doc);

// result.buffer contains the PDF

πŸ“¦ Packages

Package Version Description Status
omniscript-parser 1.2.0 TypeScript parser engine βœ… Stable
omniscript-converters 1.2.0 PDF, DOCX, PPTX, XLSX converters βœ… Stable
omniscript-cli 1.2.0 Command-line tools βœ… Stable
omniscript-vscode 0.1.0 VSCode extension βœ… Stable
omniscript-examples 1.2.0 Professional examples βœ… Complete

Package Details

πŸ” omniscript-parser

Zero-dependency TypeScript parser for OSF.

npm install omniscript-parser

Features: Parse OSF β†’ AST β€’ @table & @include support β€’ Security grade A+ β€’ 83 tests passing

View README β†’

πŸ”„ omniscript-converters

Enterprise-grade document converters.

npm install omniscript-converters

Features: PDF with charts β€’ DOCX with tables β€’ PPTX with native charts β€’ XLSX with formulas

View README β†’

⚑ omniscript-cli

Professional command-line interface.

npm install -g omniscript-cli

Commands: parse β€’ lint β€’ render β€’ export β€’ format β€’ diff β€’ Table & include support

View README β†’


🎯 Features

Core Block Types

Block Purpose Export Support Version
@meta Document metadata All formats v1.0
@doc Markdown content PDF, DOCX v1.0
@slide Presentation slides PPTX, PDF v1.0
@sheet Spreadsheet data XLSX, PDF v1.0
@table NEW Markdown tables HTML, PDF, DOCX v1.2

Advanced Blocks

Block Purpose Render Version
@chart Bar, line, pie charts Chart.js (PDF), Native (PPTX) v1.0
@diagram Flowcharts, sequences Mermaid, Graphviz v1.0
@code Syntax-highlighted code Prism.js, Line numbers v1.0

Directives

Directive Purpose Use Case Version
@include NEW File composition Modular documents, reusable sections v1.2

Export Formats

  • PDF - High-quality documents with charts and diagrams
  • DOCX - Microsoft Word with tables and formatting
  • PPTX - PowerPoint with native charts
  • XLSX - Excel with formulas and data

Themes

10+ professional themes: corporate β€’ modern β€’ academic β€’ minimal β€’ colorful β€’ dark β€’ blueprint β€’ ocean β€’ forest β€’ sunset


πŸ“– Documentation

Getting Started

Specification

Development

Quality


πŸ§ͺ Try It Online

Interactive Playground: https://omniscript.dev/playground

  • ✍️ Write OSF in Monaco editor
  • πŸ‘οΈ Live preview
  • πŸ“₯ Export to PDF, DOCX, PPTX, XLSX
  • 🎨 Test different themes

🌟 Use Cases

πŸ“š Documentation

Write technical documentation once, export to PDF for distribution and DOCX for editing.

πŸŽ“ Education

Create classroom materials with sheets for exercises and slides for presentations.

πŸ’Ό Business Reports

Generate reports with charts and data tables, export to PDF for sharing.

πŸ“Š Data Visualization

Create dashboards with charts and diagrams, export to multiple formats.

🎨 Presentations

Build professional presentations with charts, code samples, and diagrams.


πŸ› οΈ Development

Setup

git clone https://github.com/OmniScriptOSF/omniscript-core.git
cd omniscript-core
bun install
bun run build

Test

# Run all tests
bun test --recursive

# Test individual packages
cd omniscript-core/parser && bun test
cd omniscript-converters && bun test
cd omniscript-core/cli && bun test

Build

# Build all packages
bun run build --recursive

# Build individual packages
cd omniscript-core/parser && bun run build

πŸ“Š Project Stats

Metric Value
Total Tests 130 (83 parser + 47 CLI)
Test Pass Rate 100%
Security Tests 19 comprehensive tests
Security Grade A+ (path traversal, ReDoS, XSS)
Lines of Code 3,059 (highly modular)
Dependencies 0 (parser), minimal (converters)
Packages 5
Examples 25+
Themes 10+
Export Formats 4 (PDF, DOCX, PPTX, XLSX)

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Ways to Contribute

  • πŸ› Report bugs via GitHub Issues
  • πŸ’‘ Suggest features
  • πŸ“ Improve documentation
  • πŸ”§ Submit pull requests
  • 🎨 Create themes
  • πŸ“š Add examples

πŸ“„ License

MIT License - see LICENSE for details.


πŸ”— Links


πŸ“ž Support


🎊 Acknowledgments

Built with ❀️ using:

  • TypeScript - Type-safe language
  • Puppeteer - PDF generation
  • PptxGenJS - PowerPoint generation
  • docx - Word generation
  • ExcelJS - Excel generation
  • Mermaid - Diagram rendering
  • Chart.js - Chart rendering

Made with ❀️ by the OmniScript team

⭐ Star on GitHub β€’ πŸ“– Read the Docs β€’ πŸ§ͺ Try the Playground