Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Updating examples to clarify and simplify

Open patrickkelso opened this issue 2 years ago • 3 comments

I spent a lot of time trying to figure out the syntax for using throw_on_cancel because there was no example added when the feature was.

I've also updated the examples so each one explains a little of what it does making it easier to identify a use case. I think this will make the documentation a lot more accessible to non programmers.

patrickkelso avatar Jun 18 '22 06:06 patrickkelso

Hey while you're on this, can you modify the docs to make the examples be part of the function's section instead of being jumbled together at the end?

AB1908 avatar Jun 18 '22 07:06 AB1908

The docs should be generated on release. @patrickkelso please add these examples to the documentation.toml file under the appropriate header. example:

[tp.system.functions.prompt]
name = "prompt"
description = "Spawns a prompt modal and returns the user's input."
definition = "tp.system.prompt(prompt_text?: string, default_value?: string, throw_on_cancel: boolean = false)"
example = "<% tp.system.prompt("Please enter a value") %>"

shabegom avatar Sep 01 '22 13:09 shabegom

Understood. I'll update asap.

patrickkelso avatar Sep 01 '22 19:09 patrickkelso

Doing some cleanup, please reopen if you'd still like to contribute!

Zachatoo avatar Mar 09 '24 03:03 Zachatoo