Giter Club home page Giter Club logo

filament-syntax-entry's Introduction

Filament Syntax Entry

Latest Version on Packagist Software License Total Downloads Stars

Add a Filament infolist entry for themeable syntax highlighting using highlight.js.

Installation

Install the package via composer:

composer require parallax/filament-syntax-entry

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-syntax-entry-views"

Quickstart

Add the SyntaxEntry to the $infolist->schema() method.

<?php

namespace App\Filament\Resources;

use Parallax\FilamentSyntaxEntry\SyntaxEntry;

class ProductResource extends Resource
{
    public static function infolist(Infolist $infolist): Infolist
    {
        return $infolist
            ->schema([
                SyntaxEntry::make('metadata'),
            ]);
    }
}

Setting the language

Automatic language detection is enabled by default so this isn't required, but if you would like to define the language used you may use the language() method:

SyntaxEntry::make('metadata')
    ->language('json');

To keep the bundle size down only the following languages are currently available:

  • bash
  • css
  • dockerfile
  • graphql
  • javascript
  • json
  • markdown
  • php
  • scss
  • shell
  • sql
  • typescript
  • xml
  • yaml

Setting the theme

You may override the default themes using the theme() and/or darkModeTheme() methods:

SyntaxEntry::make('metadata')
    ->theme('filament')
    ->darkModeTheme('filament-dark');

The following themes are currently available:

  • a11y-dark
  • a11y-light
  • agate
  • an-old-hope
  • androidstudio
  • arduino-light
  • arta
  • ascetic
  • atom-one-dark-reasonable
  • atom-one-dark
  • atom-one-light
  • brown-paper
  • codepen-embed
  • color-brewer
  • dark
  • default
  • devibeans
  • docco
  • far
  • felipec
  • filament-dark (default dark mode theme)
  • filament (default theme)
  • foundation
  • github-dark-dimmed
  • github-dark
  • github
  • gml
  • googlecode
  • gradient-dark
  • gradient-light
  • grayscale
  • hybrid
  • idea
  • intellij-light
  • ir-black
  • isbl-editor-dark
  • isbl-editor-light
  • kimbie-dark
  • kimbie-light
  • lightfair
  • lioshi
  • magula
  • mono-blue
  • monokai-sublime
  • monokai
  • night-owl
  • nnfx-dark
  • nnfx-light
  • nord
  • obsidian
  • panda-syntax-dark
  • panda-syntax-light
  • paraiso-dark
  • paraiso-light
  • pojoaque
  • purebasic
  • qtcreator-dark
  • qtcreator-light
  • rainbow
  • routeros
  • school-book
  • shades-of-purple
  • srcery
  • stackoverflow-dark
  • stackoverflow-light
  • sunburst
  • tokyo-night-dark
  • tokyo-night-light
  • tomorrow-night-blue
  • tomorrow-night-bright
  • vs
  • vs2015
  • xcode
  • xt256

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

filament-syntax-entry's People

Contributors

luke-parallax avatar prlxjosk avatar

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.