{"id":13295257,"url":"https://github.com/Mcrevs/cc-text-formatter","last_synced_at":"2025-03-10T08:31:44.223Z","repository":{"id":215106588,"uuid":"738131043","full_name":"Mcrevs/cc-text-formatter","owner":"Mcrevs","description":"CC:T A basic text formatting library to help create multi-line and coloured text.","archived":false,"fork":false,"pushed_at":"2024-02-27T21:43:57.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-29T17:41:33.676Z","etag":null,"topics":["cc-tweaked","computer-craft","computercraft","computercraft-tweaked","text"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/Mcrevs.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}},"created_at":"2024-01-02T13:53:55.000Z","updated_at":"2024-04-09T15:36:58.000Z","dependencies_parsed_at":"2024-02-27T22:46:20.689Z","dependency_job_id":"2946d330-d1c3-4ab5-9b81-06bb4421696b","html_url":"https://github.com/Mcrevs/cc-text-formatter","commit_stats":null,"previous_names":["mcrevs/text-generator","mcrevs/cc-text-formatter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mcrevs%2Fcc-text-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mcrevs%2Fcc-text-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mcrevs%2Fcc-text-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mcrevs%2Fcc-text-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mcrevs","download_url":"https://codeload.github.com/Mcrevs/cc-text-formatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242819137,"owners_count":20190388,"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":["cc-tweaked","computer-craft","computercraft","computercraft-tweaked","text"],"created_at":"2024-07-29T17:16:46.647Z","updated_at":"2025-03-10T08:31:43.762Z","avatar_url":"https://github.com/Mcrevs.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text Formatter\nText formatter (tf) is a basic computer craft text formatting system used for creating inline coloured text.\n## Examples\n```lua\nlocal tf = require(\"tf\")\n\nlocal width, height = term.getSize()\n\nlocal header = tf.createString(\"$b7 Current status \")\nheader = tf.align(header, width, \"centre\")\ntf.write(header)\n\ntf.print(\"$f8Turtle$f_    Mining Turtle           $feOffline\")\ntf.print(\"$f8Turtle$f_    Farming Turtle          $f5Online\")\ntf.print(\"$f8Server$f_    Chat Server             $f5Online\")\n```\n![Screenshot of the text produced by the above code](Assets/Example1.png)\n```lua\nlocal tf = require(\"tf\")\n\ntf.print(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam eu $c74elit eu turpis$c__ porta eleifend vitae a tortor.\\nQuisque congue ultricies urna, ac tincidunt urna eleifend a.\\nVestibulum $c74posuere ipsum sit$c__ amet sem dapibus egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc luctus $c74facilisis felis$c__ sit amet sagittis.\\nPellentesque in laoreet augue, eget egestas eros. Duis tincidunt sodales elit eu feugiat. Aenean ut $c74dictum arcu, eget aliquet$c__ ex.\")\n```\n![Screenshot of the text produced by the above code](Assets/Example2.png)\n# How to use\n## Formatting\nTags are used to swich or suggest the formatting of the text. Tags always start with a `$` therefore in order to have a `$` as text you need to type `$$`. The current tags are shown in the table below.\n| Tag        | Purpose                                                                                                                                                                                                                   |\n| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `$f{1}`    | Switch the colour of the text to be `{1}` where `{1}` is a hexadecimal digit referring to the colour in the current colour palette or a `_` specifying to use the default foreground colour.                              |\n| `$b{1}`    | Switch the colour of the background below the current text to be `{1}` where `{1}` is a hexadecimal digit referring to the colour in the current colour palette or a `_` specifying to use the default background colour. |\n| `$c{1}{2}` | Switch the foreground  and background colour of the text to be `{1}` and `{2}` respectively. Equivelent to `$f{1}$b{2}.`                                                                                                  |\n| `$$`       | Writes a single $ character.                                                                                                                                                                                              |\n\nFor example, to send a message such as `ERROR    Turtle is on fire!` with the word `ERROR` having a red background and the word `fire` in orange, you would use `$beERROR$bf    Turtle is on $f1fire$f0!`.\n## Quick start guide\n\nFor more detailed doccumentaion on every function please see the [wiki](https://github.com/Mcrevs/cc-text-formatter/wiki) page.\n\n### Installing\nType the following command into the terminal to download the required lua file.\n```\nwget https://raw.githubusercontent.com/Mcrevs/cc-text-formatter/main/tf.lua\n```\n### Importing\nAdd this to the start of your program file to include the library. \n```lua\nlocal tf = require(\"tf\")\n```\n### Printing\nPrint a coloured string accross multiple lines if required.\n```lua\ntf.print(\"$feH$f1E$f4L$f5L$fbL$faO$f0 $cfeW$b1O$b4R$b5L$bbD$ba!\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMcrevs%2Fcc-text-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMcrevs%2Fcc-text-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMcrevs%2Fcc-text-formatter/lists"}