Git Product home page Git Product logo

jsoniq-jupyterlab-extension's Introduction

jsoniq-jupyterlab-extension

jsoniq-jupyterlab-extension is a JupyterLab extension that adds support for Python magics to interact with the JSONiq language server. This extension allows users to enjoy language features of jsoniq cells within Python notebooks or .jq files. With the extension, syntax highlighting with CodeMirror is also enabled for jsoniq cells using the %%jsoniq magic or .jq files.

Features

  • JSONiq LSP integration - the extension provides integration for the LSP to execute within Python cells with the %%jsoniq magic.
  • Synax highlighting - syntax highlighting is automatically enabled for %%jsoniq magic cells within Python notebooks, and can be enabled for .jq files using the language selector of Jupyter.

Installation

To install the jsoniq-jupyterlab-extension, you can use npm or yarn. Make sure you have JupyterLab and the JupyterLSP extension installed before proceeding.

To install JupyterLSP, run:

pip install jupyter-lsp

To install the JSONiq Jupyter Extension, run:

# Using npm
npm install jsoniq-jupyterlab-extension

# Using yarn
yarn add jsoniq-jupyterlab-extension

After installing the package, you may need to enable the extension in JupyterLab:

jupyter labextension enable jsoniq-jupyterlab-extension

Usage

Once the extension is installed and enabled, the extension automatically recognizes jsoniq magic cells and files.

Example

%%jsoniq
for $book in json-file("books.json")
where $book.price lt 20
return $book.title

This cell should become highlighted and language features should be enabled.

Development

To contribute to the development of jsoniq-jupyterlab-extension, follow these steps:

  1. Clone the repository:

    git clone https://github.com/davidbuzatu-marian/jsoniq-jupyterlab-extension.git
    cd jsoniq-jupyterlab-extension
  2. Install dependencies:

    npm install
  3. Build the extension:

    npm run build
  4. Link the extension for local development:

    jupyter labextension link .
  5. Launch JupyterLab:

    jupyter lab

Building and testing the extension

To build the project for production, the following commands build the JavaScript files, build the Jupyter extension and install this result for local testing.

npm run build && npm run build-ext && jupyter labextension install .

Project Structure

  • src/: Contains the source code of the extension.
  • dest/plugin.js: The main entry point for the extension after building.
  • package.json: Contains the configuration and dependencies for the extension.
  • tests/: Contains a set of tests relating to syntax highlighting.

Contributing

We welcome contributions to the jsoniq-jupyter-lsp project! If you have any suggestions, bug reports, or pull requests, please feel free to subapache them on the GitHub repository.

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

jsoniq-jupyterlab-extension's People

Contributors

davidbuzatu-marian avatar

Watchers

Ghislain Fourny 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.