docs on :for directive are missing information on index modifiers

Open Beginner friendly
#634 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
elixir
Domain
documentation

Research direction

Start with the :for section at https://surface-ui.org/template_syntax and review the related cases in test/surface/integrations/directives_test.exs around lines 533-535. Document the supported index modifiers and add a few examples based on those tests; the documentation is done when it lists the modifiers and shows how to use them.

Written by the indexing model from the issue text.

Description

https://surface-ui.org/template_syntax

:for - Iterates over a list (generator) and renders the content of the tag (or component) for each item in the list.

But reading the test cases it clearly supports a handful of modifiers for accessing indexes. It would be nice if that was listed in the documentation and a few examples provided.

https://github.com/surface-ui/surface/blob/main/test/surface/integrations/directives_test.exs#L533-L535

Dominant language
Elixir
Stars
2.1k
Forks
146
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from surface-ui/surface

All issues in surface-ui/surface

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.