ADD: Add JSON output (-j, --json).

This commit is contained in:
Thomas M. Edwards 2021-02-10 16:22:52 -06:00
parent 33a6da381c
commit 3a8dfb2344
8 changed files with 175 additions and 92 deletions

View file

@ -10,6 +10,12 @@ import (
"encoding/json"
)
type passageJSON struct {
Name string `json:"name"`
Tags []string `json:"tags,omitempty"`
Text string `json:"text"`
}
type passageMetadataJSON struct {
Position string `json:"position,omitempty"` // Twine 2 (`position`) & Twine 1 (`twine-position`).
Size string `json:"size,omitempty"` // Twine 2 (`size`).