Skip to content

Nuxt SmartScriptAutomatic Typography Transformations

Smart, accessible typography enhancements for your Nuxt applications with full SSR/SSG support

What is Nuxt SmartScript? โ€‹

Versionย  Downloadsย  License

Nuxt SmartScript is a powerful Nuxt module that automatically transforms typography patterns in your content to enhance readability and visual appeal. It works seamlessly with your existing Nuxt application, requiring minimal configuration.

๐ŸŽ‰ What's New in v0.4.0 โ€‹

  • Full SSR/SSG Support - Server-side rendering and static generation now work perfectly
  • 30+ Element Support - Process headings, paragraphs, lists, tables, spans, links, and more
  • Improved Performance - Better caching and pattern matching
  • Bug Fixes - Fixed navigation issues and configuration handling
  • Better TypeScript - Improved type definitions and module builder integration

Why SmartScript? โ€‹

๐ŸŽฏ Problem โ€‹

Web content often contains patterns like (TM), (R), chemical formulas (H2O), and ordinal numbers (1st, 2nd) that could be displayed more professionally with proper typography.

โœจ Solution โ€‹

SmartScript automatically detects and transforms these patterns into beautifully formatted typography with proper superscripts, subscripts, and symbols - all while maintaining accessibility.

Quick Example โ€‹

Input:

Your Product(TM) is the 1st choice for quality!
H2O and CO2 are common molecules.
E=mc^2 is Einstein's famous equation.

Output:

  • Your Productโ„ข is the 1st choice for quality!
  • H2O and CO2 are common molecules.
  • E=mc2 is Einstein's famous equation.

Perfect For โ€‹

  • ๐Ÿ“š Documentation Sites - Technical docs with formulas and trademark symbols
  • ๐Ÿข Corporate Websites - Professional typography for brand names and legal marks
  • ๐Ÿ”ฌ Scientific Content - Chemical formulas and mathematical expressions
  • ๐Ÿ“ฐ Publishing Platforms - Articles with ordinal numbers and special symbols
  • ๐Ÿ“– Educational Materials - Math and science content with proper notation

Installation โ€‹

Install the module to your Nuxt application with one command:

bash
npm install @mitre/nuxt-smartscript
bash
pnpm add @mitre/nuxt-smartscript
bash
yarn add @mitre/nuxt-smartscript

Add it to your nuxt.config.ts:

typescript
export default defineNuxtConfig({
  modules: ['@mitre/nuxt-smartscript'],
  
  // Optional: customize the behavior
  smartscript: {
    // Enable/disable specific transformations
    transformations: {
      trademark: true,    // (TM) โ†’ โ„ข
      registered: true,   // (R) โ†’ ยฎ
      copyright: true,    // (C) โ†’ ยฉ
      ordinals: true,     // 1st โ†’ 1หขแต—
      chemicals: true,    // H2O โ†’ Hโ‚‚O
      mathSuper: true,    // x^2 โ†’ xยฒ
      mathSub: true,      // x_1 โ†’ xโ‚
    },
    
    // Full SSR/SSG support
    ssr: true,
    client: true,
  }
})

That's it! SmartScript will automatically enhance your typography across 30+ HTML elements.

License โ€‹

Apache 2.0 - ยฉ 2025 MITRE Corporation

Apache 2.0 License