Download the PHP package b13/codeblock without Composer

On this page you can find all versions of the php package b13/codeblock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codeblock

Code Block

What does this extension do?

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. The CSS-classes applied are identical to what highlight.js would render, but the transformation takes place on the server (instead of the browser when using JS).

The rendered result is cached like any other content element with the page in TYPO3. Using this extension you can skip adding highlight.js to your JS-build. This helps reduce the JavaScript size for your website and also allows rendering of source code snippets for AMP pages for example.

Code Languages

The extension supports all code languages that highlight.php supports. These can either be specified by choosing a setting inside the content element or detected automatically.

Installation

Add this extension to your TYPO3 setup. Install using composer: composer req b13/codeblock.

Add the TypoScript to your site extensions setup:

@import 'EXT:codeblock/Configuration/TypoScript/setup.typoscript'

Add the PageTS (for adding the element to the New Content Element Wizard):

@import 'EXT:codeblock/Configuration/PageTs/PageTs.tsconfig'

If you want to use your own Fluid Template, add the Template Root Path to the setup like this:

tt_content.codeblock.templateRootPaths.10 = EXT:your_site_extension/Resources/Private/Contenttypes/Templates

A note for Integrators:

If your Fluid Layout "Default" uses <f:spaceless> you should use a custom content type Fluid Template to avoid having your frontend tabs/spaces missing for some parts. Spacelesse removes spaces between tags, and highlight.php can add a series of <span>foo</span> <span>bar</span> strings that need the spaces between the tags to be readable and make sense.

Styles

CSS styling needs to be included manually. The classes added to the HTML output are generated automatically. Their styling need to be specified in a CSS file in order to add a custom styling. E.g. for JetBrain's darcula theme:

This extension uses highlight.php (see https://github.com/scrivo/highlight.php). This package includes a lot of different CSS style themes you can use.

License

As TYPO3 Core, codeblock is licensed under GPL2 or later. See the LICENSE file for more details.

Background, Authors & Further Maintenance

TYPO3 is highly configurable and it is easy to add custom content types to the system using a few lines of TCA configuration, a simple PageTS configuration to add the type to the list of elements in the New Content Element Wizard, and a few lines of TypoScript and a Fluid Template. This extension adds a content type in the same way we create custom content types for our TYPO3 projects at b13.

EXT:codeblock was initially created by Andreas Hämmerl and David Steeb in 2019 for b13, Stuttgart. We use it to display source code in our blog on b13.com, where we have a full-AMP website and do not include non-AMP JavaScript files.

Find more TYPO3 extensions we have developed 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.


All versions of codeblock with dependencies

PHP Build Version
Package Version
Requires scrivo/highlight.php Version ^9.15
php Version ^7.4 || ~8.0
typo3/cms-core Version ^10.4 || ^11.5 || ^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package b13/codeblock contains the following files

Loading the files please wait ....