Skip to content

feat: Add Solid.Tag.put/3 and remove/2 helpers#173

Open
google-labs-jules[bot] wants to merge 2 commits intomainfrom
feature/add-tag-helpers
Open

feat: Add Solid.Tag.put/3 and remove/2 helpers#173
google-labs-jules[bot] wants to merge 2 commits intomainfrom
feature/add-tag-helpers

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change introduces two new helper functions to the Solid.Tag module: put/3 and remove/2. These functions provide a more convenient and fluent way to manipulate the map of tags used by the Solid parser.

This commit introduces two new helper functions to the `Solid.Tag` module: `put/3` and `remove/2`. These functions provide a more convenient and fluent way to manipulate the map of tags used by the Solid parser.

- `Solid.Tag.put/3`: Adds a new tag to the tags map.
- `Solid.Tag.remove/2`: Removes a tag from the tags map.

Both functions accept either an atom or a string as the tag name, providing more flexibility to the developer.

This change allows for a more readable and chainable syntax for customizing tags, as requested in the original issue. For example:

```elixir
Solid.Tag.default_tags()
|> Solid.Tag.put(:current_line, CustomTags.CurrentLine)
|> Solid.Tag.remove(:comment)
```
This commit updates the `README.md` file to use the new `Solid.Tag.put/3` and `Solid.Tag.remove/2` helper functions in the examples for adding and removing custom tags. This makes the documentation more consistent with the new, more fluent API.
@edgurgel edgurgel marked this pull request as ready for review August 8, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants