fastn
fastn
allows you to generate typography code from its equivalent json. To generate fastn
code, you will need to include typo.js
from fastn-js
repo and use its typo_to_ftd(json)
JS function.
typo_to_ftd(json)
takes json string as input and returns two strings - fastn
source code, styled fastn
code.fastn
code for fastn-io-typography
from its json.typo_to_ftd(json)
to generate fastn
code-- import: fastn-stack.github.io/fastn-js/assets as js-assets -- import: fastn-community.github.io/doc-site as ds -- import: fifthtry.github.io/fastn-io-typography as fastn-typo -- optional string $code: -- optional string $formatted-code: -- string fastn-typo-json: $processor$: pr.figma-typo-token variable: $forest-cs.main name: fastn-typography -- void typo-to-ftd(json,store_at,formatted_string): string json: string $store_at: string $formatted_string: js: [$js-assets.files.typo.js] value = typo_to_ftd(json); store_at = value[0]; formatted_string = value[1]; -- ftd.text: Generate `fastn` code $on-click$: $typo-to-ftd(json = $fastn-typo-json, $store_at = $code, $formatted_string = $formatted-code) color: $inherited.colors.text role: $inherited.types.copy-regular border-width.px: 2 padding.px: 5 -- ds.code: if: { code != NULL } body: $formatted-code text: $code max-height.fixed.px: 300
fastn
codefastn
equivalent code.Have a question or need help?
Visit our GitHub Q&A discussion to get answers and subscribe to it to stay tuned.
Join our Discord channel and share your thoughts, suggestion, question etc.
Connect with our community!We welcome you to join our Discord community today.
We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.