Skip to content

This plugin aims to offer an easy way to use the Jinja2 template engine in Neovim. It utilizes the lupa engine, providing a straightforward method to integrate Lupa into Neovim.

Notifications You must be signed in to change notification settings

you-n-g/jinja-engine.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Jinja Engine for Neovim

Mega-Linter panvimdoc

Motivation of the Plugin

This plugin aims to offer an easy way to use the Jinja2 template engine in Neovim. It utilizes the lupa engine, providing a straightforward method to integrate Lupa into Neovim.

Installation

-- Lazy.nvim
{
  "you-n-g/jinja-engine.nvim",
  dependencies = {
  },
}

Demo

It is common to use you-n-g/jinja-engine.nvim to develop other Neovim plugins. For example, if you have installed you-n-g/jinja-engine.nvim as a dependency of your plugin, like this:

-- Lazy.nvim
{
  "<your-plugin>.nvim",
  dependencies = {
    "you-n-g/jinja-engine.nvim",
  },
}

Then you can use Jinja in your code like this:

print(require('jinja').lupa.expand("hello {{ s }}!", {s = "world"}))
print(require('jinja').lupa.expand("{% for i in {1, 2, 3} %}{{ i }}{% endfor %}"))

More advanced use cases can be found in lupa.

TODO

Development

We welcome contributions to this project.

You can test the plugin in the UI with minimal config using:

  • vim -u tests/init_conf/lazy.lua -U NONE -N -i NONE for lazy.nvim

If you prefer to run tests without a user interface, you can execute make test to initiate the test suite.

Related Projects

About

This plugin aims to offer an easy way to use the Jinja2 template engine in Neovim. It utilizes the lupa engine, providing a straightforward method to integrate Lupa into Neovim.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published