Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Add support for the paginate tag #76

Merged
merged 1 commit into from
Aug 19, 2022
Merged

Add support for the paginate tag #76

merged 1 commit into from
Aug 19, 2022

Conversation

charlespwd
Copy link
Collaborator

@charlespwd charlespwd commented Aug 12, 2022

In this PR

  • Add support for the paginate liquid tag
  • rename the ohm rule renderArguments -> tagArguments, because it starts to look like the comma-less pattern is repeated

Decisions

  • Echoing Add support for form liquid tags #75, {% paginate $collection on the first line
  • MAYBE break by $size if really indented far
  • MAYBE break window_size: X (undocumented feature) (and join with commas)
  • %} on empty line if breaking

Examples

It takes a collection and a pageSize
{% paginate collection by pageSize %}{% endpaginate %}

It breaks on by pageSize when printWidth is hit
printWidth: 1
{% paginate collection
  by pageSize
%}
  {{ collection }}
{% endpaginate %}

It is undocumented, but it also accepts named attributes (window_size). Those are comma separated.
printWidth: 80
{% paginate collection by pageSize, window_size: 50, attr: (0..2) %}
  {{ collection }}
{% endpaginate %}

It is undocumented, but it also accepts named attributes (window_size). We print
those comma separated and on a new line when it breaks.
printWidth: 1
{% paginate collection
  by pageSize,
  window_size: 50
%}
  {{ collection }}
{% endpaginate %}

Demo on dawn (no change... 👍)

Fixes #61

@charlespwd charlespwd linked an issue Aug 12, 2022 that may be closed by this pull request
@charlespwd charlespwd requested a review from a team August 12, 2022 16:00
Base automatically changed from fix/60-form-tag to main August 19, 2022 17:32
@charlespwd charlespwd merged commit 8d78dd5 into main Aug 19, 2022
@charlespwd charlespwd deleted the fix/61-paginate-tag branch August 19, 2022 17:32
@shopify-shipit shopify-shipit bot temporarily deployed to production August 26, 2022 14:08 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prettier Liquid: paginate
2 participants