Modified Svelte Official Template Starter for writing code in Pug.js for markup, CoffeeScript for script and Stylus for style
Apart from the Svelte Official Template Starter this repo has the following features:
:globe_with_meridians: Svelte PreProcessor that includes support for many of the alternative languages that compiles down to the standard HTML, Javascript (ES6+) and CSS
:dog: Pug.js that gets rid of the brackets of HTML
:coffee: CoffeScript that unclutters script
:pen: Stylus that does the same for style
:eye: VS Code snippets for shortcuts to often used code blocks with the above languages in Svelte (so that you don't need to remember the special syntax)
I'm a bit lazy and I like my code simple, tidy and neat. That's why Svelte is such a joy!
But why stop there? With the Svelte preproccesor you can use Pug.js for markup, CoffeeScript for script and Stylus for style
Why Pug, CoffeeScript and Stylus you might ask. Pug takes away the brackets, uses indention for markup logic and is in my opinion clean code. Coffeescript does the same with coding script logic and Stylus also for style.
Like may others I use VS Code code editor. Besides being totally free it has a lot of extendability features and a large ecosystem of plugins. This repo is adapted to use with VS Code, but it's your choice if you do.
As some sugar on top I've added a few snippets for VS Code to get you started even faster:
s-t-pug-cs-styl - adds a Svelte File Template for PugJS as markup language, CoffeeScript for script and Stylus for style
s-pug-if - adds a Svelte IF block Pug-style
s-pug-if-else - adds a Svelte IF-ELSE block Pug-style
s-pug-for - adds a Svelte FOR block Pug-style
s-pug-each - adds a Svelte EACH block Pug-style
s-pug-key - adds a Svelte KEY block Pug-style
s-pug-await - adds a Svelte AWAIT block Pug-style
s-pug-then - adds a Svelte THEN block Pug-style
s-pug-catch - adds a Svelte CATCH block Pug-style
s-pug-html - adds a Svelte HTML block Pug-style
s-pug-debug - adds a Svelte DEBUG block Pug-style
more will come before 1.0 release
While the three featured languages in this starter template are supported in Svelte PreProcessor, not all their syntax will be recognised as valid in VS Code with the official svelte plugin. To escape any faulty nagging error messages you can turn of typescript diagnostics for the svelte plugin
Svelte > Plugin > Typescript > diagnostics
Thanks to @dummdidumm on Svelte Discord #language-tools for this soloution
Do take a look at main.js and App.svelte files inside src/ to get a glimse of how your code could come to look. Neat, isn't it? :smiley:
npx degit killawabbit/svelte-pug-cs-styl svelte-is-awesome
cd svelte-is-awesome
npm install
npm run dev
👤 Henrik Våglin
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator