Skip to content

Commit 4cfb4cd

Browse files
committed
Document commands
1 parent 99cf15a commit 4cfb4cd

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

lib/node_modules/@stdlib/repl/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,48 @@ Stops logging commands and printed output to a file path associated with a speci
704704
// TODO
705705
```
706706

707+
#### presentationStart( \[text, ]\[options] )
708+
709+
Starts a REPL [presentation][@stdlib/repl/presentation].
710+
711+
```text
712+
In [1]: var id = presentationStart( 'beep\n---\nboop\n' );
713+
```
714+
715+
The function accepts the following `options`:
716+
717+
- **borderTop**: top border character sequence. Default: `'*'`.
718+
- **borderBottom**: bottom border character sequence. Default: `'*'`.
719+
- **borderLeft**: left border character sequence. Default: `'* '`.
720+
- **borderRight**: right border character sequence. Default: `' *'`.
721+
- **counter**: slide counter. Can either be `true`, `false`, or `'progress'`. Default: `false`.
722+
- **width**: [presentation][@stdlib/repl/presentation] width. If `null`, the [presentation][@stdlib/repl/presentation] width is either computed based on the screen size (if a REPL output stream is TTY) or set to `80` characters. Default: `null`.
723+
- **height**: [presentation][@stdlib/repl/presentation] height. If `null`, the [presentation][@stdlib/repl/presentation] height is either computed based on the screen size (if a REPL output stream is TTY) or set to `25` rows. Default: `null`.
724+
- **workspace**: REPL workspace name. A [presentation][@stdlib/repl/presentation] adds commands to the specified workspace, thus allowing [presentation][@stdlib/repl/presentation] navigation and interaction. Default: `'presentation-<n>'`, where `n` is an assigned [presentation][@stdlib/repl/presentation] identifier.
725+
- **load**: file path specifying a [presentation][@stdlib/repl/presentation] file to load. If presentation `text` is provided, this option is **ignored**. Otherwise, this option is **required**.
726+
- **watch**: `boolean` indicating whether to watch a [presentation][@stdlib/repl/presentation] source file for changes. This option is only applicable if not provided presentation `text` and the `options` object specifies a presentation file to load. Default: `false`.
727+
- **autoClear**: `boolean` indicating whether to automatically clear the screen before writing a rendered slide to the REPL. Default: `true`.
728+
729+
A few notes:
730+
731+
- When not provided presentation `text`, an options argument **must** specify a presentation file to load.
732+
- If a specified workspace already exists, the workspace is silently cleared and a new [presentation][@stdlib/repl/presentation] bound. In order to preserve an existing workspace, specify an alternative presentation workspace name.
733+
734+
#### presentationStop( \[id] )
735+
736+
Stops a REPL [presentation][@stdlib/repl/presentation].
737+
738+
```text
739+
In [1]: var id = presentationStart( 'beep\n---\nboop\n' );
740+
741+
In [2]: presentationStop();
742+
```
743+
744+
A few notes:
745+
746+
- If provided a presentation identifier, the corresponding [presentation][@stdlib/repl/presentation] is stopped. Otherwise, assuming the function is invoked in a presentation workspace, the current [presentation][@stdlib/repl/presentation] is stopped.
747+
- When stopping a REPL [presentation][@stdlib/repl/presentation], the presentation's REPL workspace is both **cleared** and **deleted**.
748+
707749
#### quit()
708750

709751
Exits the REPL.
@@ -1133,6 +1175,8 @@ $ stdlib-repl
11331175

11341176
[@stdlib/streams/node/stdout]: https://github.com/stdlib-js/stdlib
11351177

1178+
[@stdlib/repl/presentation]: https://github.com/stdlib-js/stdlib
1179+
11361180
</section>
11371181

11381182
<!-- /.links -->

0 commit comments

Comments
 (0)