What the editor URL preset is for
Treease uses query parameters on the editor route to prefill source text, open a right-side preview, trigger common commands, and adjust the visible shell around the editor. This makes the editor easier to share in documentation, support links, internal runbooks, and SEO landing pages.
The URL preset is especially useful when you want to show a user a concrete starting point instead of asking them to paste data by hand. You can send a link that opens Treease with source text already present, a comparison view already visible, or a preset yq expression ready to run.
Parameters that set source text
These parameters control what appears in the main source editor.
Sets the source editor text directly from the query string.
/editor?lang=json&text={"hello":"world"}
Use this when the payload is short enough to live comfortably in the URL itself.
Fetches source text from a URL and loads the fetched response into the source editor.
/editor?textUrl=https://raw.githubusercontent.com/loggerhead/treease-testdata/refs/heads/main/json/complex.1.json
This is best when the source document is too large or too dynamic to inline in the URL.
Sets the editor language used for the imported source text.
/editor?lang=yaml&text=service: api port: 8080
Use this when the file format should be explicit instead of inferred from context.
Parameters that control the right-side preview
These parameters prepare the preview pane for compare or reference workflows.
Sets the text shown in the right-side preview editor.
/editor?lang=json&text={"left":1}&rightText={"right":2}
Use this when you want a second document visible immediately for manual inspection or compare.
Fetches preview text from a URL and shows the fetched response in the right-side preview.
/editor?rightTextUrl=https://raw.githubusercontent.com/loggerhead/treease-testdata/refs/heads/main/json/complex.1.json
This works well for linking a live or hosted baseline file into a compare workflow.
Parameters that run editor actions
These parameters ask Treease to do work after the editor opens.
Runs a built-in editor action such as format, minify, sort, escape, unescape, or compare.
/editor?ui=viewer&text={"b":2,"a":1}&command=format
This is useful for task-oriented landing pages like “format JSON online” or “compare JSON online”.
Runs a yq preview expression against the current source document.
/editor?text={"service":{"port":8080}}&yq=.service
This is helpful when the tutorial needs to demonstrate extracting or transforming a structured subset.
Parameters that shape the editor shell
These parameters control how much of the interface is visible and how the parser behaves.
Controls whether the editor pane, viewer pane, top bar, and bottom bar are visible.
/editor?ui=editor,viewer,topbar,bottombar
Use this to create focused landing pages, such as viewer-only format pages or cleaner embedded docs demos.
Toggles nested JSON parsing behavior in the parser settings.
/editor?text={"payload":"{\"ok\":true}"}&nest=true
This is relevant when the source includes JSON serialized inside a string field.
Controls whether smart formatting stays enabled for the prepared editor session.
/editor?text={"compact":true}&autoFormat=false
Use this when a tutorial should preserve exact source layout instead of normalizing it automatically.
Example landing-page patterns
- Use `text` plus `command=format` for a “format JSON online” landing page.
- Use `text` plus `command=minify` for a “minify JSON” landing page.
- Use `text` plus `rightText` plus `command=compare` for a “compare JSON” landing page.
- Use `textUrl` for docs or support pages that should load a maintained remote sample instead of a hard-coded payload.
- Use `ui=viewer` when the page should feel like a focused tool flow rather than a full workspace.