https://github.com/knutsynstad/faux-code
Convert real code from a Github Gist into an SVG image of faux code
https://github.com/knutsynstad/faux-code
computational design svg
Last synced: 10 months ago
JSON representation
Convert real code from a Github Gist into an SVG image of faux code
- Host: GitHub
- URL: https://github.com/knutsynstad/faux-code
- Owner: knutsynstad
- Created: 2020-02-05T06:24:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T07:23:29.000Z (over 3 years ago)
- Last Synced: 2023-03-01T08:20:50.655Z (over 3 years ago)
- Topics: computational, design, svg
- Language: JavaScript
- Homepage:
- Size: 7.38 MB
- Stars: 88
- Watchers: 4
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# faux-code
Convert real code from a Github Gist into an SVG image of faux code.

## Index.js
Input:
```js
// GitHub Gist URL
const gist = 'https://gist.github.com/knutsynstad/265226120c71426420c78c750a4eb727';
```
Output:
```js
// SVG file
const filename = './fauxcode.svg';
```
Options:
```js
const options = {
theme: 'light', // 'light' or 'dark' mode
fontSize: 5, // Line thickness and width
leading: 10, // Space between lines
lineCap: 'round', // Line ends 'square' or 'round'
margin: 50, // Space between canvas edges and code block
lineNumbers: true, // Whether or not to include line numbers
lineNumberOffset: -3, // Line number offset from margin
};
```
## Get up and running
Clone the repository:
```
git clone https://github.com/knutsynstad/faux-code.git
```
Install dependencies:
```
npm install
```
Run script:
```
npm run start
```