Skip to content

docs: add API reference for Figlet/figlet_format/print_figlet - #162

Open
mmaxjr wants to merge 1 commit into
pwaller:mainfrom
mmaxjr:docs/api-reference-quickstart
Open

docs: add API reference for Figlet/figlet_format/print_figlet#162
mmaxjr wants to merge 1 commit into
pwaller:mainfrom
mmaxjr:docs/api-reference-quickstart

Conversation

@mmaxjr

@mmaxjr mmaxjr commented Jul 30, 2026

Copy link
Copy Markdown

Addresses #78

Problem

The Quickstart only shows two code snippets for rendering text but doesn't explain:

  • The Figlet class's constructor options (font, direction, justify, width)
  • Where color belongs — it's easy to assume renderText() handles it, but color is actually applied by print_figlet(), not Figlet/figlet_format()
  • The colors argument format expected by print_figlet ("foreground:background", color names vs R;G;B)

As requested by the maintainer in the issue: keeping this small and doc-only.

Change

Added a short "API reference" section to the README covering:

  • Figlet(font, direction, justify, width) and its .renderText() / .getFonts() methods
  • figlet_format(text, font, **kwargs)
  • print_figlet(text, font, colors, **kwargs) and the colors format, with a runnable example

Testing

  • Verified every code example in the new section runs correctly against the actual package (figlet_format, print_figlet with a color, COLOR_CODES, getFonts())
  • Doc-only change; existing test suite passes (4 passed)

The Quickstart only showed the two ways to render text but never
explained the Figlet class's constructor options, where color
belongs (print_figlet, not renderText), or the "foreground:background"
format print_figlet expects for its colors argument.

Add a short API reference section covering Figlet(), figlet_format(),
print_figlet(), and the colors argument format, with a runnable example.

Addresses pwaller#78

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread README.md
default to whatever the chosen font specifies; `width` sets the column
width used for wrapping/justification.
- `.renderText(text)` - returns a `FigletString` (a `str` subclass) with
the rendered ASCII art. This is where you print your text; **color is

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This is where you print your text" -> but renderText doesn't print?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants