npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oxide/fable

v0.1.5

Published

Fable is a TOML deck generator with custom templates and schema validation

Downloads

6

Readme

Fable

Warning: Fable is not much more than an internal experiment in a type of deck generator. It won't offer a comprehensive feature set or the robustness of a fully-developed library. But it aims to provide a flexible and intuitive tool for presentation creation. We greatly appreciate feedback, suggestions, and best of all contributions.

Fable is a deck generator that looks to offer an authoring experience as effortless as markdown presentation libraries while providing the flexibility to create more varied layouts. It utilizes TOML templates and content schema validation (via zod) to ensure content accuracy and format adherence.

CleanShot 2023-06-19 at 19 07 36

Key Features

  • Schema-based validation for templates
  • Customizable page templates
  • Support for a wide variety of content formats (Markdown, code snippets, images) and can be extended to support anything else
  • Seamless export to PDF using Puppeteer
  • Built-in Tailwind CSS support

How It Works

Specify a page template along with its own content schema (using zod) to validate the content and fields in the TOML file.

export const Schema = z.object({
  title: z.string().optional,
  text: z.string(),
});
[[pages]]
template = "Basic"
title = "A Journey Through the Cosmos"
text = """
- In the _vastness of space_, time and distance are but mere illusions
    - Worlds exist beyond our wildest imaginations
        - On these worlds, _beings of all shapes and sizes_ dwell
- With societies and cultures _as diverse as the stars_ that light up the skies above
- They are **united** in their quest for knowledge and understanding
- The universe itself is our teacher, and its secrets our endless source of inspiration
"""

The template attribute in your TOML file should correspond to the template component name. Fable provides several built-in templates, but custom templates can also be created. Any design you can produce with a React layout can be incorporated into your presentation.

This means you're not relying on the library to support any type of content, it can be easily extended to support things like Latex, AsciiMath, AsciiDoc by just installing any prerequisites and handling it directly in a new layout.

Getting Started

Create a new presentation with npx @oxide/create-fable@latest.

Export to PDF

To generate a PDF version of your presentation, run npm run export-pdf.

Navigation

Navigate through slides using the left and right arrow keys. Press f to enter fullscreen mode.

Custom Templates

Custom templates consist of:

  1. A template schema that validates whether the page's content matches the rendering requirements of the template.
  2. A React component that handles the page content provided by the user.

Refer to this starter example to create your own custom templates.

Template Utilities

Markdown: Content enclosed within is parsed and rendered as Markdown.

FitText: Automatically resizes overflowing text to fit within its container.

Info: Currently not in use, needs improvements

Stying

Fable supports Tailwind CSS out of the box. You can also use the styles.css file.