starlight-mdconverter
v1.0.2
Published
Convert Starlight DSL Markdown (.slmd) files to standard Markdown (.md)
Maintainers
Readme
Starlight MD Converter
Description: Starlight MD Converter is a tool that allows developers to write documentation in a simple DSL called SLMD and convert it into ready-to-use Markdown files. This is especially useful for maintaining structured documentation or tutorials without manually writing Markdown syntax.
Pros of Starlight MD Converter
- Simplifies writing documentation using intuitive tags.
- Automatically converts SLMD to proper Markdown syntax.
- Supports headings, bold, italic, code blocks, links, lists, colors, and tables.
- Allows developers to focus on content instead of Markdown formatting.
- Quick conversion for large documents or tutorials.
Usage Steps
Step 1: Write your SLMD file
Create a new file with the extension .slmd. Use the following tags:
- <big1>, <big2>, <big3> for headings of different levels.
- <bold>Bold text</bold> to highlight important points.
- <italic>Italic text</italic> for emphasis.
- <code>Inline code</code> for commands or snippets.
- <color colorname>Colored text</color> to indicate colored highlights (optional, shows fallback).
- <link https://example.com>Example Link</link> to insert clickable links.
- <ul><li>Item</li></ul> to create lists.
- <table><tr><td>Cell</td></tr></table> to create tables.
Step 2: Save the SLMD file
Save the file with a descriptive name, e.g., documentation.slmd.
Step 3: Create a conversion script (program.sl) Use Starlight CLI to create a script that reads the SLMD file and outputs Markdown:
` import { convertFile } from "starlight-mdconverter"
sldeploy "=== SLMD to Markdown Converter ==="
let inputFile = ask("Enter path to your .slmd file:") let outputFile = ask("Enter path for output .md file:")
convertFile(inputFile, outputFile)
sldeploy "Conversion complete! Markdown file saved." `
Step 4: Run the converter
Open the terminal and execute your program.sl with Starlight CLI:
starlight program.sl
Follow the prompts:
- Provide the full path to your SLMD file.
- Provide the full path and filename for the output Markdown file.
Step 5: Verify the output
After conversion, open the generated .md file in any Markdown editor or viewer.
All your SLMD formatting should now be properly converted into Markdown syntax.
Example Table in SLMD
Feature | Supported --- | --- Headings | Yes Bold & Italic | Yes Code | Yes Links | Yes Lists | Yes Tables | Yes Colors | Yes (fallback in Markdown)
Tips for Developers
- Write content in SLMD naturally; the converter handles Markdown syntax automatically.
- Use colors only for readability in SLMD; Markdown will show the color name as fallback.
- Keep consistent file naming for easier management.
- Test conversion frequently with small SLMD files before working on large documents.
Conclusion
Starlight MD Converter streamlines writing documentation, tutorials, or notes. It allows developers to focus on content rather than Markdown formatting, while ensuring a clean, ready-to-use Markdown output.
