Transform your structured YAML, JSON, XML, CSV or FrontMatter data into beautiful, fully-customized HTML pages or plain text in seconds with Expressif.LanguageServer. This command-line tool seamlessly generates renders from data files using your preferred templates through Scriban, Handlebars, DotLiquid, Fluid, StringTemplate or SmartFormat. Whether you're building static sites, documentation, or reporting tools, Expressif.LanguageServer makes it easy to turn raw data into polished, web-ready content.
About | Installing | Quickstart
Continuous integration builds:
- Navigate to the GitHub repository of the project.
- Go to the Releases section, usually found under the "Code" tab.
- Download the
.zipfile containing the executable from the desired release.
Example:
https://github.com/Seddryck/Expressif.LanguageServer/releases/latest/
- Right-click the downloaded
.zipfile and choose Extract All. - Extract the contents to a directory of your choice, such as
C:\Program Files\Expressif.LanguageServer.
Tip: Choose a path that is easy to remember and doesn't contain special characters.
To run the executable from any location in the command line, you need to add its folder to your system's PATH.
- Open the Start Menu and search for Environment Variables.
- Click Edit the system environment variables.
- In the System Properties window, click Environment Variables.
- In the System Variables section, scroll down, select Path, and click Edit.
- In the Edit Environment Variable dialog, click New and enter the path to your extracted folder, e.g.,
C:\Program Files\Expressif.LanguageServer. - Click OK to close all windows.
- Open Command Prompt (CMD).
- Type
Expressif-LanguageServer.exeand hit Enter. - If everything is set up correctly, the program should run.
Expressif.LanguageServer is a command-line tool designed for generating files based on templating. It supports YAML, JSON, and XML as source data formats and provides flexibility in templating through both Scriban, Liquid, Handlebars, StringTemplate and SmartFormat templates languages. With Expressif.LanguageServer, you can easily automate file generation by combining structured data from YAML, JSON, or XML files with customizable templates using Scriban or Liquid.
- YAML: Files with the
.yamlor.ymlextension are parsed using a YAML source parser. - JSON: Files with the
.jsonextension are parsed using a JSON source parser. - XML: Files with the
.xmlextension are parsed using an XML source parser. - CSV: Files with the
.csvextension are parsed using an CSV source parser. The CSV dialect can be described using the-Poption (see below). - FrontMatterMarkdown: Files with the
.mdextension are parsed using an YAML parser for the FrontMatter and the Markdown content is added in the entry content. - FrontMatter: using an YAML parser for the FrontMatter, the Markdown content is not appended to the result.
Expressif.LanguageServer utilizes some templating engines, which allow for powerful and flexible templating.
- Scriban: Templates with the
.scribanextension are parsed using a Scriban template engine. Scriban is a lightweight and fast template engine with rich support for multiple output formats.- Highly performant, designed to handle large-scale template processing.
- Supports customizable scripting with rich expressions and filters.
- Can work with JSON and YAML data sources.
- Typical Use Case: Config file generation, reports, email templates, or any templating scenario not tied to a specific web framework.
- Liquid: Templates with the
.liquidextension are parsed using a dotLiquid template engine. DotLiquid is a .NET port of the Liquid templating engine used by platforms like Shopify.- Secure (no access to system objects), making it ideal for user-generated templates.
- Allows both dynamic and static templating.
- Supports filters, tags, and various control flow structures.
- Typical Use Case: SaaS applications, dynamic content rendering, email templates.
- Handlebars: Templates with the
.hbsextension are parsed using a Handlebars template engine. Handlebars C# port of the popular JavaScript Handlebars templating engine.- Simple syntax for generating HTML or text files from templates.
- Support for helpers, partial templates, and block helpers.
- Good separation of logic from presentation.
- Typical Use Case: Email templates, reports, and content generation.
- SmartFormat: Templates with the
.smartextension are parsed using a SmartFormat template engine. SmartFormat.Net is a A lightweight templating engine primarily used for string formatting.- Provides more advanced formatting capabilities than standard string formatting in C#.
- Supports nested templates, conditional formatting, and more.
- Typical Use Case: Log messages, report generation, and dynamic text formatting.
- StringTemplate: Templates with the
.stand.stgextension are parsed using the StringTemplate engine. StringTemplate is a powerful template engine specifically designed to enforce strict separation of logic from presentation.- Focused on generating structured text, such as code, XML, and reports.
- Strong emphasis on enforcing Model-View separation.
- Supports conditionals, loops, and automatic escaping to prevent security issues.
- Typical Use Case: Code generation, configuration files, and situations where strict separation between logic and template is required.
The command to run Expressif.LanguageServer is simply expressif.LanguageServer. When executing it, you need to provide three required arguments:
-t, --template(required): Specifies the path to the Scriban, Liquid, Handlebars, StringTemplate or SmartFormat template file.-s, --source: Specifies the path to the source data file, which can be in YAML, JSON, or XML format. If this argument is not provided, the data will be read from the console input. In such cases, the-r, --parseroption becomes mandatory.-o, --output: Specifies the path to the output file where the generated content will be saved. If not provided, the output will be displayed directly in the console.
Example:
expressif.LanguageServer -t template.scriban -s data.yaml -o page.htmlIn this example:
template.scribanis the Scriban template file.data.yamlis the source file containing the structured data in YAML format.page.htmlis the output file that will contain the generated content.
- Shortcut:
-t - Long:
--template - Description: Specifies the path to the template file.
- Accept: single value.
- Mandatory: yes.
- Example:
-t path/to/templateor--template=path/to/template
- Shortcut:
-e - Long:
--engine - Description: Specifies the template engine to use (scriban, fluid, dotliquid, handlebars, smartformat, stringtemplate).
- Accept: single value. When omitted Expressif.LanguageServer will select the engine based on the extension of the template file.
- Example:
-e fluidor--engine=fluid
- Shortcut:
-x - Long:
--engine-extension - Description: Specifies additional or replacing association between a file extension and an engine for automatic detection
- Accept: multiple key-value pairs.
- Mandatory: no.
- Example:
-x txt:handlebars;liquid:fluidor--engine-extension=.txt:handlebars;liquid:fluid
- Shortcut:
-s - Long:
--source - Accept: single value or multiple key-value pairs.
- Description:
- if single value is provided, it specifies the path to the source file. If omitted, input can be taken from StdIn.
- if multiple key-value pairs are provided, each of them specifies a part of the model and the key representing the tag in the model.
- Exclusive: can't be set with the parameter
--StdIn - Example:
-s path/to/sourceor--source=path/to/sourceor--source=foo:path/to/source1;bar:path/to/source1
- Shortcut:
-r - Long:
--parser - Description: Specifies the parser to use (YAML, JSON, XML).
- Accept: single value.
- Mandatory: no expect if
--stdinis specified. When omitted Expressif.LanguageServer will select the parser based on the extension of the source file - Example:
-r YAMLor--parser=YAML
- Shortcut:
-X - Long:
--parser-extension - Description: Specifies additional or replacing association between a file extension and a parser for automatic detection
- Accept: multiple key-value pairs.
- Mandatory: no.
- Example:
-X txt:yaml;dat:jsonor--parser-extension=txt:yaml;dat:json
- Shortcut:
-P - Long:
--parser-parameter - Description: Specifies parameters tuning the behavior of the parser
- Accept: multiple key-value pairs, prefixed by the file's extension followed by an arobas (
@). - Mandatory: no.
- Example:
-P csv@delimiter=^;csv@commentChar=#
- Shortcut:
-i - Long:
--stdin - Description: Specifies the input to the source data as coming from the StdIn.
- Accept: switch value.
- Exclusive: can't be set to true with the parameter
--sourceand must specified to false when--sourceis not provided. - Example:
-ior--stdinor--stdin false
- Shortcut:
-o - Long:
--output - Description: Specifies the path to the generated output file. If omitted, output is rendered to StdOut.
- Accept: single value.
- Mandatory: no.
- Example:
-o path/to/outputor--output=path/to/output
expressif.LanguageServer -t template.scriban -s data.yaml -o page.htmlIn this example:
template.scribanis the Scriban template file.data.yamlis the source file containing the structured data in YAML format.page.htmlis the output file that will contain the generated content.
CMD:
type "data.json" | expressif.LanguageServer --stdin -t template.hbs -r jsonPowerShell:
Get-Content data.json | expressif.LanguageServer --stdin -t template.hbs -r jsonBash:
cat data.json | expressif.LanguageServer --stdin -t template.hbs -r jsonIn this example:
- The input data is coming from the console
template.hbsis the Handlebars template file.jsonis the parser of input data.- the output is redirected to the console.
Make sure that the template file and source file are correctly formatted and aligned with your data model to produce the desired result.
