Skip to content

Conversation

@ADTC
Copy link

@ADTC ADTC commented Mar 27, 2021

I request you to add these commits to Shopify#1403 by merging this PR. I think I'd prefer using "rebase merge" (to avoid an ugly merge commit) but it's up to you.

Summary of changes is in each commit message. Please browse the changed documentation here: https://adtc.github.io/liquid/

Review and comments appreciated!

Comment on lines 34 to 46
<pre class="highlight">
<code>{% raw %}
&#123;&#37; raw &#37;&#125;
```liquid
{% raw %}{%{% endraw %} raw {% raw %}%}{% endraw %}
{%- raw -%}
In Handlebars, {{ this }} will be HTML-escaped, but
{{{ that }}} will not.
&#123;&#37; endraw &#37;&#125;
{% endraw %}</code>
</pre>
{% endraw %}
{% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}
```
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be the most peculiar change in this entire PR, IMO - rendering an example of the raw tag using actual raw tags. Someone thought it couldn't be done. I did it! 😆

Another way to do it is: {{ "%7B%+raw+%%7D" | url_decode }}. If there was an unescape filter (there isn't!), that would've been a third way with &#123;&#37; raw &#37;&#125;

@ADTC
Copy link
Author

ADTC commented Mar 28, 2021

Hi again @EricFromCanada in the latest commit fc10dfb, I made changes to categorize the filters using a category key in the markdown files. I didn't move the files so all the URLs remain the same.

image

Also notifying @dylanahsmith to please see the way I categorized filters without changing the URLs: https://adtc.github.io/liquid/

RE: Shopify#1403 and Shopify#1409

PS: It might be best to rebase when accepting PR. Just a suggestion.

@ADTC ADTC force-pushed the gh-pages branch 2 times, most recently from 2c8cc97 to 35b9743 Compare March 30, 2021 01:17
@ADTC
Copy link
Author

ADTC commented Mar 30, 2021

@EricFromCanada I think I'm done with this set of changes. Hope you can take a look and review please?

ADTC added 12 commits June 4, 2021 02:11
In "Whitespace control" page, a new section explains how you can use the liquid tag and echo tag to more elegantly avoid whitespace starting from Liquid 5.0.0

A note has also been added to disclaim that the example output boxes may not have the exact whitespace output expected from the corresponding example input.
Many pages in the Filter section have several Input/Output boxes unnecessarily. Wherever possible, they were consolidated into one set of boxes only.

Some documentation have also been clarified further and expanded where lacking.
In Template, some titles are better worded, and some descriptions are clarified. Unnecessary code blocks are condensed.

In Variable, real code is used to render the examples instead of hard-coded text.
A bit of magic* splits the filters into categories using a new "category" key in the filter markdown files. All the files stay where they are, and all the URLs stay exactly the same!

* The trick is in the various array filters!

Note: All filters must have categories. The "aaa" category is a special category that will put those filters at the top under "Filters".
I think these are better taken out of the String Filters category (which is already lengthy) because they don't belong there. In String category, all filters change the final output of the string. But escape belongs with url_encode because they don't change the final output of string (only its encoding).

As for split, this actually better belongs in the Array Filters category because it splits a string into an array. Those looking for this filter are more likely to be thinking about array manipulation rather than string manipulation.
Scrollbar now scrolls over to the actual link and positions it at the center of sidebar. This is less jarring that scrolling to the section header at the top. The logo is also moved into the scrollable sidebar but made sticky through CSS.

Tested working on both desktop and mobile.
It looked like the filter subheadings like Array Filters were new separate sections in the menu, when it should be a subsection under Filters. This fixes it by changing the boldness and adding an indicative arrow next to the header so that it looks different.
Also apply some DRY principles and minification to the Javascript

The filter type links use Javascript to scroll the menu to the filter section. On mobile it will also open the menu. Pretty cool, huh?
It seems in mobile browsers, the padding is not enough to show the menu properly. The auto-hiding location bar of the browser pushes the menu down when visible.

It looks better with double padding on both desktop and mobile.
A similar expanded note is already in "render with" so just making sure it's also in "render for".
This also removes the emphasised note that is now unnecessary.
@ADTC
Copy link
Author

ADTC commented Jun 3, 2021

Oops! Forgot to close this 😄

Please refer the PR mentioned above.

@ADTC ADTC closed this Jun 3, 2021
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.

1 participant