User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:link-show

This is an old revision of the document!


(link-show: String, …HookName) → Command

Creates a link that, when clicked, shows the given hidden hooks, running the code within.

Example usage:

But those little quirks paled before (link-show: "her darker eccentricities.", ?twist)

Rationale:

As discussed in the documentation for (show:), that macro is intended as a complement to (click-replace:) (or perhaps (click-append:)). While both let you insert text at a location when a link is clicked, they differ in whether they let the author write the initial text or the replacement text at the location when coding the passage.

Typical (click-append:) usage resembles the following, where the inserted text provides supplementary content to the passage's prose, and is written separately from it:

Ah. You remember her eldest well - [a frail, anxious child]<more|. Unlikely to raise too much of a fuss. (click-append: ?more)[, constantly frowning, mumbling every word they utter, flinching at the slightest noise]

Conversely, typical (show:) usage resembles the following, where the inserted text is a continuation of the passage's prose, and is written together with it:

"Look, it's important to comment even the simplest code...|more)[ You might remember what it does now, but not at 4:50 PM on Friday afternoon, when you're about to push to production and a runtime error shows up in it.]" You (link-reveal:"struggle to listen.")[(show: ?more)]

The (link-show:) macro provides a convenient shorthand for the latter example, letting you write the final line as You (link-show: "struggle to listen.", ?more).

Details:

As with most link macros, providing this with an empty link text string will result in an error.

As with (show:) and (click:), providing this with a hook which is already visible, or which doesn't even exist, will NOT produce an error, but simply do nothing.

See also:

harlowe/link-show.1555397371.txt.gz · Last modified: 2019/04/16 02:49 by l