Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Aimes committed Aug 29, 2022
1 parent 436ec1a commit 92bbd2e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 17 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Aimes_PageBuilderCodeBlock

!["Supported Magento Version"][magento-badge] !["Latest Release"][release-badge]

* Compatible with _Magento Open Source_ and _Adobe Commerce_ `2.4.x`

## Features

Adds a new PageBuilder content type to display code snippets nicely, using [highlight.js][highlightjs].

<img width="965" alt="image" src="https://user-images.githubusercontent.com/4225347/187295986-84d7dd1f-4946-4c12-81c6-7fc7060eb3b9.png">
<img width="1073" alt="image" src="https://user-images.githubusercontent.com/4225347/187298138-341146d8-f6cf-4b87-899a-03219e88bda5.png">

## Planned Features / Improvements
- Markup rendered on save, instead of generated per page load
- Better `highlight.js` theme support
- Hyva Themes Support

## Requirements

* Magento Open Source or Adobe Commerce version with PageBuilder version `^2.2`
* May support `2.3.x` but only tested with `2.4.5`

## Installation

Please install this module via Composer. This module is hosted on [Packagist][packagist].

* `composer require aimes/module-page-builder-code-block`
* `bin/magento module:enable Aimes_PageBuilderCodeBlock`
* `bin/magento setup:upgrade`


## Licence
[GPLv3][gpl] © [Rob Aimes][author]

[magento-badge]:https://img.shields.io/badge/magento-2.3.x%20%7C%202.4.x-orange.svg?logo=magento&style=for-the-badge
[release-badge]:https://img.shields.io/github/v/release/robaimes/module-pagebuilder-code-block?sort=semver&style=for-the-badge&color=blue
[highlightjs]:https://highlightjs.org/
[packagist]:https://packagist.org/packages/aimes/module-page-builder-code-block
[gpl]:https://www.gnu.org/licenses/gpl-3.0.en.html
[author]:https://aimes.dev/
40 changes: 23 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{
"name": "aimes/module-page-builder-code-block",
"version": "1.0.0",
"description": "N/A",
"type": "magento2-module",
"require": {
"magento/framework": "*",
"magento/module-page-builder": "^2.2"
},
"license": [
""
],
"autoload": {
"files": [
"registration.php"
"name": "aimes/module-page-builder-code-block",
"type": "magento2-module",
"description": "Display fancy code snippets via PageBuilder",
"license": [
"GPL-3.0-or-later"
],
"psr-4": {
"Aimes\\PageBuilderCodeBlock\\": ""
"authors": [
{
"name": "Rob Aimes",
"email": "rob@aimes.dev",
"homepage": "https://aimes.dev"
}
],
"require": {
"magento/framework": "*",
"magento/module-page-builder": "^2.2"
},
"autoload": {
"psr-4": {
"Aimes\\PageBuilderCodeBlock\\": ""
},
"files": [
"registration.php"
]
}
}
}
4 changes: 4 additions & 0 deletions view/adminhtml/ui_component/pagebuilder_code_block_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
</settings>
<field name="content" sortOrder="10" formElement="textarea">
<settings>
<additionalClasses>
<class name="code-sample">true</class>
</additionalClasses>
<dataScope>content</dataScope>
<dataType>text</dataType>
<label translate="true">Content</label>
Expand All @@ -92,6 +95,7 @@
<settings>
<dataScope>language</dataScope>
<dataType>text</dataType>
<label translate="true">Language</label>
</settings>
<formElements>
<select>
Expand Down

0 comments on commit 92bbd2e

Please sign in to comment.