Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
In this article, we are going to take a look at a CLI tool called svpug for generating Pug mixins from SVG files. Before diving into the main content let's some context first.
Your SVG files will be converted to Pug mixins by parsing the SVG files using svgson and taking only the root SVG element and converting it in Pug format and the body of the SVG file will be kept intact inside the mixin.
svpug is inspired by svgr which is the standard way of creating React components from SVGs.
In this article, we are going to take a look at a CLI tool called svpug for generating Pug mixins from SVG files. Before diving into the main content let's some context first.
Pug is a clean, whitespace sensitive syntax for writing HTML. It is a robust, elegant, feature rich template engine for Node.js. It's most widely used in Express.js applications in Node. It has got a terse syntax and packed with a lot of advanced capabilities for templating libraries like partials, layouts, and mixins.