Skip to content
Vera Chellgren edited this page Oct 8, 2022 · 9 revisions

The OUTPUT command allows the user to select the output file format for the story. This command is available in YeetWords 1.2.0 and up. With the OUTPUT command, the user may choose md (markdown) or html output. If the OUTPUT command is not used, the program defaults to markdown output.


Syntax

OUTPUT option

where option is either md or html. OUTPUT takes one parameter; it may not be called with zero parameters.

The OUTPUT command applies to all subsequent WRITE commands, as well as NEWLINE, NEWPARA, and NEWCHAPTER. Therefore, the OUTPUT command should be used before the first WRITE, NEWLINE, NEWPARA or NEWCHAPTER command.

The typical use case is to only use the OUTPUT command once in the user program at the start. For example:

OUTPUT html

Note: the user may certainly change output formats within one story by using more than one different OUTPUT command, but this is typically not desirable since only one cohesive format should be needed for the entire story.

Caveats

Be aware that both types of output (md, html) are designed to produce as closely the same result as possible. In other words, the user's specification of the FORMAT command when formatting sentences should give the visually similar results regardless of the value of the OUTPUT command. However, a small subset of the FORMAT letter codes have slight visible differences when they're used in markdown output versus html. These differences are described in the Wiki page for the FORMAT command.

If the OUTPUT command is used more than once in the user program, please be aware that the last OUTPUT command (i.e. the one present at the completion of the story) determines the filename extension of the final file (e.g. .md or .html) If this is undesirable, for example if the user has mixed 2 formats in their user program and wants the other extension after the file is produced, the user will have to change the file extension manually.

Clone this wiki locally