Git Product home page Git Product logo

dycodehighlighter's Introduction

dyCodeHighlighter

Highlight code in the web page.

Status

license npm version

Documentation

Click here for the project documentation.

Getting Started

  • Download the latest release of this project.
  • Clone the repo: git clone https://github.com/yusufshakeel/dyCodeHighlighter.git
  • Install with npm: npm install dycodehighlighter
  • From jsDelivr CDN: https://www.jsdelivr.com/package/npm/dycodehighlighter

How to use?

Include the Javascript and Stylesheet file from the dist directory.

Then call the init() method of dyCodeHighlighter.

Sample:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>dyCodeHighlighter</title>
    <!-- dyCodeHighlighter stylesheet -->
    <link rel="stylesheet" href="path/to/dist/css/dycodehighlighter.min.css">
</head>
<body>
    
    <pre class='dyCodeHighlighter'>
      <code>
        // some code goes here...
      </code>
    </pre>

    <!-- dyCodeHighlighter javascript -->
    <script src="path/to/dist/js/dycodehighlighter.min.js"></script>
    <script>dyCodeHighlighter.init();</script>
</body>
</html>

Features

  • Style pre.dyCodeHighlighter code content
  • Show line numbers
  • Highlight lines
  • Show header info like: total lines and filename
  • Start line number from a custom integer value like -10, 0, 10 etc.
  • Theme: blue, choco, dark, gray
  • Custom style

License

It's free and released under MIT License Copyright (c) 2017 Yusuf Shakeel

Donate

Feeling generous :-) Buy me a cup of tea.

Donate via PayPal

dycodehighlighter's People

Watchers

 avatar  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.