Giter VIP home page Giter VIP logo

gitbook-plugin-datatables's Introduction

Gitbook Plugin for DataTables

This plugin integrates DataTables in your Gitbook Honkit website, with support for accessible HTML tables.

With regards to support for dynamic data source, note that the plugin can only inject data available at build time, when Gitbook Honkit generates your static website.

Installation

  • Install the plugin
npm install bcopy/gitbook-plugin-datatables
  • Add the plugin to your book.json, for example :
{
  "plugins": ["datatables"],
  (...)
  "pluginsConfig":{
    "datatables":{
            "config-url" : "/data/dtconfig.json",
            "default-config": {"pageLength": 50 }
    }
  }
}

DataTables Configuration

In order to configure your datatables, you can use inline HTML 5 data attributes for simple cases, or provide a JSON object associating a CSS selector with the datatable configuration you wish to see applied to matching DOM elements. For it to work, your JSON file must be valid, as in the example below.

For instance, to configure an HTML table bearing the ID "accounting", you could use :

{
   "#accounting":{
      "ajax":"/data/objects.txt",
      "columns":[
         { "data":"name" },
         { "data":"position" },
         { "data":"office" },
         { "data":"extn" },
         { "data":"start_date" },
         { "data":"salary" }
      ],
      "order":[ [ 2, "asc" ] ],
      "rowGroup":{ "dataSrc":"office" }
   }
}

Features

How to develop the plugin

Development environment installation

  • Prerequisites

    • You will need a JDK v11+
  • You can use the provided Gradle wrapper to install node locally (Alternatively you must have node v14+ installed)

    • ./gradlew installNode on Linux / Mac OSX
    • or gradlew.bat installNode on Windows
  • You can then setup your path and install the required dependencies :

    • If using the gradle wrapper : source ./setup-path.sh
    • npm install
  • Finally you can run the book in preview mode

    • npm run serve

Alternatively, you can install NodeJS locally.

Gitflow support in Gradle

  • Init gitflow
./gradlew initGitflow
  • Develop a new feature with
./gradlew featureStart
./gradlew featureFinish
  • Issue a new release with
./gradlew releaseStart
./gradlew releaseFinish

Please refer to https://github.com/hyasinfosec/gitflow-gradle-plugin

gitbook-plugin-datatables's People

Contributors

bcopy avatar

Watchers

 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.