|
112 | 112 | "a work-in-progress."
|
113 | 113 | ]
|
114 | 114 | },
|
| 115 | + { |
| 116 | + "cell_type": "markdown", |
| 117 | + "metadata": {}, |
| 118 | + "source": [ |
| 119 | + "### How to add custom icons for the completer?\n", |
| 120 | + "\n", |
| 121 | + "1. Prepare the icons in the SVG format (we use 16 x 16 pixels, but you should be\n", |
| 122 | + " fine with up to 24 x 24). You can load them for webpack in typescript using\n", |
| 123 | + " imports if you include a `typings.d.ts` file with the following content:\n", |
| 124 | + "\n", |
| 125 | + " ```typescript\n", |
| 126 | + " declare module '*.svg' {\n", |
| 127 | + " const script: string;\n", |
| 128 | + " export default script;\n", |
| 129 | + " }\n", |
| 130 | + " ```\n", |
| 131 | + "\n", |
| 132 | + " in your `src/`. You should probably keep the icons in your `style/`\n", |
| 133 | + " directory.\n", |
| 134 | + "\n", |
| 135 | + "2. Prepare `CompletionKind` → `IconSvgString` mapping for the light (and\n", |
| 136 | + " optionally dark) theme, implementing the `ICompletionIconSet` interface. We\n", |
| 137 | + " have an additional `Kernel` completion kind that is used for completions\n", |
| 138 | + " provided by kernel that had no recognisable type provided.\n", |
| 139 | + "\n", |
| 140 | + "3. Provide all other metadata required by the `ICompletionTheme` interface and\n", |
| 141 | + " register it on `ILSPCompletionThemeManager` instance using `register_theme()`\n", |
| 142 | + " method.\n", |
| 143 | + "\n", |
| 144 | + "4. Provide any additional CSS styling targeting the JupyterLab completer\n", |
| 145 | + " elements inside of `.lsp-completer-theme-{id}`, e.g.\n", |
| 146 | + " `.lsp-completer-theme-material .jp-Completer-icon svg` for the material\n", |
| 147 | + " theme. Rememmber to include the styles by importing the in one of the source\n", |
| 148 | + " files.\n", |
| 149 | + "\n", |
| 150 | + "For an example of a complete theme see\n", |
| 151 | + "[theme-vscode](https://github.com/krassowski/jupyterlab-lsp/tree/master/packages/theme-vscode)." |
| 152 | + ] |
| 153 | + }, |
115 | 154 | {
|
116 | 155 | "cell_type": "markdown",
|
117 | 156 | "metadata": {},
|
|
0 commit comments