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.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for schelp_watch-0.0.3.tar.gz
Algorithm Hash digest
SHA256 71d1046ec946e2c8cf2461f75b081f510166f2a18de1d227ac50a2f305e585b4
MD5 07e2332d2a0078b8dad58dcacdc0e2e5
BLAKE2b-256 594f01c062cfc662e2db1006acd1b1b65a91f74d80a259d7ba70f044620de1e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: schelp_watch-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for schelp_watch-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e16307b6e99995ad9485acc5f9d07fc07e7e6187b09a888a6e2b928ff54a06ed
MD5 c5c280cb8b9c6802d6878be0c7b17101
BLAKE2b-256 0be39be7ec5b859d7ea1a5321f7266c027889ea9df85835924f80ef25db74834

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