prod3v3loper/syntaxo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prod3v3loper/syntaxo

Composer 安装命令:

composer require prod3v3loper/syntaxo

包简介

Multi Syntax Highlighter programmed with PHP. Immediately ready for use and can be used anywhere in seconds.

README 文档

README

Melabuai Logo

Language Packgist PHP Version Packagist Version Repo Siz Code Siz Github Release date MIT License 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

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 local or global. Check for more Tutorial - NetBeans with Composer and Packagist for this one.

You found the package on Packigist - Syntaxo.

Add the Syntaxo dependencie to the composer.json and set the autoload.

{
    "autoload": {
        "psr-4": { "Syn\\": "src/" }
    },
    "require": {
        "prod3v3loper/syntaxo": ">=1.0"
    },

Now run the composer install command with php

php composer.phar install

index.php

require_once __DIR__ . '/vendor/autoload.php';
$HIGHLIGHT = new \Syn\Syntaxo();
echo $HIGHLIGHT->process('
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Highlight</title>
  </head>
  <body>
    <!-- Content -->
  </body>
</html>
');

Git Install

git clone https://github.com/prod3v3loper/syntaxo.git /Users/username/projects/

Get per Git or download and use it.

index.php

require_once './src/Syntaxo.php';
$HIGHLIGHT = new \Syn\Syntaxo();
echo $HIGHLIGHT->process('
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Highlight</title>
  </head>
  <body>
    <!-- Content -->
  </body>
</html>
');

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.

// HTML
"/(&lt;\!\-\-[[:space:]]*.*[[:space:]]*\-\-&gt;)/isU" => '<span class="c">\\1</span>',
// JavaScript
"/(\/\/.*\n+)/isU" => '<span class="c">\\1</span>',
// CSS
"/(?<!\w)((\/\*\s*|\*\s*)([^\[|\#]*)(\*\/)?)/i" => '<span class="c">\\1</span>',

Preview

The index.php preview

Contribute

Please read the contributing.

Authors

Samet Tarim prod3v3loper

License

MIT

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固