https://github.com/verticalsoftware/spectre-viewer
https://github.com/verticalsoftware/spectre-viewer
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/verticalsoftware/spectre-viewer
- Owner: verticalsoftware
- License: mit
- Created: 2023-11-12T21:26:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T22:26:34.000Z (over 2 years ago)
- Last Synced: 2025-02-08T00:28:17.211Z (over 1 year ago)
- Language: C#
- Size: 65.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vertical-spectreviewer
A pageable content viewer that uses spectre console for rendering.
## Quick setup
Install:
```
> dotnet package add vertical-spectreview --preelease
```
Call one of the methods on the `SpectreViewer` class with content you would normally send to SpectreConsole. The example below provides content from a file.
```csharp
// Renders markup found in a file
SpectreViewer.MarkupWithPaging(File.OpenRead("marked-up.txt"));
```
The utility will display the content of the string or stream and let the user page through using `PageUp` and `PageDown` keys.
## A note on input
Recall spectre console markup - `[gold]...[/]`, etc. If you want to use brackets in the rendered content, be sure to properly escape them (e.g. `[[ my-escaped-content ]]`).