{"id":22930203,"url":"https://github.com/jhuckaby/syntax-clip","last_synced_at":"2025-09-05T13:40:05.440Z","repository":{"id":65513531,"uuid":"217611426","full_name":"jhuckaby/syntax-clip","owner":"jhuckaby","description":"Syntax highlight code in your clipboard (macOS only).","archived":false,"fork":false,"pushed_at":"2019-10-25T20:42:54.000Z","size":5,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-26T21:18:16.385Z","etag":null,"topics":["clipboard","macos","syntax-highlighting"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhuckaby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-25T20:40:08.000Z","updated_at":"2021-04-20T15:39:50.000Z","dependencies_parsed_at":"2023-01-26T20:45:16.432Z","dependency_job_id":null,"html_url":"https://github.com/jhuckaby/syntax-clip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jhuckaby/syntax-clip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuckaby%2Fsyntax-clip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuckaby%2Fsyntax-clip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuckaby%2Fsyntax-clip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuckaby%2Fsyntax-clip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhuckaby","download_url":"https://codeload.github.com/jhuckaby/syntax-clip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuckaby%2Fsyntax-clip/sbom","scorecard":{"id":519230,"data":{"date":"2025-08-11","repo":{"name":"github.com/jhuckaby/syntax-clip","commit":"abc7d1181a4e1709db33f6abe4139e7dfaac8270"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T02:33:17.449Z","repository_id":65513531,"created_at":"2025-08-20T02:33:17.449Z","updated_at":"2025-08-20T02:33:17.449Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273766993,"owners_count":25164459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clipboard","macos","syntax-highlighting"],"created_at":"2024-12-14T10:26:57.803Z","updated_at":"2025-09-05T13:40:05.409Z","avatar_url":"https://github.com/jhuckaby.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis module will syntax-highlight any text on your clipboard, so you can paste pretty-looking code snippets into any rich text editor (e-mail, doc, etc.).  Specifically, the module will:\n\n1. Grab any plain text from your clipboard.\n2. Normalize indentation (strip excess leading whitespace).\n3. Perform syntax highlighting via [highlight.js](https://highlightjs.org/).\n4. Inline all CSS rules, for a portable HTML blob.\n5. Save the formatted HTML back onto your clipboard.\n\nYou can customize the **language** (default is auto-detect, [supports many](https://highlightjs.org/static/demo/)), **font family** (defaults to `Courier, monospace`), **font size** (defaults to inherit), and **theme** (defaults to `atom-one-light`, [supports many](https://highlightjs.org/static/demo/)).  See the command-line options below for details.\n\nNote that this module currently only works on macOS.  Also note that [Visual Studio Code](https://code.visualstudio.com/) already does this trick natively when you copy code to the clipboard, so this module is probably useless to you if you use that app.\n\n# Usage\n\nFirst, make sure you have [Node.js](https://nodejs.org/en/download/) installed on your Mac.  Then, use [npm](https://www.npmjs.com/) to install the module as a command-line executable like so:\n\n```\nnpm install -g syntax-clip\n```\n\nDepending on your machine and folder permissions, you might have to run the above command with `sudo`.\n\nNow, try copying some code to your clipboard, and enter the following command into the Terminal:\n\n```\nsyntax-clip\n```\n\nThat's it!  Now try pasting into a rich text editor, and you will see your beautiful, syntax-highlighted code.\n\n## Command-Line Options\n\nThe following command-line options are available:\n\n### --language\n\nBy default, the language is automatically detected by the code on your clipboard.  However, you can force it by specifying a `--language` argument.  The accepted languages are listed [here](https://github.com/highlightjs/highlight.js/tree/master/src/languages) (omit the `.js` extension).  Example:\n\n```\nsyntax-clip --language javascript\n```\n\nLive previews are available [here](https://highlightjs.org/static/demo/).\n\n### --style\n\nBy default, the `atom-one-light` style is used.  However, you can specify any of the themes listed [here](https://github.com/highlightjs/highlight.js/tree/master/src/styles) (omit the `.css` extension), by specifying a `--style` argument.  Example:\n\n```\nsyntax-clip --style tomorrow\n```\n\nLive previews are available [here](https://highlightjs.org/static/demo/).\n\n### --font\n\nBy default, the font family used is `Courier,monospace`.  To customize this, use the `--font` argument.  You can also specify multiple fallback fonts, comma separated.  Example:\n\n```\nsyntax-clip --font \"Inconsolata,Monaco,monospace\"\n```\n\nPlease note that custom fonts are not embedded into the HTML, so you should use universally supported fonts, and always append `,monospace` at the end for a universal generic fallback.\n\n### --size\n\nBy default, no size is specified, so the code snippet will inherit whatever size your document is currently using.  To customize this, add a `--size` argument, and use any of the CSS size units like `pt` or `px`.  Example:\n\n```\nsyntax-clip --size 14px\n```\n\n## Global Keyboard Shortcut\n\nTo add a global keyboard shortcut on macOS, you first need to wrap the call to `syntax-clip` in an AppleScript.  To do this, open the **Script Editor** application (located in Applications/Utilities), and enter this text:\n\n```applescript\ndo shell script \"/usr/local/bin/node /usr/local/bin/syntax-clip\"\n```\n\nPlease note that the location of your Node.js binary may be different than mine, so change `/usr/local/bin/node` to the correct location.  To determine what this should be, open Terminal and type `which node`.  This is important because AppleScripts run without a proper shell environment, so they are often missing things like your standard `PATH` variable.\n\nAlso note that the location of the installed `syntax-clip` binary may differ from mine, so change `/usr/local/bin/syntax-clip` to the correct location.  To determine what this should be, open Terminal and type `which syntax-clip`.\n\nOnce this is complete, save your AppleScript somewhere central such as in `~/Library/Scripts/`.\n\nNext, you need to assign a global keyboard shortcut to the script.  To do this, you can either use a commercial application such as [Alfred](http://www.alfredapp.com/), [Keyboard Maestro](http://www.keyboardmaestro.com/main/), or [FastScripts](http://www.red-sweater.com/fastscripts/index.html), or you can do it the manual way...\n\n1. Open **Automator** (located in your /Applications folder).\n2. In the dialog that pops up, select **Quick Action** and click the **Choose** button.\n3. In the search field on the left sidebar, enter `applescript`.\n4. Drag the **Run AppleScript** action to the right-hand pane.\n5. Paste the `do shell script...` line into the text field, replacing all the demo code.\n6. From the menu bar, select **File** → **Save...** and give it a name such as `Syntax Clip`.\n7. Quit Automator.\n8. Open **System Preferences**, then click on the **Keyboard** icon.\n9. Click on the **Shortcuts** tab, then click on **⚙️Services** on the left side.\n10. Scroll down the right pane until you see your Quick Action (should be under **General**).\n11. Click on your action and you should see a **Add Shortcut** button appear.  Click it.\n12. Type your desired keyboard shortcut.\n13. Quit System Preferences.\n\n**Note:** These instructions are for macOS Mojave specifically.  Things may be quite different in older or newer OS versions.\n\n# License (MIT)\n\n**The MIT License**\n\n*Copyright (c) 2019 Joseph Huckaby.*\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuckaby%2Fsyntax-clip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhuckaby%2Fsyntax-clip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuckaby%2Fsyntax-clip/lists"}