{"id":43252172,"url":"https://github.com/thoughtsunificator/bbcode-parser-template","last_synced_at":"2026-02-01T13:12:48.933Z","repository":{"id":46622376,"uuid":"377437114","full_name":"thoughtsunificator/bbcode-parser-template","owner":"thoughtsunificator","description":"Template system for bbcode-parser","archived":false,"fork":false,"pushed_at":"2023-08-15T14:10:23.000Z","size":1388,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T19:10:41.704Z","etag":null,"topics":["bbcode-parser","template"],"latest_commit_sha":null,"homepage":"http://bbcode-parser-template.unificator.me","language":"JavaScript","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/thoughtsunificator.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}},"created_at":"2021-06-16T09:11:33.000Z","updated_at":"2023-08-15T13:26:27.000Z","dependencies_parsed_at":"2022-07-20T18:49:48.332Z","dependency_job_id":null,"html_url":"https://github.com/thoughtsunificator/bbcode-parser-template","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/thoughtsunificator/bbcode-parser-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtsunificator%2Fbbcode-parser-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtsunificator%2Fbbcode-parser-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtsunificator%2Fbbcode-parser-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtsunificator%2Fbbcode-parser-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtsunificator","download_url":"https://codeload.github.com/thoughtsunificator/bbcode-parser-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtsunificator%2Fbbcode-parser-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28978967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T12:13:08.691Z","status":"ssl_error","status_checked_at":"2026-02-01T12:13:08.356Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bbcode-parser","template"],"created_at":"2026-02-01T13:12:45.934Z","updated_at":"2026-02-01T13:12:48.919Z","avatar_url":"https://github.com/thoughtsunificator.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bbcode-parser-template\n\nTemplate system for [bbcode-parser](https://github.com/thoughtsunificator/bbcode-parser).\n\n## Getting started\n\n### Prerequisites\n\n- [bbcode-parser](https://github.com/thoughtsunificator/bbcode-parser)\n\n### Installing\n\n``npm install @thoughtsunificator/bbcode-parser-template``\n\n### Usage\n\n#### Creating a Code\n\n``src/codes/b.js``\n```javascript\n\nimport { Code } from '@thoughtsunificator/bbcode-parser-template'\nimport { BBElement } from '@thoughtsunificator/bbcode-parser'\n\nexport default class extends Code {\n\n  /**\n    * @readonly\n    * @type {string}\n    */\n  static tagName = \"b\"\n\n  /**\n    * @param {Node} node\n    * @returns {boolean}\n    */\n  static testNode(node) {\n    return node.nodeName === \"SPAN\" \u0026\u0026 node.style.fontWeight === \"bold\"\n  }\n\n  /**\n    * @param {Conversion} conversion\n    * @returns {BBNode}\n    */\n  static createBBNode(conversion) {\n    const bbNode = new BBElement(\"b\")\n    return bbNode\n  }\n\n  /**\n    * @param {Conversion} conversion\n    * @returns {Node}\n    */\n  static createNode(conversion) {\n    const node = document.createElement(\"span\")\n    node.style.fontWeight = \"bold\"\n    return node\n  }\n\n}\n```\n\n#### Converting BBCode to HTML and vice versa \n\n``src/app.js``\n```javascript\nimport { Template } from \"../lib/bbcode-parser-template/index.js\"\nimport b from \"./codes/b.js\"\n\nconst template = new Template([b], document)\n\nconsole.log(Template.toHTML(\"[b]Test[/b]\")\n\nconsole.log(Template.toBBCode(`\u003cspan style=\"font-weight: bold\"\u003eTest\u003c/span\u003e`)\n\n```\n\n### API\n\nYou can read the API by visiting [http://bbcode-parser-template.unificator.me](http://bbcode-parser-template.unificator.me).\n\n## Example\n\nSee [https://github.com/thoughtsunificator/bbcode-parser-template-example](https://github.com/thoughtsunificator/bbcode-parser-template-example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtsunificator%2Fbbcode-parser-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtsunificator%2Fbbcode-parser-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtsunificator%2Fbbcode-parser-template/lists"}