{"id":21277950,"url":"https://github.com/b13/codeblock","last_synced_at":"2025-10-14T12:04:19.456Z","repository":{"id":36378901,"uuid":"223967377","full_name":"b13/codeblock","owner":"b13","description":"Code Block is a TYPO3 extension. It adds a content type to display source code processed using highlight.php to render code snippets with syntax highlighting.","archived":false,"fork":false,"pushed_at":"2024-09-04T11:13:59.000Z","size":69,"stargazers_count":4,"open_issues_count":3,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T02:09:21.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.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":"2019-11-25T14:25:53.000Z","updated_at":"2023-01-17T09:34:15.000Z","dependencies_parsed_at":"2023-02-14T16:45:32.969Z","dependency_job_id":null,"html_url":"https://github.com/b13/codeblock","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcodeblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcodeblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcodeblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fcodeblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/codeblock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225708281,"owners_count":17511635,"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-11-21T10:08:23.716Z","updated_at":"2025-10-14T12:04:14.420Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code Block\n\n## What does this extension do?\n\nCode Block is a TYPO3 extension. It adds a content type to display source code\nprocessed using `highlight.php` to render code snippets with syntax highlighting.\nThe CSS-classes applied are identical to what highlight.js would render, but the\ntransformation takes place on the server (instead of the browser when using JS).\n\nThe rendered result is cached like any other content element with the page in\nTYPO3. Using this extension you can skip adding highlight.js to your JS-build.\nThis helps reduce the JavaScript size for your website and also allows rendering\nof source code snippets for AMP pages for example.\n\n## Code Languages\n\nThe extension supports all code languages that highlight.php supports. These can\neither be specified by choosing a setting inside the content element or\ndetected automatically.\n\n## Installation\n\nAdd this extension to your TYPO3 setup. Install using composer: `composer req b13/codeblock`.\n\nAdd the TypoScript to your site extensions setup:\n\n`@import 'EXT:codeblock/Configuration/TypoScript/setup.typoscript'`\n\nAdd the PageTS (for adding the element to the New Content Element Wizard):\n\n`@import 'EXT:codeblock/Configuration/PageTs/PageTs.tsconfig'`\n\nIf you want to use your own Fluid Template, add the Template Root Path to the setup like this:\n\n`tt_content.codeblock.templateRootPaths.10 = EXT:your_site_extension/Resources/Private/Contenttypes/Templates`\n\n### A note for Integrators:\nIf your Fluid Layout \"Default\" uses `\u003cf:spaceless\u003e` you should use a custom content type Fluid Template to avoid having\nyour frontend tabs/spaces missing for some parts. `Spacelesse` removes spaces between tags, and `highlight.php` can add\na series of `\u003cspan\u003efoo\u003c/span\u003e \u003cspan\u003ebar\u003c/span\u003e` strings that need the spaces between the tags to be readable and make\nsense.\n\n## Styles\n\nCSS styling needs to be included manually. The classes added to the HTML output\nare generated automatically. Their styling need to be specified in a CSS file\nin order to add a custom styling. E.g. for JetBrain's darcula theme:\n\n```css\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #2b2b2b;\n}\n\n.hljs {\n  color: #bababa;\n}\n\n.hljs-strong,\n.hljs-emphasis {\n  color: #a8a8a2;\n}\n\n.hljs-bullet,\n.hljs-quote,\n.hljs-link,\n.hljs-number,\n.hljs-regexp,\n.hljs-literal {\n  color: #6896ba;\n}\n\n.hljs-code,\n.hljs-selector-class {\n  color: #a6e22e;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-section,\n.hljs-attribute,\n.hljs-name,\n.hljs-variable {\n  color: #cb7832;\n}\n\n.hljs-params {\n  color: #b9b9b9;\n}\n\n.hljs-string {\n  color: #6a8759;\n}\n\n.hljs-subst,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-symbol,\n.hljs-selector-id,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition {\n  color: #e0c46c;\n}\n\n.hljs-comment,\n.hljs-deletion,\n.hljs-meta {\n  color: #7f7f7f;\n}\n```\n\nThis extension uses `highlight.php` (see https://github.com/scrivo/highlight.php).\nThis package includes [a lot of different CSS style themes](https://github.com/scrivo/highlight.php/tree/master/styles) you can use.\n\n## License\n\nAs TYPO3 Core, _codeblock_ is licensed under GPL2 or later. See the LICENSE file for more details.\n\n## Background, Authors \u0026 Further Maintenance\n\nTYPO3 is highly configurable and it is easy to add custom content types to the system using a few lines of TCA\nconfiguration, a simple PageTS configuration to add the type to the list of elements in the New Content Element Wizard,\nand a few lines of TypoScript and a Fluid Template.\nThis extension adds a content type in the same way we create custom content types for our TYPO3 projects at\n[b13](https://b13.com).\n\n`EXT:codeblock` was initially created by Andreas Hämmerl and David Steeb in 2019 for [b13, Stuttgart](https://b13.com). We\nuse it to display source code in our blog on [b13.com](https://b13.com), where we have a full-AMP website and do not\ninclude non-AMP JavaScript files.\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fcodeblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fcodeblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fcodeblock/lists"}