bkiers / Liqp

An ANTLR based 'Liquid Template' parser and rendering engine.
MIT License
165 stars 94 forks source link

Template parse is deprecated #283

Closed shlomielbaz closed 1 year ago

shlomielbaz commented 1 year ago

Hello all,

the framework says: 'parse(java.lang.String)' is deprecated

I am trying to use the liqp as the following

final Template template = Template
                .parse(HTML)
                .withRenderSettings(renderSettings);

What am I missing?

msangel commented 1 year ago

@shlomielbaz hello! Yes, the API has been changed, but that so far is not reflected in the documentation. Your sample with the latest published library version will be:

final TemplateParser parser = new TemplateParser.Builder()
                                           .withRenderSettings(renderSettings)
                                           .build();
final Template template = parser.parse(HTML);

The working code in the master brunch also has changed in that. RenderSettings object is removed and all its properties are moved into the TemplateParser object directly.

msangel commented 1 year ago

(since no one clearly knows why one settings are declared as rendering, another as parse and some as protected)

shlomielbaz commented 1 year ago

thank you for your quick response, I will try it, Thanks again