openstyles / openstyles/stylus
Integrating Stylus to external text editors
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- JavaScript
- Stars
- 6.9k
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
So I am working on a new extension that brings the power of external editing to Stylus. We can integrate it directly to Stylus when the project is usable.
For now here is the summary:
- We have a multiple platform compatible native integration; https://github.com/openstyles/native-client. This project is forked from https://github.com/andy-portmen/native-client. I have modified the source code so we can now write native NodeJS code inside our extension code. The native client can be installed in Windows, Mac, and Linux for now. I've tried the Mac version, not the rest! We have automated OS specific installers here; https://github.com/openstyles/native-client/releases. The project is automatically compiled here https://travis-ci.org/openstyles/native-client
- There is a simple extension to demonstrate how native integration works. https://github.com/openstyles/sample-native-extension. Basically, we can compile a NodeJS code in the extension side like https://github.com/openstyles/sample-native-extension/blob/master/background.js#L18-L20. Note that all required modules need permission before they are functional; https://github.com/openstyles/sample-native-extension/blob/master/background.js#L16. The native client only understands two commands:
{method: 'spec'}{permissions:[], script: "/*NodeJS script here*/"}
- The actual external editor integration is in https://github.com/openstyles/stylus-external-editor. For now, it performs the following actions when called.
- creates a temporary file in the OS level temporary directory
- Opens the temporary file in Sublime Text (this part is written to work for Mac OS for now)
- Watches file changes and prints the entire file in the console when a change is registered.
Notes:
- Since the "stylus-external-editor" extension has no id, you need to modify https://github.com/openstyles/native-client/blob/master/config.js with the correct extension id before running the installer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked openstyles/native-client and sample-native-extension projects, then inspect stylus-external-editor and native-client/config.js. The issue describes a prototype for temporary files, Sublime Text, and file watching, but does not define the Stylus entry point or acceptance criteria for completing the integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- desktop, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100