SDML(1)
πΈ SDML(1) β User Commands, but make it cute β¨
okay bestie, welcome to the SDML(1) manual page π it lives in the User Commands section, and today we're talking about one specific little icon: sdml view. grab a strawberry drink π and let's go.
π NAME
sdml view β View formatted module source.
like, it literally just shows you your module source, but formatted and cute. periodt.
π SYNOPSIS
sdml view [OPTIONS] [MODULE]
π DESCRIPTION
View formatted module source. π
okay so real talk β this command generates source code from a module file, which at first sounds likeβ¦ why? why would you do that? generating source from source? π but NO, bestie, listen: this view gives you levels of detail, and that's what makes it iconic. it's an overview of your module definitions. the --level argument is the main character here β it lets you elide content and get a bird's-eye view of what's going on in a module. no cap.
- Definitions (default) :: Show only the definitions in the module. any definition body gets elided, so you get a clean overview of the module contents. Elided definitions are followed by
";; ...".
sdml view --level definitions -i examples/example.sdm module
example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string ;; ...
entity Example ;; ...
end
- Members :: Show definitions in the module and show the members of product types and variants of sum types β but not their bodies, if present. it's giving "tell me who's in the group chat but not what they said" π
sdml view --level members -i examples/example.sdm module
example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string ;; ...
entity Example is
version -> Uuid
name -> sdml:string
;; ...
end
end
- Full :: Show all contents of the module. everything. the whole vibe. π₯
sdml view --level full -i examples/example.sdm module
example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string is
@xsd:pattern = "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}"
end
entity Example is
version -> Uuid
name -> sdml:string is
@dc:description = "the name of this thing"@en
end
end
end
Indentation level can also be specified, although the default remains 2 spaces. π«Ά
π§ Arguments:
[MODULE]β the SDML module, loaded using the standard resolver β¨
π OPTIONS
-l,--level <LEVEL>β Possible values:definitions: Top-level definitions, incompletemembers: Top-level definitions and members, incompletefull: Full source
[default: definitions]
-s,--indent-spaces <INDENT_SPACES>β Set the number of spaces for indentation πΈ
[default: 2]
-o,--output <OUTPUT>β File name to write to, or'-'to write to stdout πΎ
[default: -]
-i,--input <INPUT>β Input SDML file name to read from, or'-'to read from stdin π₯
[default: -]
-h,--helpβ Print help (see a summary with'-h') π-V,--versionβ Print version β
π quick vibe check: --level is doing a LOT of heavy lifting in this manpage, so if your output looks "incomplete"β¦ bestie that's literally the feature, not a bug.
and that's the whole page, you ate that π mwah.
this was sdml view version 0.3.2+20250310, dated October 2025, and it belongs to the SDML(1) manual page. go forth and view your modules, queen πβ¨
π¦ where this page comes from
- ubuntu resolute: sdml 0.3.2+20250310-5 Β· Apache-2.0
- ubuntu stonking: sdml 0.3.2+20250310-5 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms