Convert real code from a Github Gist into an SVG image of faux code.
Input:
// GitHub Gist URL
const gist = 'https://gist.github.com/knutsynstad/265226120c71426420c78c750a4eb727';
Output:
// SVG file
const filename = './fauxcode.svg';
Options:
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
};
Clone the repository:
git clone https://github.com/knutsynstad/faux-code.git
Install dependencies:
npm install
Run script:
npm run start