Lepton depends on GitHub's API to detect snippet language. If GitHub cannot classify the language, Lepton marks it as Other.
You can add a Vim modeline at the top of the snippet to give GitHub a language hint:
// vim: syntax=javascript
let test = 'This is a javascript file'The default search shortcut is Shift + Space.
Lepton can search these fields:
- filename
- language
- description
- tag
- snippet id
- downloaded snippet file content
Complete global content search across every snippet requires the
snippet.downloadAll option to be enabled before syncing. When downloadAll is
disabled, content search only covers snippets whose details and file content have
already been downloaded locally, such as snippets opened during the session.
See Configuration for the snippet.downloadAll option.
Use this pattern in the snippet description to set a title and custom tags:
[title] description #tag1 #tag2
Legacy tag syntax is also supported:
[title] description #tags: tag1, tag2
.leptonrc is Lepton's user configuration file. It is parsed when the app starts and is not created automatically.
Create .leptonrc in the home directory reported by Electron. In Lepton v1.9.0 and later, the exact path is shown on the About page (Command/Ctrl + ,).
See Configuration for the current template and option list.
Adding a locale touches both the renderer catalog and the packaged Electron locale resources:
- Add
app/utilities/i18n/locales/<locale>.js, usingen.jsas the complete key reference. - Import the catalog in
app/utilities/i18n/index.js, add it tocatalogs, and add the display name tosupportedLocales. - Update
tests/utilities/i18n.test.jsso the new catalog is checked for key shape, translated values, and package-locale coverage. - Update the supported
i18n.localelists inREADME.mdandwiki/configuration.md. - Update
configs/electronLanguages.jsif the new Lepton locale needs a different Electron/Chromium resource name in packaged apps.electron-builder.jsderives the packaged locale list fromgetSupportedLocales(), so do not add a separate hard-coded list topackage.json. - Validate with
npm run test:unitandnpm run test:packaged-smoke. For packaged builds, confirm every Lepton-supported locale is present and intentionally unsupported Electron locales are absent.
Put proxy settings in .leptonrc:
{
"proxy": {
"enable": true,
"address": "socks://localhost:1080"
}
}See Configuration for all proxy-related options.
Create a GitHub personal access token with the gist scope enabled. Then add your GitHub Enterprise host and token to .leptonrc:
{
"enterprise": {
"enable": true,
"host": "github.example.com",
"token": "token_with_gist_scope",
"avatarUrl": ""
}
}See Configuration for the full enterprise option list.
Lepton can use token login instead of GitHub OAuth credentials. Create a
GitHub personal access token with the gist scope, then paste that token into
Lepton's token login screen.
The fastest path is GitHub's prefilled token page:
Create a Lepton token with the gist scope.
If you create the token manually:
- Open GitHub, then go to Settings -> Developer settings -> Personal access tokens -> Tokens (classic).
- Select Generate new token -> Generate new token (classic).
- Enter a descriptive note, such as
Lepton, and choose an expiration. - Under Select scopes, enable only
gist. - Click Generate token and copy the token immediately. GitHub only shows it once.
For GitHub Enterprise, create the token on your Enterprise host with the same
gist scope.
Lepton is a desktop snippet client backed by GitHub Gist and does not run its own sync service. Data is stored locally by the app or remotely in GitHub Gist.
Lepton does not accept personal donations. If you want to donate, consider donating to the Wikimedia Foundation, which helps sustain free knowledge through Wikipedia and related projects.
You are welcome to create an issue to share how much you contributed.