{"id":16604742,"url":"https://github.com/sedwards2009/nodegui-plugin-rich-text-delegate","last_synced_at":"2026-04-17T16:04:19.980Z","repository":{"id":78800756,"uuid":"500126406","full_name":"sedwards2009/nodegui-plugin-rich-text-delegate","owner":"sedwards2009","description":"A QItemDelegate subclass for rendering rich text in NodeGui","archived":false,"fork":false,"pushed_at":"2022-12-28T22:25:36.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T10:43:58.596Z","etag":null,"topics":["nodegui","plugin"],"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/sedwards2009.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":"2022-06-05T14:51:46.000Z","updated_at":"2024-12-22T11:51:57.000Z","dependencies_parsed_at":"2023-06-05T23:00:41.543Z","dependency_job_id":null,"html_url":"https://github.com/sedwards2009/nodegui-plugin-rich-text-delegate","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedwards2009%2Fnodegui-plugin-rich-text-delegate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedwards2009%2Fnodegui-plugin-rich-text-delegate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedwards2009%2Fnodegui-plugin-rich-text-delegate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sedwards2009%2Fnodegui-plugin-rich-text-delegate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sedwards2009","download_url":"https://codeload.github.com/sedwards2009/nodegui-plugin-rich-text-delegate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242752627,"owners_count":20179547,"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":["nodegui","plugin"],"created_at":"2024-10-12T00:59:11.163Z","updated_at":"2026-04-17T16:04:14.957Z","avatar_url":"https://github.com/sedwards2009.png","language":"C++","readme":"# nodegui-plugin-rich-text-delegate\n\nRender rich text with Qt's Model/View framework from [NodeGui](https://github.com/nodegui/nodegui).\n\nThis package contains 2 `QAbstractItemDelegate` subclasses for rendering rich text. One is based on `QTextDocument` and can render a subset of HTML, the other takes a string with embedded \"command\" characters which can modify the presentation of the characters. This later version is designed to be fast.\n\n## RichTextDelegate\n\nTypeScript example of the HTML based delegate:\n\n```typescript\n  //...\n\n  const listView = new QListView();\n  const delegate = new RichTextDelegate();\n  listView.setItemDelegateForColumn(0, delegate);\n\n  // All strings in column 0 will be treated as HTML.\n```\n\nIt has no configuration. It just treats the strings to format as HTML.\n\n\n## TurboTextDelegate\n\nThis delegate is designed for run-time speed. It has a fairly low-level API. You may want to build some comfort layers on top of it first. It takes a string which contains embedded special unicode characters from the private use area which are interpretted as formatting commands. Like terminal escape codes, colors, fonts, and font styles can be turned on and off.\n\n**Basic Commands**\n\nThese enum values are all strings which can be embedded in input strings.\n\n* `CommandChar.BoldOn` - Turn bold on\n* `CommandChar.BoldOff` - Turn bold off\n* `CommandChar.ItalicOn` - Turn italic on\n* `CommandChar.ItalicOff` - Turn italic off\n* `CommandChar.StrikeOutOn` - Turn strike out on\n* `CommandChar.StrikeOutOff` - Turn strike out off\n* `CommandChar.UnderlineOn` - Turn underline on\n* `CommandChar.UnderlineOff` - Turn underline off\n* `CommandChar.OverlineOn` - Turn overline on\n* `CommandChar.OverlineOff` - Turn overline off\n\n**Color Commands**\n\n`QColor` instances can be loaded into 1 of 15 slots. Color commands can be used inside the string to load a color from a slot. The commands and slots are available in the `ColorSlot` enum and are `n0`-`n14` and `default`. The `default` command resets the color back to the default.\n\n```typescript\nconst delegate = new TurboTextDelete();\nconst myColor = new QColor(255, 0, 0);\ndelegate.setColor(ColorSlot.n0, myColor);\n\n// ...\n\nconst myString = `A ${ColorSlot.n0}colorful${ColorSlot.default} word`;\n```\n\n**Font Commands**\n\n`QFont` instances can be loaded into 1 of 15 slots. Font commands can be used inside the string to load a font from a slot. The commands and slots are\navailable in the `FontSlot` enum and are named `n0`-`n14` and `default`. The `default` command resets the font back to the default.\n\n```typescript\nconst delegate = new TurboTextDelete();\ndelegate.setFont(FontSlot.n0, myFont);\n```\n\n# Install via NPM:\n\n```\nnpm install nodegui-plugin-rich-text-delegate\n```\n\nFor the API see [src/index.ts](src/index.ts)\n\nFor a complete demo see [src/demo.ts](src/demo.ts)\n\n# Maintainer\n\nSimon Edwards \u003csimon@simonzone.com\u003e\n\n# License\n\nMIT\n\n# Release Process (for maintainers)\n\n* Make sure the version in `package.json` is correct.\n* Tag the version with git (format: v1.2.3).\n* Push the tag to origin.\n* Wait for GitHub Action to build and release to NPM.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsedwards2009%2Fnodegui-plugin-rich-text-delegate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsedwards2009%2Fnodegui-plugin-rich-text-delegate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsedwards2009%2Fnodegui-plugin-rich-text-delegate/lists"}