mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-25 18:49:50 -04:00
MAINT: Documentation updtes for the output statement.
This commit is contained in:
parent
c9180dffeb
commit
be4feb12ba
20
src/lib.rs
20
src/lib.rs
@ -425,10 +425,22 @@
|
|||||||
//!
|
//!
|
||||||
//! * Out statement
|
//! * Out statement
|
||||||
//!
|
//!
|
||||||
//! The out statement defined the output for a UCG file. It identifies an expression that will be output as a
|
//! The out statement defines the output for a UCG file. It identifies the output converter type and an
|
||||||
//! compiled artifact by the UCG compiler was well as the artifact type. The artifact type is expected to be one
|
//! expression that will be output. The output converter type is expected to be one of the registered converters
|
||||||
//! of the registered converters (e.g. json, exec) and the artifact file will take the same name as the ucg file
|
//! (e.g. json, exec) and the artifact file will take the same name as the ucg file with the extension replaced by
|
||||||
//! with the extension replaced by the defined extension for that converter.
|
//! the defined extension for that converter.
|
||||||
|
//!
|
||||||
|
//! For a file named api_config.ucg with the following contents:
|
||||||
|
//!
|
||||||
|
//! ```ucg
|
||||||
|
//! let myconf = {
|
||||||
|
//! api_url = "https://example.org/api/v1/",
|
||||||
|
//! api_token = env.API_TOKEN,
|
||||||
|
//! };
|
||||||
|
//! out json myconf;
|
||||||
|
//! ```
|
||||||
|
//!
|
||||||
|
//! ucg will output the myconf tuple as json to a file called api_config.json
|
||||||
//!
|
//!
|
||||||
//! ### Converters
|
//! ### Converters
|
||||||
//!
|
//!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user