App::SequenceDiagram

A command-line tool and reusable module set that parses plain text sequence
diagram descriptions and renders them as ASCII art, Unicode art, or SVG.

The input language is the Extended Common Sequence Diagram Specification
(ECSDS), a human-friendly text format covering the full UML sequence diagram
feature set including all combined fragment operators (alt, opt, loop, par,
critical, break, assert, neg, seq, strict).


USAGE

    rsd [options] <input_file>

    --help                    show help
    --lint                    report warnings after parsing
    --no-canvas               skip rendering
    --color                   enable ANSI color output
    --config FILE             load configuration from FILE
    --unicode                 use Unicode box-drawing and arrow characters
    --svg                     emit SVG to stdout instead of ASCII
    --markdown                wrap ASCII output in a fenced code block
    --theme NAME              apply a built-in SVG color theme
                              themes: light, dark, monochrome, solarized
    --debug tokenizer         print each token as it is produced
    --debug parser            print each AST node as it is built
    --debug parser_details    add per-field lines under each parser node
    --debug ast               dump the full AST after parsing
    --debug canvas            print each canvas drawing operation

Multiple debug flags may be combined:

    rsd --debug tokenizer,parser,ast --lint diagram.ecsds


CONFIGURATION

    The tool auto-discovers a config file in this order:

        ./rsd.rc
        ~/.config/rsd/rsd.rc
        ~/.rsd.rc

    Pass --config FILE to override auto-discovery.

    The config file controls participant colors, block colors, drawn
    characters, linter severity, and all SVG geometry and colors.
    See rsd.rc for a fully commented example with all default values.


INSTALLATION

    perl Build.PL
    ./Build
    ./Build test
    ./Build install


DEPENDENCIES

    Data::TreeDumper
    Getopt::Long              (core)
    List::Util                (core)
    Array::Iterator::Circular
    Term::ANSIColor           (core, used only when --color is active)


DOCUMENTATION

    See ecsds.md for the full language reference.
    See ecsds.ebnf for the formal EBNF grammar.
    See ecsds_tests.ecsds for annotated examples.
    See doc/architecture.md for module architecture and design decisions.
    See examples/ for domain-specific gallery examples.


ARCHITECTURE

    Lexer.pm                 tokenizes source text
    Parser.pm                builds a typed AST
    AST.pm                   node constructors
    Linter.pm                post-parse semantic checks
    Renderer.pm              two-pass layout and drawing engine (ASCII/Unicode)
    SVGRenderer.pm           SVG output renderer, inherits layout from Renderer
    Canvas.pm                character grid with ANSI color support
    Config/Defaults.pm       all built-in default values including SVG themes
    Config/Parser.pm         rsd.rc config file reader


LICENSE

    This software is copyright (c) 2026 by Nadim Khemir.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.


AUTHOR

    Nadim Khemir <nadim.khemir@gmail.com>

