psvg

所属分类:图形图象
开发工具:TypeScript
文件大小:448KB
下载次数:0
上传日期:2023-01-23 16:17:47
上 传 者sh-1993
说明:  可编程可缩放向量图形——绘制自己的图形
(Programmable Scalable Vector Graphics -- drawings that draw themselves)

文件列表:
.prettierignore (5, 2020-12-01)
.prettierrc (85, 2020-12-01)
QUICKSTART.md (6601, 2020-12-01)
bin (0, 2020-12-01)
bin\psvg.js (280, 2020-12-01)
examples (0, 2020-12-01)
examples\helloworld.psvg (597, 2020-12-01)
examples\helloworld.svg (13939, 2020-12-01)
examples\hilbert.psvg (1333, 2020-12-01)
examples\hilbert.svg (5705, 2020-12-01)
examples\koch.psvg (1008, 2020-12-01)
examples\koch.svg (309054, 2020-12-01)
examples\poisson.psvg (2662, 2020-12-01)
examples\poisson.svg (365045, 2020-12-01)
examples\pulsar.psvg (3409, 2020-12-01)
examples\pulsar.svg (245918, 2020-12-01)
examples\pythagoras.psvg (1272, 2020-12-01)
examples\pythagoras.svg (2372335, 2020-12-01)
examples\schotter.psvg (1510, 2020-12-01)
examples\schotter.svg (107185, 2020-12-01)
examples\shapemorph.psvg (1667, 2020-12-01)
examples\shapemorph.svg (22078, 2020-12-01)
examples\sierpinski.psvg (747, 2020-12-01)
examples\sierpinski.svg (224479, 2020-12-01)
examples\sphere.psvg (2718, 2020-12-01)
examples\sphere.svg (115538, 2020-12-01)
examples\terrain.psvg (2928, 2020-12-01)
examples\terrain.svg (180558, 2020-12-01)
examples\textanim.psvg (1275, 2020-12-01)
examples\textanim.svg (97213, 2020-12-01)
examples\tree.psvg (792, 2020-12-01)
examples\tree.svg (155135, 2020-12-01)
examples\turing.psvg (4728, 2020-12-01)
examples\turing.svg (29768, 2020-12-01)
package-lock.json (52501, 2020-12-01)
... ...

[![](https://github.com/LingDong-/psvg/blob/master/examples/textanim.svg)](https://github.com/LingDong-/psvg/blob/master/examples/textanim.psvg) # PSVG - Programmable SVG **[Doc](https://github.com/LingDong-/psvg/blob/master/QUICKSTART.md) | [Playground](https://github.com/LingDong-/psvg/blob/master/https://psvg.netlify.app/) | [Examples](https://github.com/LingDong-/psvg/blob/master/examples/) | [NPM](https://github.com/LingDong-/psvg/blob/master/https://www.npmjs.com/package/@lingdong/psvg)** PSVG is an extension of the SVG (Scalable Vector Graphics) format that introduces programming language features like functions, control flows, and variables -- Instead of writing a program that draws a picture, write a picture that draws itself! PSVG is compliant with XML and HTML specs, so it can be easily embedded in a webpage or edited with an XML editor. This repo contains a [PSVG→SVG complier](https://github.com/LingDong-/psvg/blob/master/psvg.ts) that transforms PSVG files to just regular SVG's. It can also automatically render all PSVG's on an HTML page when included as a ` ``` By including the script, all the `` elements on the webpage will be compiled to `` when the page loads. Again, don't include PSVG files that you don't trust. ### As a library Install locally in your project via npm ``` npm i @lingdong/psvg ``` ```js import { compilePSVG } from "@lingdong/psvg" console.log(compilePSVG("...")) ``` or ```js const { compilePSVG } = require("@lingdong/psvg") console.log(compilePSVG("...")) ``` Additionally, `parsePSVG()` `transpilePSVG()` and `evalPSVG()` which are individual steps of compilation are also exported. In browsers, functions are exported under the global variable `PSVG`. **Check out [QUICKSTART.md](https://github.com/LingDong-/psvg/blob/master/QUICKSTART.md) for a quick introduction to the PSVG language.** ## Editor Support Syntax highlighting and auto-completion can be configured for editors by: ### VS Code Add the following lines to your `settting.json`. [details](https://github.com/LingDong-/psvg/blob/master/https://code.visualstudio.com/docs/languages/overview#_can-i-map-additional-file-extensions-to-a-language) ```json "files.associations": { "*.psvg": "xml" } ``` ### GitHub To get highlighting for PSVG files in your repositories on GitHub, create `.gitattributes` file at the root of your repo with the following content. [details](https://github.com/LingDong-/psvg/blob/master/https://github.com/github/linguist#using-gitattributes) ```ini *.psvg linguist-language=SVG ``` ### Other editors Since PSVG is compliant with XML and HTML specs, you can always alias your language id to XML or SVG via the corresponding config on your editor.

近期下载者

相关文件


收藏者