Skip to main content

Live preview and autoreload for editing SuperCollider HelpFiles.

Project description

schelp-watch

Live preview and autoreload for editing SuperCollider HelpFiles.

Installation

pipx install schelp-watch

How it works

schelp-watch runs a sclang process (with default config), to rebuild Help files whenever their source changes. It won't pollute your current HelpFiles cache, because by default it compiles to a temporary one.

The intended workflow is to freely edit HelpSources, and quickly see how they look in SuperCollider HelpBrowser. It can be used for editing SuperCollider main repo's HelpFiles, and as well for Extensions and Quarks.

Usage

schelp-watch can be used with no arguments. Just cd to your Extension folder, or to your supercollider's main repo clone, and run:

schelp-watch

It will detect build or extension mode, watch your .schelp files, run SC HelpBrowser and autoreload.

build mode

Use this for editing HelpSource in SuperCollider main repo:

  • it needs to find a build folder, if not provided with one
  • it will then use the sclang binary from that build folder, and also its sclang_config file.
  • it will watch the HelpSource folder, one level above the build folder

If schelp-watch is run without specifying a mode, and those three conditions are met, it will start in "build mode" automatically. Otherwise it can be specified explicitly:

schelp -b BUILD_FOLDER

extension mode

Use this for editing Quarks or Extension HelpFiles.

  • start default sclang with default config
  • add EXTENSION_FOLDER to sclang include paths (after compilation)
schelp -e EXTENSION_FOLDER 

schelp-watch will start in extension mode automatically if it can't start in build mode, and if it can find any .schelp file in any subdirectory of PATH.

Full usage:

$ ./schelp-watch -h
usage: schelp-watch [-h] [--build | --extension] [--target helpTarget] [--sclang sclangCommand] [--config sclangConfig] [--quiet]
                    [--no-preview]
                    [PATH]

Watches .schelp files, rebuilding and previewing Help files on source changes. It can be used in build mode (for editing help files in
SuperCollider's main repo), or extension mode (for Quarks and Extensions help files). If no mode is provided, schelp-watch will try to
detect it automatically.

positional arguments:
  PATH                  in build mode: build folder; in extension mode: extension folder (default: current directory)

options:
  -h, --help            show this help message and exit
  --build, -b           specify "build mode": will find sclang, config and HelpSource from PATH (useful to work on sc main codebase). Use
                        it when editing help files in sc main repo
  --extension, -e       specify "extension mode": adds PATH to SuperCollider default HelpSource paths. Use it when editing Quarks and
                        Extensions.
  --target helpTarget   Optional: where to save compiled HelpFiles (default: make a temporary folder)
  --sclang sclangCommand
                        Optional: sclang command (default: sclang)
  --config sclangConfig
                        Optional: sclang config file
  --quiet, -q           hide sclang output
  --no-preview, -n      write to target, but don't open HelpBrowser

Dependencies

Known issues

  • Still completely untested on mac and windows. Most certainly requires more work for those platforms.
  • The most "secure" way to use this tool is to make sure it's running an sclang instance that was compiled together with SCClassLibrary and HelpSource in use. This ensures sclang will be able to compile the class library, and SCDoc will be able to find all methods that are defined in the HelpSource. Errors can happen when, for instance, using an older version of sclang with the SCClassLibrary and/or HelpSource from git's develop branch. This is why this tool's build mode was introduced.

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

schelp_watch-0.0.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

schelp_watch-0.0.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file schelp_watch-0.0.2.tar.gz.

File metadata

  • Download URL: schelp_watch-0.0.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for schelp_watch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cce27f950d750d1b21dd8dc1ee513551609692a63e12e52afbaf129eda19dcc7
MD5 4734942513584ab9cfa53e6960c34bb6
BLAKE2b-256 8a803270cbffc54af9cdac9e461903d7954d00e82ea954cb4d0bf435f87acf00

See more details on using hashes here.

File details

Details for the file schelp_watch-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for schelp_watch-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b11d36e188e96495ec07a94e1b49edc7776927c1906bc03a7c31648544d1c68
MD5 bc13018ac1c34d2095beb275c200c662
BLAKE2b-256 a0dda8bcc144cc1414bcc7bfc39206bed8c76ec1ec27ca299c3606d503450d88

See more details on using hashes here.

Supported by

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