{"id":13524446,"url":"https://github.com/Pablo-Gonzalez-Calderon/showybox-package","last_synced_at":"2025-04-01T02:31:40.311Z","repository":{"id":178781157,"uuid":"662357124","full_name":"Pablo-Gonzalez-Calderon/showybox-package","owner":"Pablo-Gonzalez-Calderon","description":"A Typst package for creating colorful and customizable boxes","archived":false,"fork":false,"pushed_at":"2024-10-15T15:16:51.000Z","size":3387,"stargazers_count":54,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-16T16:47:35.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Typst","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pablo-Gonzalez-Calderon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-05T00:55:28.000Z","updated_at":"2024-10-15T13:22:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"835edb4a-b23a-4e90-81b6-5c4e27a6b11d","html_url":"https://github.com/Pablo-Gonzalez-Calderon/showybox-package","commit_stats":null,"previous_names":["pablo-gonzalez-calderon/showybox-package"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pablo-Gonzalez-Calderon%2Fshowybox-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pablo-Gonzalez-Calderon%2Fshowybox-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pablo-Gonzalez-Calderon%2Fshowybox-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pablo-Gonzalez-Calderon%2Fshowybox-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pablo-Gonzalez-Calderon","download_url":"https://codeload.github.com/Pablo-Gonzalez-Calderon/showybox-package/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222693039,"owners_count":17024034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:10.145Z","updated_at":"2025-04-01T02:31:40.304Z","avatar_url":"https://github.com/Pablo-Gonzalez-Calderon.png","language":"Typst","funding_links":[],"categories":["Typst","Templates \u0026 Libraries"],"sub_categories":["Formatting"],"readme":"# Showybox (v2.0.4)\n\n**Showybox** is a Typst package for creating colorful and customizable boxes.\n\n_Please note that this repository contains the latest (development) version of this package and **may not yet be published at Typst's official package repository**. If you want to use this package, see https://github.com/typst/packages/tree/main/packages/preview for the latest stable version_\n\n## Usage\n\nTo use this library through the Typst package manager (for Typst 0.6.0 or greater), write `#import \"@preview/showybox:2.0.4\": showybox` at the beginning of your Typst file.\n\nOnce imported, you can create an empty showybox by using the function `showybox()` and giving a default body content inside the parenthesis or outside them using squared brackets `[]`.\n\nBy default a `showybox` with these properties will be created:\n\n- No title\n- No shadow\n- Not breakable\n- Black borders\n- White background\n- `5pt` of border radius\n- `1pt` of border thickness\n\n```typst\n#import \"@preview/showybox:2.0.4\": showybox\n\n#showybox(\n  [Hello world!]\n)\n```\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Hello world! example\" src=\"assets/hello-world.png\" style=\"max-width: 95%; background-color: #FFFFFF; padding: 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\nLooks quite simple, but the \"magic\" starts when adding a title, color and shadows. The following code creates two \"unique\" boxes with defined colors and custom borders:\n```typst\n// First showybox\n#showybox(\n  frame: (\n    border-color: red.darken(50%),\n    title-color: red.lighten(60%),\n    body-color: red.lighten(80%)\n  ),\n  title-style: (\n    color: black,\n    weight: \"regular\",\n    align: center\n  ),\n  shadow: (\n    offset: 3pt,\n  ),\n  title: \"Red-ish showybox with separated sections!\",\n  lorem(20),\n  lorem(12)\n)\n\n// Second showybox\n#showybox(\n  frame: (\n    dash: \"dashed\",\n    border-color: red.darken(40%)\n  ),\n  body-style: (\n    align: center\n  ),\n  sep: (\n    dash: \"dashed\"\n  ),\n  shadow: (\n\t  offset: (x: 2pt, y: 3pt),\n    color: yellow.lighten(70%)\n  ),\n  [This is an important message!],\n  [Be careful outside. There are dangerous bananas!]\n)\n```\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Further examples\" src=\"assets/two-easy-examples.png\" style=\"max-width: 95%; background-color: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n## Reference\n\nThe `showybox()` function can receive the following parameters:\n- `title`: A string used as the title of the showybox\n- `footer`: A string used as the footer of the showybox\n- `frame`: A dictionary containing the frame's properties\n- `title-style`: A dictionary containing the title's styles\n- `body-style`: A dictionary containing the body's styles\n- `footer-style`: A dictionary containing the footer's styles\n- `sep`: A dictionary containing the separator's properties\n- `shadow`: A dictionary containing the shadow's properties\n- `width`: A relative length indicating the showybox's width\n- `align`: An unidimensional alignement for the showybox in the page\n- `breakable`: A boolean indicating whether a showybox can break if it reached an end of page\n- `spacing`: Space above and below the showybox\n- `above`: Space above the showybox\n- `below`: Space below the showybox\n- `body`: The content of the showybox\n\n### Frame properties\n- `title-color`: Color used as background color where the title goes (default is `black`)\n- `body-color`: Color used as background color where the body goes (default is `white`)\n- `footer-color`: Color used as background color where the footer goes (default is `luma(85)`)\n- `border-color`: Color used for the showybox's border (default is `black`)\n- `inset`: Inset used for title, body and footer elements (default is `(x: 1em, y: 0.65em)`) if none of the followings are given:\n  - `title-inset`: Inset used for the title\n  - `body-inset`: Inset used for the body\n  - `footer-inset`: Inset used for the body\n- `radius`: Showybox's radius (default is `5pt`)\n- `thickness`: Border thickness of the showybox (default is `1pt`)\n- `dash`: Showybox's border style (default is `solid`)\n\n### Title styles\n- `color`: Text color (default is `white`)\n- `weight`: Text weight (default is `bold`)\n- `align`: Text align (default is `start`)\n- `sep-thickness`: Thickness of the separator between title and body (default is `1pt`)\n- `boxed-style`: If it's a dictionary of properties, indicates that the title must appear like a \"floating box\" above the showybox. If it's ``none``, the title appears normally (default is `none`)\n\n#### Boxed styles\n\n- `anchor`: Anchor of the boxed title\n  - `y`: Vertical anchor (`top`, `horizon` or `bottom` -- default is `horizon`)\n  - `x`: Horizontal anchor (`left`, `start`, `center`, `right`, `end` -- default is `start`)\n- `offset`: How much to offset the boxed title in x and y direction as a dictionary with keys `x` and `y` (default is `0pt`)\n- ``radius``: Boxed title radius as a dictionary or relative length (default is `5pt`)\n\n### Body styles\n- `color`: Text color (default is `black`)\n- `align`: Text align (default is `start`)\n\n### Footer styles\n- `color`: Text color (default is `luma(85)`)\n- `weight`: Text weight (default is `regular`)\n- `align`: Text align (default is `start`)\n- `sep-thickness`: Thickness of the separator between body and footer (default is `1pt`)\n\n### Separator properties\n- `thickness`: Separator's thickness (default is `1pt`)\n- `dash`: Separator's style (as a `line` dash style, default is `\"solid\"`)\n- `gutter`: Separator's space above and below (defalut is `0.65em`)\n\n### Shadow properties\n- `color`: Shadow color (default is `black`)\n- `offset`: How much to offset the shadow in x and y direction either as a length or a dictionary with keys `x` and `y` (default is `4pt`)\n\n\n## Gallery\n\n### Colors for title, body and footer example (Stokes' theorem)\n\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Encapsulation\" src=\"assets/stokes-example.png\" style=\"max-width: 95%; background-color: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Boxed-title example (Clairaut's theorem)\n\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Encapsulation\" src=\"assets/clairaut-example.png\" style=\"max-width: 95%; background-color: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Encapsulation example\n\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Encapsulation\" src=\"assets/encapsulation-example.png\" style=\"max-width: 95%; background-color: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Breakable showybox example (Newton's second law)\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Enabling breakable\" src=\"assets/newton-example.png\" style=\"max-width: 95%; padding: 10px 10px; background-color: #FFFFFF; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Custom radius and title's separator thickness example (Carnot's cycle efficency)\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Custom radius\" src=\"assets/carnot-example.png\" style=\"max-width: 95%; background: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Custom border dash and inset example (Gauss's law)\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Custom radius\" src=\"assets/gauss-example.png\" style=\"max-width: 95%; background: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Custom footer's separator thickness example (Divergence's theorem)\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Custom radius\" src=\"assets/divergence-example.png\" style=\"max-width: 95%; background: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n### Colorful shadow example (Coulomb's law)\n\u003ch3 align=\"center\"\u003e\n  \u003cimg alt=\"Custom radius\" src=\"assets/coulomb-example.png\" style=\"max-width: 95%; background: #FFFFFF; padding: 10px 10px; box-shadow: 1pt 1pt 10pt 0pt #AAAAAA; border-radius: 4pt\"\u003e\n\u003c/h3\u003e\n\n## Changelog\n\n### Version 2.0.4\n\n_Special thanks to enklht (https://github.com/enklht) and PgBiel (https://github.com/PgBiel) for their collaboration with this version's changes_\n\n- Change default alignments to ``start``, instead of ``left``\n- Fix pre-rendering logic while creating boxed-titles\n  - This fixes a reported bug occurring while creating a ``counter`` inside a showybox declaration\n\n### Version 2.0.3\n- Revert fix breakable box empty before new page. Layout didn't converge\n\n### Version 2.0.2\n- Remove deprecated functions in Typst 0.12.0\n- Fix breakable box empty before new page\n\n### Version 2.0.1\n\n- Fix bad behaviours of boxed-titles ``anchor`` inside a ``figure``\n- Fix wrong ``breakable`` behaviour of showyboxes inside a ``figure``\n- Fix Manual and README's Stokes theorem example\n\n### Version 2.0.0\n\n_Special thanks to Andrew Voynov (\u003chttps://github.com/Andrew15-5\u003e) for the feedback while creating the new behaviours for boxed-titles_\n\n- Update ``type()`` conditionals to Typst 0.8.0 standards\n- Add ``boxed-style`` property, with ``anchor``, ``offset`` and ``radius`` properties.\n- Refactor ``showy-inset()`` for being general-purpose. Now it's called ``showy-value-in-direction()`` and has a default value for handling properties defaults\n- Now sharp corners can be set by giving a dictionary to frame ``radius`` (e.g. ``radius: (top: 5pt, bottom: 0pt)``). Before this only was possible for untitled showyboxes.\n- Refactor shadow functions to be in a separated file.\n- Fix bug of bad behaviour while writing too long titles.\n- Fix bug while rendering separators with custom thickness. Now the thickness is gotten properly.\n- Fix bad shadow drawing in showyboxes with a boxed-title that has a \"extreme\" `offset` value.\n- Fix bad sizing while creating showyboxes with a `width` of less than `100%`, and a shadow.\n\n### Version 1.1.0\n- Added `boxed` option in title styles\n- Added `boxed-align` in title styles\n- Added `sep-thickness` for title and footer\n- Refactored repository's files layout\n\n### Version 1.0.0\n\n- Fixed shadow displacement\n  - **Details:** Instead of displacing the showybox's body from the shadow, now the shadow is displaced from the body.\n\n_Changes below were performed by Jonas Neugebauer (\u003chttps://github.com/jneug\u003e)_\n\n- Added `title-inset`, `body-inset`, `footer-inset` and `inset` options\n\t- **Details:** `title-inset`, `body-inset` and `footer-inset` will set the inset of the title, body and footer area respectively. `inset` is a fallback for those areas.\n- Added a `sep.gutter` option to set the spacing around separator lines\n- Added option `width` to set the width of a showybox\n- Added option `align` to move a showybox with `width` \u003c 100% along the x-axis\n\t- **Details:** A showybox is now wrapped in another block to allow alignment. This also makes it possible to pass the spacing options `spacing`, `above` and `below` to `#showybox()`.\n- Added `footer` and `footer-style` options\n\t- **Details:** The optional footer is added at the bottom of the box.\n\n### Version 0.2.1\n\n_All changes listed here were performed by Jonas Neugebauer (\u003chttps://github.com/jneug\u003e)_\n\n- Added the `shadow` option\n- Enabled auto-break (`breakable`) functionality for titled showyboxes\n- Removed a thin line that appears in showyboxes with no borders or dashed borders\n\n### Version 0.2.0\n- Improved code documentation\n- Enabled an auto-break functionality for non-titled showyboxes\n- Created a separator functionality to separate content inside a showybox with a horizontal line\n\n### Version 0.1.1\n- Changed package name from colorbox to showybox\n- Fixed a spacing bug in encapsulated showyboxes\n  - **Details:** When a showybox was encapsulated inside another, the spacing after that showybox was `0pt`, probably due to some \"fixes\" improved to manage default spacing between `rect` elements. The issue was solved by avoiding `#set` statements and adding a `#v(-1.1em)` to correct extra spacing between the title `rect` and the body `rect`.\n\n### Version 0.1.0\n- Initial release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPablo-Gonzalez-Calderon%2Fshowybox-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPablo-Gonzalez-Calderon%2Fshowybox-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPablo-Gonzalez-Calderon%2Fshowybox-package/lists"}