{"id":21540107,"url":"https://github.com/detectivekaktus/belformat","last_synced_at":"2025-04-10T03:27:16.433Z","repository":{"id":227931100,"uuid":"772741357","full_name":"detectivekaktus/belformat","owner":"detectivekaktus","description":"Formatting tools for the terminal output in C","archived":false,"fork":false,"pushed_at":"2024-04-30T20:43:56.000Z","size":482,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T04:43:41.208Z","etag":null,"topics":["ansi","c","formatting","library","markdown","output","styling","syntax-highlighting","terminal"],"latest_commit_sha":null,"homepage":"","language":"C","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/detectivekaktus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-03-15T19:54:24.000Z","updated_at":"2025-03-09T12:41:46.000Z","dependencies_parsed_at":"2024-04-03T17:27:27.591Z","dependency_job_id":"98fab3c7-4cc9-4fbb-bc44-b82d96bd6887","html_url":"https://github.com/detectivekaktus/belformat","commit_stats":null,"previous_names":["artiom-astashonak/belformat","detectivekaktus/belformat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detectivekaktus%2Fbelformat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detectivekaktus%2Fbelformat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detectivekaktus%2Fbelformat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/detectivekaktus%2Fbelformat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/detectivekaktus","download_url":"https://codeload.github.com/detectivekaktus/belformat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248150126,"owners_count":21055865,"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":["ansi","c","formatting","library","markdown","output","styling","syntax-highlighting","terminal"],"created_at":"2024-11-24T04:17:26.850Z","updated_at":"2025-04-10T03:27:16.408Z","avatar_url":"https://github.com/detectivekaktus.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# belformat\nBelformat is a simple and convenient tool for styling and formatting output in C. Use a syntax similar to HTML and add originality to your project. Belformat operates around the standard output functions in C from `stdio.h`, as well as ANSI escape codes.\n\nThe library is written in the C programming language and does not require additional dependencies to function. You can use this tool as either a statically generated library or as a dynamic library depending on your needs.\n\nThe project is open to everyone, and anyone familiar with [CONTRIBUTING.md](https://github.com/Artiom-Astashonak/belformat/blob/master/CONTRIBUTING.md) can suggest their own changes to the repository to make Belformat better and more convenient.\n\n## Examples\nIf you prefer not to read all the detailed examples of the library usage below, compile a single example file and run it by executing:\n\n```sh\n$ make examples\n$ ./exam\n```\n### Formatting\nBelformat provides all the standard formatting methods available to ANSI users with a simpler and more understandable syntax.\n\n#### Bold\nUse the `\u003cb\u003e` tag (for `b`old) before the start of the text block you want to make bold, and close the tag with `\u003c/\u003e` at the end f the block to reset all styles added before it.\n\n`\u003c/\u003e` is universal for every single tag, as it appends clear sequence that deletes all styling.\n![Bold text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/boldtext.png)\n\n#### Italic\nTo achieve italic text, use the `\u003ci\u003e` tag (for `i`talic) and close it with `\u003c/\u003e` at the very end, resulting in a similar outcome:\n\n![Italic text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/italictext.png)\n\n#### Underlined\nUnderline text with the `\u003cu\u003e` tag (for `u`nderlined), which like all tags, must be closed with `\u003c/\u003e` to remove its effect for all subsequent characters.\n\n![Underlined text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/underlinedtext.png)\n\n#### Strikethrough\nTo get strikethrough text, use the combination of `\u003cs\u003e` tag (for `s`trikethrough) and `\u003c/\u003e` as in previous cases.\n\n![Strikethrough text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/strikethroughtext.png)\n\n#### Dim\nDim color is relative to the current text color and depends on your terminal settings. Use a combination of `\u003cd\u003e` tag (for `d`im) and `\u003c/\u003e` to achieve the desired result.\n\n![Dim text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/dimtext.png)\n\n#### Reversed\nReversed color swaps the text color and the background color. Use `\u003cr\u003e` (for `r`eversed) along with `\u003c/\u003e`.\n\n![Reversed text](https://github.com/Artiom-Astashonak/belformat/blob/master/img/reversedtext.png)\n\n#### Blinking\nThis type may not be available for your terminal. Wrap the text in `\u003cl\u003e` (for b`l`inking) and close it with `\u003c/\u003e`.\n\n#### Private\nYou can hide the output values using `\u003cp\u003e` (for `p`rivate) and close it with `\u003c/\u003e`.\n\n### Styling\nIn addition to formatting using standard ANSI, you can also style text using terminal-dependent colors. Available colors are: black, red, green, blue, yellow, magenta, cyan and white.\n\nThe general syntax for adding colors works as follows: `\u003ctag_name;foreground_color;background_color\u003e`. For example:\n![Colors example](https://github.com/Artiom-Astashonak/belformat/blob/master/img/terminalcolors.png)\n\nTo add color exclusively without formatting, use the `\u003cc\u003e` (for `c`olor) tag.\n\nIf you wish to have your own colors, you can add them with HEX color notation like so:\n![User colors](https://github.com/Artiom-Astashonak/belformat/blob/master/img/usercolors.png)\n\n### Utility\nThe project also has several utilities for logging output (`bellog()` function), information (`belinfo()` function), warnings (`belwarn()` function), and errors  (`belerror()` function).\n\n![Utility functions](https://github.com/Artiom-Astashonak/belformat/blob/master/img/utilities.png)\n\n## Compilation\nBelformat assumes you have a C compiler (either GCC or clang) installed, as well as GNU make for building the library.\n\nTo generate a dynamic library, follow the instructions for your operating system below:\n\n### POSIX\n```sh\n$ make psx_belformat\n```\n\n### Windows\n```sh\n$ make win_belformat\n```\n\nOtherwise, generate a static library with the following command:\n```sh\n$ make static_belformat\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetectivekaktus%2Fbelformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdetectivekaktus%2Fbelformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetectivekaktus%2Fbelformat/lists"}