Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prod3v3loper/syntaxo
🔮 Highlight your Syntax with one small php class 14.76 KiB and gzip: 4.03 KiB
https://github.com/prod3v3loper/syntaxo
composer css highlighter highlighting html javascript less mysql packigist perl php sass syntax syntax-highlighter syntax-highlighting syntax-theme syntaxhighlighter
Last synced: 2 days ago
JSON representation
🔮 Highlight your Syntax with one small php class 14.76 KiB and gzip: 4.03 KiB
- Host: GitHub
- URL: https://github.com/prod3v3loper/syntaxo
- Owner: prod3v3loper
- License: mit
- Created: 2017-04-27T15:13:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T00:27:34.000Z (8 months ago)
- Last Synced: 2024-05-14T01:38:35.381Z (8 months ago)
- Topics: composer, css, highlighter, highlighting, html, javascript, less, mysql, packigist, perl, php, sass, syntax, syntax-highlighter, syntax-highlighting, syntax-theme, syntaxhighlighter
- Language: PHP
- Homepage: https://www.tnado.com/open-source-projects-by-prod3v3loper/
- Size: 2.47 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
![Melabuai Logo](https://raw.githubusercontent.com/prod3v3loper/syntaxo/master/img/icon-MB.png "Melabuai Brand")
![Language](https://img.shields.io/github/languages/top/prod3v3loper/syntaxo.svg?style=flat "Language")
![Packgist PHP Version](https://img.shields.io/packagist/php-v/prod3v3loper/syntaxo.svg?style=flat "Packgist PHP Version")
[![Packagist Version](https://img.shields.io/packagist/v/prod3v3loper/syntaxo.svg?style=flat "Packigist Version")](https://packagist.org/packages/prod3v3loper/syntaxo "Packigist Version")
![Repo Siz](https://img.shields.io/github/repo-size/prod3v3loper/syntaxo.svg?style=flat "Repo Size")
![Code Siz](https://img.shields.io/github/languages/code-size/prod3v3loper/syntaxo.svg?style=flat "Code Size")
![Github Release date](https://img.shields.io/github/release/prod3v3loper/syntaxo.svg?style=flat "Github Release date")
[![MIT License](https://img.shields.io/packagist/l/prod3v3loper/syntaxo.svg?style=flat "MIT License")](https://github.com/prod3v3loper/syntaxo/blob/master/LICENSE "MIT License")
[![Website](https://img.shields.io/website-up-down-green-red/https/www.tnado.com/open-source-projects-by-prod3v3loper.svg?style=flat "Website")](https://www.tnado.com/open-source-projects-by-prod3v3loper/ "Website")**melabuai**
# 🔮 SYNTAXO
Multi Syntax Highlighter programmed with PHP. Immediately ready for use and can be used anywhere in seconds.
[Theme Page of this Site](https://prod3v3loper.github.io/syntaxo/)
![Size](https://img.shields.io/github/size/prod3v3loper/syntaxo/src/Syntaxo.php.svg "Size")
- HTML
- CSS
- LESS
- SASS
- JavaScript
- PHP
- MySQL
- Perl
And many more...# Usage
Very easy to use and very easy to modify. All you have to do is to include the file, instantiate the class, and call the method method with the string.
## Packagist with Composer
This solution extends the vendor autoloader because it calls the files with certain criteria. The extension allows you to call classes wherever the Autloder is involved.
Download [Composer](https://getcomposer.org/) local or global. Check for more [Tutorial - NetBeans with Composer and Packagist](https://www.tnado.com/blog/netbeans-with-composer-and-packagist-the-php-package-manager/) for this one.
You found the package on [Packigist - Syntaxo](https://packagist.org/packages/prod3v3loper/syntaxo).
Add the Syntaxo dependencie to the **composer.json** and set the autoload.
```json
{
"autoload": {
"psr-4": { "Syn\\": "src/" }
},
"require": {
"prod3v3loper/syntaxo": ">=1.0"
},
```Now run the composer install command with php
```
php composer.phar install
````index.php`
```php
require_once __DIR__ . '/vendor/autoload.php';
$HIGHLIGHT = new \Syn\Syntaxo();
echo $HIGHLIGHT->process('
Highlight
');
```## Git Install
```
git clone https://github.com/prod3v3loper/syntaxo.git /Users/username/projects/
```Get per [Git](https://git-scm.com/) or [download](https://github.com/prod3v3loper/syntaxo/archive/master.zip) and use it.
`index.php`
```php
require_once './src/Syntaxo.php';
$HIGHLIGHT = new \Syn\Syntaxo();
echo $HIGHLIGHT->process('
Highlight
');
```# REGEX MODIFY
Here's a snippet of Syntaxo regex for comments on each language. And you can modify them as needed and get even better results.
```php
// HTML
"/(<\!\-\-[[:space:]]*.*[[:space:]]*\-\->)/isU" => '\\1',
// JavaScript
"/(\/\/.*\n+)/isU" => '\\1',
// CSS
"/(? '\\1',
```# Preview
![The index.php preview](https://prod3v3loper.github.io/syntaxo/img/syntaxo-multi-syntax-highlighter.png "The index.php preview")
# Contribute
Please read the [contributing](https://github.com/prod3v3loper/syntaxo/blob/main/CONTRIBUTING.md).
# Authors
**Samet Tarim** [prod3v3loper](https://www.tnado.com/author/prod3v3loper/)
# License
[MIT](https://github.com/prod3v3loper/syntaxo/blob/master/LICENSE)