Skip to main content

Jupyterlab extension to add handling of Makefiles and syntax colouring support

Project description

jupyterlab_makefile_file_type_extension

GitHub Actions npm version PyPI version Total PyPI downloads JupyterLab 4 Brought To You By KOLOMOLO

A JupyterLab extension providing comprehensive Makefile support with syntax highlighting and custom file type recognition.

Makefile Extension Screenshot

Features

Comprehensive Makefile editing support in JupyterLab with syntax highlighting that distinguishes targets, variables, conditionals, and shell constructs.

File recognition:

  • Standard names: Makefile, makefile, GNUmakefile
  • Extensions: *.mk, *.mak, *.make
  • Custom red "M" icon in file browser

Highlighting coverage:

  • Build targets and dependencies
  • Variable references and shell constructs
  • Conditional directives
  • Special targets and silent commands
  • Line continuations and quoted strings

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

pip install jupyterlab_makefile_file_type_extension

Configuration

IMPORTANT: Configure Tab Character Usage

Makefiles require tab characters for recipe command indentation. Recipe lines starting with spaces instead of tabs will cause Make execution to fail with "missing separator" errors. Configure JupyterLab to use tabs:

  1. Open JupyterLab Settings → Settings Editor
  2. Navigate to Text Editor section
  3. Set Indentation Unit to Tab

Alternatively, add this to your JupyterLab Text Editor settings JSON:

{
  "editorConfig": {
    "indentUnit": "Tab"
  }
}

Note: All recipe commands (lines that execute shell commands under targets) MUST start with a tab character. The syntax highlighter requires tab-indented recipe lines for proper highlighting - space-indented recipes will not be highlighted and will fail during Make execution.

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_makefile_file_type_extension

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_makefile_file_type_extension directory

# Set up a virtual environment and install package in development mode
python -m venv .venv
source .venv/bin/activate
pip install --editable "."

# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

# Rebuild extension Typescript source after making changes
# IMPORTANT: Unlike the steps above which are performed only once, do this step
# every time you make a change.
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Development uninstall

pip uninstall jupyterlab_makefile_file_type_extension

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named jupyterlab_makefile_file_type_extension within that folder.

Testing the extension

Frontend tests

This extension is using Jest for JavaScript code testing.

To execute them, execute:

jlpm
jlpm test

Integration tests

This extension uses Playwright for the integration tests (aka user level tests). More precisely, the JupyterLab helper Galata is used to handle testing the extension in JupyterLab.

More information are provided within the ui-tests README.

Packaging the extension

See RELEASE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file jupyterlab_makefile_file_type_extension-1.0.83.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_makefile_file_type_extension-1.0.83.tar.gz
Algorithm Hash digest
SHA256 e6a628d61947c9177cbeb8360f3cf6f16a4c1c6aee747b75949e7759ddcb7008
MD5 b4afaa20d49053d20c1f1f8ad30d9969
BLAKE2b-256 bdd5e2ee462850adaeed869f4e78262b942f95b9d854e4949e22de386a0159b2

See more details on using hashes here.

File details

Details for the file jupyterlab_makefile_file_type_extension-1.0.83-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_makefile_file_type_extension-1.0.83-py3-none-any.whl
Algorithm Hash digest
SHA256 92cffc25e0ec066609f08e8a1abbc450a9f0464accb73379d0d8791d92676583
MD5 38270a6e1be469c1d4e9c2aebd14c0ec
BLAKE2b-256 16285d00dfef02fad55f837817eed466bd4bcccd5ec02f226f2e8a35686c3cdd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page