Skip to content

Hints for blanks? #29

@emhoracek

Description

@emhoracek

One of the things that seems to be confusing about Heist/Larceny is that all the tags look the same. A regular HTML tag looks just like a Blank, and all Blanks look the same, whether they represent a list, object, or text field.

In Heist, you could have a "namespace" for your Splices, so Heist tags would look like <h:someSplice>. Having a prefix of some sort could help with distinguishing a Blank that happens to be called address from an address tag.

I think it would also be nice to have sort of "type hints" for Blanks?

You can usually tell if a Blank has a text Fill because those are self-closing tags. Even then, a user might think that some Blank, maybe <author>, has a text Fill even though it's actually got children, and then the user's confused about why <author /> doesn't render. So that's bad enough. But when it comes to telling lists from objects, we tend to rely on using plural names for Blanks to indicate something is a list. But that doesn't necessarily help:

<moose>
  <name />
</moose>

Is this going to print the name of a certain moose or the name of 20 moose? It's impossible to tell just from the template.

So maybe prefixes could hint at a type, like, <ll:someList>. If someList is a Blank but the Fill isn't a list, then the user gets a clue via a warning in their console.

I don't know how Larceny would be able to tell if a Fill is for a list though... 🤔

An alternative may be to develop a tool for automatically generating documentation from Substitutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions