FEDMAKE(1)

NAME
fedmake - convert visual text mockups to fedform definitions

SYNOPSIS
fedmake mockup [options]

DESCRIPTION
fedmake reads a single mockup file with two sections separated by a marker line and emits a fedform(1) definition. The layout section above the separator carries only the visual geometry; the attributes section below carries field types, validation, colors, and form-level directives. All fields share the [...] bracket shape; field type is declared in the attributes section.

ARGUMENTS

mockup
    Path to the mockup file, or - to read from standard input.

OPTIONS

-j, --json
    Emit JSON form definition instead of the line-oriented default.

-h  Print brief usage and exit.

--help
    Print full help text and exit.

--version
    Print version and copyright information and exit.

MOCKUP FILE FORMAT

  Sections
A line of ten or more = characters starting in column 0 is the section separator. Layout is above, attributes are below. If no separator is present, the entire file is treated as the layout section.

  Layout

[...] field
    Single-row field, width = bracket-to-bracket span. Inside content is purely decorative.

|...| continuation
    Below an open [...] , an aligned |...| row (the | characters in the exact same columns as the opener's [ and ] ) extends the field downward. Continuation rows consume any text on them. Used to size AREA and LIST fields.

SAY labels
    Every contiguous run of non-blank characters on a non-continuation row (separated by 2+ spaces, a field bracket, or end of line) is a SAY label.

  Field Names
Every field receives an ordinal name field_N (1-indexed in source order). If a SAY label is adjacent (same row to the left, or row above with matching start column), its slugified text also names the field and becomes the preferred name.

  Slug Rule
Non-alphanumeric characters become spaces; trim; condense whitespace runs to a single _; lowercase.

Examples:
    First Name: → first_name
    Phone Number: → phone_number
    Order ID #42: → order_id_42

  Attributes
Each non-blank, non-comment line is one of:

<field_name> <tokens>
    A line beginning with a field name (its slugified label name or the ordinal field_N) attaches attribute tokens to that field. Tokens reuse fedform field-option vocabulary, plus fedmake-specific tokens --type, --mask, --maxlen, --rows, --items, --items-file, --v-scroll, --word-wrap.

SAY @<slug> <tokens>
    Attach HIDDEN or COLOR fg,bg to a label.

directive
    Any of DEF, CLS, CLEAR, PUSH, POP, CURSOR is passed through to the generated definition. Directives appearing before the first field-attribute line become pre-form actions; after the last field-attribute line become post-form actions.

  Type Discovery

--mask <spec>
    Declares the field a MASK.

--type area|list|check|radio
    Explicit type override. Default is LINE; default is AREA when continuation rows are drawn.

OUTPUT

stdout
    Line-oriented fedform definition by default, JSON with -j.

exit code
    0 on success, 10 on parse error.

EXAMPLES
# Generate a line-oriented definition
python3 fedmake.py customer.mockup
# JSON output
python3 fedmake.py customer.mockup -j
# Read mockup from stdin
echo '  Name: [____________]' | python3 fedmake.py -
# Full workflow: mockup -> form
python3 fedmake.py customer.mockup > customer.def && python3 fedform.py customer.def

SEE ALSO
fedform(1), fedline(1), fedarea(1), fedmask(1), fedlist(1), fedcheck(1), fedradio(1), fedsay(1), fedbox(1)

AUTHOR
smisco (fed@smisco.biz)

COPYRIGHT
Copyright © 2026 smisco. All rights reserved.