Category:SVG created with JavaScript
Self-generating SVG pioneered by TilmannR (talk · contribs) and further developed by cmglee (talk · contribs) which uses JavaScript to replace itself with static SVG, and embed itself as a comment.
This avoids users needing any software except a web browser and a text editor to update and rerun the script.
Editing workflow:
- Open a template file or existing file to be amended in a text editor.
- Amend code in user-editable parts as needed.
- Delete the "!--" and "--" on lines indicated.
- Save as a new file or file to be amended.
- Open the file in Firefox or Chrome.
- In the web browser, save as another file.
- Upload this file to Commons.
Drawbacks of this method:
- Escaped non-ASCII characters are converted to their UTF-8 equivalents so the file may no longer be ASCII (giving mojibake in some text editors).
- The JavaScript must not have two consecutive hyphens (--).
- Errors may be difficult to debug for editors unfamiliar with JavaScript; pressing F12 and selecting the Console tab may give clues.
Pages in category "Category:SVG created with JavaScript"
- File:Template map of US states and District of Columbia.svg
- File:Binomial trial dice.svg
- File:Cognitive bias codex en uk.svg
- File:Cognitive bias codex en.svg
- File:Gabriel horn 2d.svg
- File:Lorentz factor log log.svg
- File:Phyllotaxis golden angle.svg
- File:Preferred numbers.svg
- File:Pythagorean tuning geometric.svg
- File:Visual cryptography stenography.svg
- File:Visual proof centered polygonal numbers.svg
- File:Visual proof harmonic series diverges.svg
- File:Visual proof polygonal numbers.svg