{"repo":"benfaerber/liquid-ml","free":true,"listed":false,"github":"https://github.com/benfaerber/liquid-ml","clone":"git clone https://github.com/benfaerber/liquid-ml.git","description":"Shopify's Liquid templating language in OCaml. Features an interpreter, parser and lexer.","language":"OCaml","stars":51,"topics":["liquid","ocaml","parser-combinators","shopify","template-engine"],"license":"MIT","category":"ecommerce","readme_excerpt":"Liquid ML Shopify's Liquid templating language for the OCaml programming language Featured on Awesome OCaml! Liquid ML was recently added to YOCaml (a great static site generator). Getting Started Install via OPAM: This basic example renders a Liquid file with the default settings. The render is returned as a string. Default Settings: (or use Liquid.render text to render a template stored as string instead of a file) With Settings: Custom Variable Context The variable context provides the template with variables accessible in the global scope. Now we can access these variables from the template: This renders as: We can perform logic operations using our variables: This template renders to: Settings You have access to the following settings: template directory - The directory that contains template files. This is used both for the initial lookup (ie Liquid.render \"yada.liquid\") and for the render tag used within liquid. Default is project root. log directory - Where log files are written to. This must be set if log policy is set to Verbose . error policy: - Strict - A Liquid Syntax error will raise an exception - Warn - A Liquid Syntax error will print an error message - Silent - Errors will be ignored - Custom of (handler: string - unit) - Accepts a custom handler function log policy: - Verbose - Everything will be logged - Minimal - The most important things will be logged - Never - Log nothing filters: - A function that maps filter names to filter functions - string - liqui","default_branch":null,"files":null,"tree":[],"storefront":"/r/benfaerber","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/benfaerber/liquid-ml/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}