-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs/library] Add API documentation
- Loading branch information
1 parent
2951e8f
commit c7d26ca
Showing
30 changed files
with
487 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.draw.base - API - Picharsso" | ||
description: "This module defines an abstract base formatter." | ||
--- | ||
|
||
# `base` | ||
|
||
::: picharsso.draw.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.draw.braille - API - Picharsso" | ||
description: "This module defines a drawer for Braille style." | ||
--- | ||
|
||
# `braille` | ||
|
||
::: picharsso.draw.braille |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.draw.gradient - API - Picharsso" | ||
description: "This module defines a drawer for gradient style." | ||
--- | ||
|
||
# `gradient` | ||
|
||
::: picharsso.draw.gradient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.draw - API - Picharsso" | ||
description: "This package defines drawers for different styles of text art." | ||
--- | ||
|
||
# `draw` | ||
|
||
::: picharsso.draw.__init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.format.ansi - API - Picharsso" | ||
description: "This module defines a formatter for the ANSI coloring scheme." | ||
--- | ||
|
||
# `ansi` | ||
|
||
::: picharsso.format.ansi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.format.base - API - Picharsso" | ||
description: "This module defines an abstract base formatter." | ||
--- | ||
|
||
# `base` | ||
|
||
::: picharsso.format.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.format.html - API - Picharsso" | ||
description: "This module defines a formatter for HTML." | ||
--- | ||
|
||
# `html` | ||
|
||
::: picharsso.format.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.format - API - Picharsso" | ||
description: "This package defines formatters for different modes of text output." | ||
--- | ||
|
||
# `format` | ||
|
||
::: picharsso.format.__init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.meta - API - Picharsso" | ||
description: "This module defines variables for the package metadata." | ||
--- | ||
|
||
# `meta` | ||
|
||
::: picharsso.meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "picharsso.utils - API - Picharsso" | ||
description: "This module defines utility functions that are used across the package." | ||
--- | ||
|
||
# `utils` | ||
|
||
::: picharsso.utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
??? example "Example" | ||
Consider the following image: | ||
|
||
--8<-- "docs/snippets/embed/subjects/apple.html" | ||
|
||
Here's what it should look like: | ||
|
||
--8<-- "docs/snippets/embed/outputs/demo/apple-braille.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
??? example "Example" | ||
Consider the following image: | ||
|
||
--8<-- "docs/snippets/embed/subjects/apple.html" | ||
|
||
Here's what it should look like: | ||
|
||
--8<-- "docs/snippets/embed/outputs/demo/apple-gradient.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div align="center"> | ||
<img | ||
alt="Apple logo in text (Braille style)" | ||
src="/assets/images/outputs/demo/apple-braille.webp" | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div align="center"> | ||
<img | ||
alt="Apple logo in text (gradient style)" | ||
src="/assets/images/outputs/demo/apple-gradient.webp" | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div align="center"> | ||
<p> | ||
<img alt="Apple logo" src="/assets/images/subjects/apple.webp" /> | ||
</p> | ||
<em>Apple Computer [Rob Janoff, 1977]</em> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
!!! question "Formats" | ||
Refer to the [Formats documentation](/formats/) | ||
to learn about the supported output formats. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
!!! question "Styles" | ||
Refer to the [Styles documentation](/styles/) | ||
for an in-depth guide to the **image processing behind Picharsso**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
""" | ||
This package defines drawers for different styles of text art. | ||
--8<-- "docs/snippets/references/styles.md" | ||
""" | ||
|
||
from .gradient import GradientDrawer | ||
from .base import BaseDrawer, RESAMPLING_FILTERS, DEFAULT_RESAMPLING | ||
from .braille import BrailleDrawer | ||
|
||
DRAWERS: dict = {"gradient": GradientDrawer, "braille": BrailleDrawer} | ||
"""The collection of drawers.""" | ||
|
||
|
||
def new_drawer(style, **kwargs): | ||
"""Creates a new drawer instance. | ||
Args: | ||
style (str): The style of the text art. | ||
**kwargs (dict): Appropriate keyword arguments. | ||
See [`BaseDrawer`][picharsso.draw.base.BaseDrawer] | ||
and others. | ||
Returns: | ||
Type[picharsso.draw.BaseDrawer]: The new drawer instance. | ||
""" | ||
return DRAWERS[style](**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.