Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Self-named hook instead of repeating words

I know I can name passages like this
[[passage]]
or
[[passage|passage]]
but why all named hooks have to be named? Eg:
You have to get your [keys]<keys|, your [mobile]<mobile| and your [wallet]<wallet|. You gotta |walk>[walk] and then |leave>[leave] the apartment.

(click: ?keys)[GOTCHA]
(click: ?mobile)[DONE]
(and so forth)
Isn't there a way to save time and space using named hooks, like the self-named passages? Something like this:
You have to get your [keys], your [mobile] and your [wallet]. You gotta [walk] and then [leave] the apartment.

(click: ?keys)[GOTCHA]
(click: ?mobile)[DONE]
(and so forth)

Comments

  • While this may be a good idea for one-word hooks, the reality is, hooks can be more than one word.

    also you might have two hooks with the content 'keys' in them, but you want them to do different  things when you click on them
  • PotatoPhil wrote:

    While this may be a good idea for one-word hooks, the reality is, hooks can be more than one word.

    also you might have two hooks with the content 'keys' in them, but you want them to do different  things when you click on them


    Yes, I agree.
    Maybe keep the named hooks and make a self-named hook? Like:
    [keys]
    becomes the hook keys.
    |keys>[keys] too.
    But I can have [keys], |keys1>[keys] and |keys2>[keys]
    and the names become ?keys, ?keys1 and ?keys2.
  • What happens if the Author likes to use square brackets in their writing?

    In your example every time the program saw a pair of square brackets it would think it was a hook instead of only when it found either a (macro:) or a <named tag] next to them.
  • greyelf wrote:

    What happens if the Author likes to use square brackets in their writing?


    Enclose them in backticks (e.g. `[not-a-hook]`), I suppose.

    As another option, perhaps instead of omitting the hook tag completely, one could merely leave it empty.  For example:

    [hooky1]<| or |>[hooky2]
    The empty tag would signify that it's a self-naming hook (or whatever this thing would be called).
  • angelodias wrote:

    I know I can name passages like this
    [[passage]]
    or
    [[passage|passage]]
    but why all named hooks have to be named? Eg:
    You have to get your [keys]<keys|, your [mobile]<mobile| and your [wallet]<wallet|. You gotta |walk>[walk] and then |leave>[leave] the apartment.

    (click: ?keys)[GOTCHA]
    (click: ?mobile)[DONE]
    (and so forth)
    Isn't there a way to save time and space using named hooks, like the self-named passages? Something like this:
    You have to get your [keys], your [mobile] and your [wallet]. You gotta [walk] and then [leave] the apartment.

    (click: ?keys)[GOTCHA]
    (click: ?mobile)[DONE]
    (and so forth)
    You can actually currently write this:
    You have to get your keys, your mobile and your wallet. You gotta walk and then leave the apartment.

    (click: "keys")[GOTCHA]
    (click: "mobile")[DONE]
    By supplying a string to the (click:) macro, it will target all instances of the word "keys" etc. in the passage text. This is called a "pseudo-hook". I haven't documented this for two reasons: 1) I forgot, and 2) until about 2.0.1 its implementation was a little shaky. But it should be good to go in 2.0.2.
  • Good god, you could use that to make some esoteric version of minesweeper  :o
  • TheMadExile wrote:

    As another option, perhaps instead of omitting the hook tag completely, one could merely leave it empty.  For example:

    [hooky1]<| or |>[hooky2]
    The empty tag would signify that it's a self-naming hook (or whatever this thing would be called).


    This looks nice!

    L wrote:

    You can actually currently write this:
    You have to get your keys, your mobile and your wallet. You gotta walk and then leave the apartment.

    (click: "keys")[GOTCHA]
    (click: "mobile")[DONE]
    By supplying a string to the (click:) macro, it will target all instances of the word "keys" etc. in the passage text. This is called a "pseudo-hook". I haven't documented this for two reasons: 1) I forgot, and 2) until about 2.0.1 its implementation was a little shaky. But it should be good to go in 2.0.2.


    This looks nice but if there's two "keys" words in the text? Will it interfere with other panels if I used (display:) before?
Sign In or Register to comment.