From 489a03118ce27053fd162f0160e029a2f0af3ba5 Mon Sep 17 00:00:00 2001 From: Julia Boutin Date: Mon, 20 Oct 2025 10:53:01 -0600 Subject: [PATCH] Remove inline snippet specific example files --- Gemfile | 4 -- Gemfile.lock | 74 --------------------------- example/server/parser_attempt.rb | 59 --------------------- example/server/templates/index.liquid | 44 ++-------------- 4 files changed, 3 insertions(+), 178 deletions(-) delete mode 100644 Gemfile.lock delete mode 100644 example/server/parser_attempt.rb diff --git a/Gemfile b/Gemfile index fc327c92..a404c0d4 100644 --- a/Gemfile +++ b/Gemfile @@ -29,7 +29,3 @@ group :test do gem 'rubocop-shopify', '~> 2.12.0', require: false gem 'rubocop-performance', require: false end - -group :development do - gem "webrick" -end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 381c2b7e..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,74 +0,0 @@ -PATH - remote: . - specs: - liquid (5.8.7) - bigdecimal - strscan (>= 3.1.1) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - base64 (0.2.0) - benchmark-ips (2.13.0) - bigdecimal (3.2.3) - json (2.7.2) - language_server-protocol (3.17.0.3) - lru_redux (1.1.0) - memory_profiler (1.0.1) - minitest (5.22.3) - parallel (1.24.0) - parser (3.3.0.5) - ast (~> 2.4.1) - racc - racc (1.7.3) - rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.9.0) - rexml (3.2.6) - rubocop (1.61.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-shopify (2.12.0) - rubocop (~> 1.44) - ruby-progressbar (1.13.0) - stackprof (0.2.26) - strscan (3.1.5) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.5.0) - webrick (1.8.1) - -PLATFORMS - ruby - -DEPENDENCIES - base64 - benchmark-ips - liquid! - lru_redux - memory_profiler - minitest - rake (~> 13.0) - rubocop (~> 1.61.0) - rubocop-performance - rubocop-shopify (~> 2.12.0) - stackprof - terminal-table - webrick - -BUNDLED WITH - 2.5.7 diff --git a/example/server/parser_attempt.rb b/example/server/parser_attempt.rb deleted file mode 100644 index 68e214da..00000000 --- a/example/server/parser_attempt.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -require 'bundler/inline' - -gemfile(true) do - source "https://rubygems.org" - gem 'liquid' -end - -require 'liquid' - -class Parser - def initialize(template) - @template = template - end - - def parse - @parsed_template = Liquid::Template.parse(@template) - end - - def test_parse - document = @parsed_template.root - - variables = [] - - if document.is_a?(Liquid::Document) - body = document.body - - if body.is_a?(Liquid::BlockBody) - body.nodelist.each do |node| - next unless node.is_a?(Liquid::Variable) - - puts node.inspect - variable_name = node.name.name - variables << variable_name - end - end - end - puts "Variables: #{variables}" - end - - def render - @parsed_template.render - end -end - -starter_template = "{{ foo }}" -starter_template_2 = "{{foo}}, {{bar}}" -starter_template_2_1 = "{{ foo }} and {{ bar }}" -starter_template_3 = "{% assign foo = 'bar' %}{{ foo }}" -# Let's start small here -template = <<~LIQUID - {% assign foo = 'bar' %} - {{ foo }} -LIQUID - -parser = Parser.new(starter_template) -parser.parse -parser.test_parse diff --git a/example/server/templates/index.liquid b/example/server/templates/index.liquid index a7a637db..e18cc306 100644 --- a/example/server/templates/index.liquid +++ b/example/server/templates/index.liquid @@ -1,43 +1,5 @@ - - - - - - Inline Snippets +

Hello world!

- -
+

It is {{ date }}

- {% assign foo = true %} - {% assign linktext = "variable" %} - - {% snippet main %} - {% assign foo = false %} -

Hi {{ arg | upcase }}!!!

- -

This is an inline snippet

- - - {% endsnippet %} - - {% render main, arg: 'lsf', ... %} - {{ foo }} - - {% snippet listitem %} -
  • {{ forloop.index }}: {{ emoji }}
  • - {% endsnippet %} - - {% assign emojis = "🌼,🌳,🌸" | split: "," %} - - -
    - - +

    Check out the Products screen