https://github.com/goports/svelte-plus
Svelte+ is a Svelte tool written in TypeScript to make building a website easier
https://github.com/goports/svelte-plus
developer-tool svelte sveltekit tool typescript website website-tool
Last synced: about 1 month ago
JSON representation
Svelte+ is a Svelte tool written in TypeScript to make building a website easier
- Host: GitHub
- URL: https://github.com/goports/svelte-plus
- Owner: GoPorts
- License: apache-2.0
- Created: 2024-12-14T17:19:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T10:16:34.000Z (over 1 year ago)
- Last Synced: 2025-02-26T22:18:02.190Z (over 1 year ago)
- Topics: developer-tool, svelte, sveltekit, tool, typescript, website, website-tool
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# About
Pages:
[How to use](https://github.com/GoPorts/Svelte-Plus/README.md#how-to-use)
[Code](https://github.com/GoPorts/Svelte-Plus?tab=readme-ov-file#code)
Svelte+ was coded in [StackBlitz](https://stackblitz.com) with its build in Svelte kit.
Svelte plus will create Svelte code with simple and short terms.
Svelte plus is a programming tool made to build a website easier with little to no effort.
Svelte plus is not accosiated in any way with the official Svelte.
Svelte plus is also in development
Svelte plus has been tested and might give you double-code, where it gives you two of the exact same code.
# How to use
1, 2, 3, 4, 5, stands for h1, h2 and so on.
!addcss, adds css.
!addscript, adds javascript to the Svelte code.
bgc , will add a background color if css code is added.
ff , ff is a short term of family font, i recommend sans-serif if you want a nice font.
img , after typing img, put the image link.
# Code
```ts
let svelte = `
1 Thank you for using Svelt-Plus,
2 making developing websites easier.
!addcss
ff sans-serif
bg grey
`;
let imgsrc = '';
let font = '';
let sveltecss = '';
let sveltecode = '';
let svelteSCRIPTADD = 'console.log("Added script");';
const lines = svelte.split('\n').map(line => line.trim()).filter(line => line);
lines.forEach((line) => {
if (line.startsWith('!addscript')) {
sveltecode += `${svelteSCRIPTADD}\n`;
}
if (line.startsWith('1 ')) {
const content = line.substring(2).trim();
sveltecode += `
${content}
\n`;
}
if (line.startsWith('2 ')) {
const content = line.substring(2).trim();
sveltecode += `
${content}
\n`;
}
if (line.startsWith('img ')) {
imgsrc = line.substring(4).trim();
sveltecode += `
\n`;
}
if (line.startsWith('bg ')) {
const bgColor = line.substring(3).trim();
sveltecss += ` background-color: ${bgColor};\n`;
}
if (line.startsWith('ff ')) {
font = line.substring(3).trim();
sveltecss += ` font-family: ${font};\n`;
}
if (line.startsWith('!addcss')) {
sveltecode += `\nbody {\n${sveltecss}}\n\n`;
}
});
console.log(sveltecode);
console.log(sveltecss);
```