Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
urbit-paper-renderer
Advanced tools
🚧 Library under construction, use branch rc-immediate
for working release. 🚧
PaperRenderer
generates PNG wallets that can be printed from urbit-key-generation. The layouts and static text content exist in Figma, and are imported via the convert
script. This JSON is then saved to disk and bundled with PaperRenderer
in release. The layout objects contain variable strings like @heading
or @management.seed.length
. PaperRenderer
replaces these with real data. Variables can also specify special layout components like #sigil@meta.patp
.
FONTS MUST BE PROVIDED AND LOADED APPLICATION-SIDE. FONTS WILL NOT RENDER IF THEY ARE NOT LOADED.
Install deps via npm:
$ npm install
How to build/run for development:
.env
file in the root directory. Paste in Tlon's Figma API token like the following:FIGMA_API_TOKEN="your-token-here-within-the-quotes"
npm run convert
translates the Figma design to JSON via the Figma API. You can target a specific Figma document by updating the document string and page name that are found in convert.js, lines 32 and 34. You can retrieve a Figma document string id by opening the document in your browser and copying the string that appears before the document name. Each document has pages, which you can target with a name string, such as our current page Registration 1.2.
npm run start
builds all files for development and will watch for any JavaScript changes and serve the build on localhost:8000.
npm run build
builds all files for production.
Making changes:
If you make changes to your targeted Figma document, you must re-convert the JSON with npm run convert
.
Refreshing the webpage with cmd+shift+r
will ensure that your browser doesn't render an older, cached version.
Commands | Description |
---|---|
npm run convert | Import Figma design |
npm run build:dev | Run the development testing page |
or $ npm run build:prod | Build the library from source |
npm run serve | Serve & watch build on localhost:8000 |
npm run genWallet | Generate random JSON wallets |
See our documentation of frequent bugs and how to fix them.
<PaperRenderer
wallets={[wallet]}
className={''}
show={true}
debug={false}
callback={(data) => console.log(data)}
/>
PaperRenderer
has 7 props.
Prop Name | Description | Type |
---|---|---|
wallet | A wallet in the format below | Transformed keygen-js wallet object |
className | A class on the canvas element | string |
callback | A function to call when all PNGs have been generated | function |
show | show or hide the canvas element | bool , default false |
debug | draw layout grid lines | bool , default false |
output | output image format | string , 'png' or 'uri' , default png |
verbose | include input in output | bool , default false |
Default
[{
pages: {...}, // template pages with `img` property
}]
With verbose on
[{
pages: {...}, // template pages with `img` property
templates: {...}, // templates
wallet: {...} // wallet
}]
Sample wallets can be found in sampleWallets
This project is licensed under the MIT License - see the LICENSE.txt file for details
FAQs
[Github](https://github.com/urbit/PaperRenderer)
The npm package urbit-paper-renderer receives a total of 17 weekly downloads. As such, urbit-paper-renderer popularity was classified as not popular.
We found that urbit-paper-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.