Coder Social home page Coder Social logo

tempestphp / highlight Goto Github PK

View Code? Open in Web Editor NEW
563.0 563.0 30.0 1.08 MB

๐ŸŽจ Fast, extensible, server-side code highlighting for web and terminal

Home Page: https://tempest.stitcher.io/highlight/01-getting-started

License: MIT License

PHP 87.38% CSS 12.62%
code highlight php

highlight's Issues

Broken highlighting

use Tempest\Highlight\IsPattern;
use Tempest\Highlight\Pattern;
use Tempest\Highlight\Tokens\TokenType;

final readonly class NamespacePattern implements Pattern
{
    use IsPattern;

    public function getPattern(): string
    {
        return 'namespace (?<match>[\w\\\\]+)';
    }

    public function getTokenType(): TokenType
    {
        return TokenType::TYPE;
    }
}

JS: doc comments

I'll need to create a separate implementation for PHP and JS, since types are written differently.

PHP: Broken keywords

if (is_null($callback) && $abstract instanceof Closure) {

  • && is type
  • ) is type
  • static::$instance static is type
  • value instanceof Closure ? $value : fn () => $value) ? is type

highlight support

{_highlight_}
{*higlhight*}
{~blur~}
<span class="hl-em">highlight</span>
<span class="hl-strong">highlight</span>
<span class="hl-blur">highlight</span>

PHP: DNFTs don't work

(Foo&Bar)|null

The problem is with the brackets, which sometimes also match the function definition:

(Foo $bar

SQL highlighting is needed

SQL is one of the core multi-discipline 4th generation programming languages.

I'd suggest SQL 92 as the base. Here are the keywords:

  • SELECT
  • FROM
  • WHERE
  • INSERT INTO
  • UPDATE
  • DELETE
  • CREATE DATABASE
  • ALTER DATABASE
  • CREATE TABLE
  • ALTER TABLE
  • DROP TABLE
  • CREATE INDEX
  • DROP INDEX
  • JOIN
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL JOIN
  • UNION
  • UNION ALL
  • INTERSECT
  • EXCEPT
  • IN
  • BETWEEN
  • LIKE
  • NOT
  • AND
  • OR
  • AS
  • DISTINCT
  • GROUP BY
  • ORDER BY
  • HAVING
  • LIMIT
  • OFFSET
  • CASE
  • WHEN
  • THEN
  • ELSE
  • END
  • NULL
  • IS NULL
  • IS NOT NULL
  • EXISTS
  • ANY
  • ALL
  • SOME
  • CAST
  • CONVERT
  • CHAR
  • VARCHAR
  • INT
  • DATE
  • TIMESTAMP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.