@jupyterlab/rendermime 4.5.4 → 4.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tokens.d.ts CHANGED
@@ -163,6 +163,26 @@ export interface ILatexTypesetter extends IRenderMime.ILatexTypesetter {
163
163
  */
164
164
  export declare const IMarkdownParser: Token<IRenderMime.IMarkdownParser>;
165
165
  export interface IMarkdownParser extends IRenderMime.IMarkdownParser {
166
+ /**
167
+ * Parse markdown and extract heading metadata.
168
+ *
169
+ * @param source - The markdown string to parse.
170
+ * @returns - A promise of heading metadata.
171
+ */
172
+ getHeadingTokens?: (source: string) => Promise<IMarkdownHeadingToken[]>;
173
+ }
174
+ /**
175
+ * Markdown heading metadata.
176
+ */
177
+ export interface IMarkdownHeadingToken {
178
+ /**
179
+ * Line number in source markdown (0-based)
180
+ */
181
+ line: number;
182
+ /**
183
+ * Raw markdown text of the heading
184
+ */
185
+ raw: string;
166
186
  }
167
187
  /**
168
188
  * The URL resolver factory.
package/lib/tokens.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAI/E,OAAO,EAA6B,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAIrE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,KAAK,CAC1C,4CAA4C,EAC5C,+OAA+O,CAChP,CAAC;AA2KF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,yCAAyC,EACzC,iHAAiH,CAClH,CAAC;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,wCAAwC,EACxC,0DAA0D,CAC3D,CAAC;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,IAAI,KAAK,CACP,4CAA4C,EAC5C,uCAAuC,CACxC,CAAC"}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAI/E,OAAO,EAA6B,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAIrE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,KAAK,CAC1C,4CAA4C,EAC5C,+OAA+O,CAChP,CAAC;AA2KF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,yCAAyC,EACzC,iHAAiH,CAClH,CAAC;AAIF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,wCAAwC,EACxC,0DAA0D,CAC3D,CAAC;AA2BF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,IAAI,KAAK,CACP,4CAA4C,EAC5C,uCAAuC,CACxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/rendermime",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "description": "JupyterLab - RenderMime",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -41,13 +41,13 @@
41
41
  "watch": "tsc -b --watch"
42
42
  },
43
43
  "dependencies": {
44
- "@jupyterlab/apputils": "^4.6.4",
45
- "@jupyterlab/coreutils": "^6.5.4",
46
- "@jupyterlab/nbformat": "^4.5.4",
47
- "@jupyterlab/observables": "^5.5.4",
48
- "@jupyterlab/rendermime-interfaces": "^3.13.4",
49
- "@jupyterlab/services": "^7.5.4",
50
- "@jupyterlab/translation": "^4.5.4",
44
+ "@jupyterlab/apputils": "^4.6.5",
45
+ "@jupyterlab/coreutils": "^6.5.5",
46
+ "@jupyterlab/nbformat": "^4.5.5",
47
+ "@jupyterlab/observables": "^5.5.5",
48
+ "@jupyterlab/rendermime-interfaces": "^3.13.5",
49
+ "@jupyterlab/services": "^7.5.5",
50
+ "@jupyterlab/translation": "^4.5.5",
51
51
  "@lumino/coreutils": "^2.2.2",
52
52
  "@lumino/messaging": "^2.0.4",
53
53
  "@lumino/signaling": "^2.1.5",
@@ -55,7 +55,7 @@
55
55
  "lodash.escape": "^4.0.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@jupyterlab/testing": "^4.5.4",
58
+ "@jupyterlab/testing": "^4.5.5",
59
59
  "@types/jest": "^29.2.0",
60
60
  "@types/lodash.escape": "^4.0.6",
61
61
  "fs-extra": "^10.1.0",
package/src/tokens.ts CHANGED
@@ -204,7 +204,30 @@ export const IMarkdownParser = new Token<IRenderMime.IMarkdownParser>(
204
204
  'A service for rendering markdown syntax as HTML content.'
205
205
  );
206
206
 
207
- export interface IMarkdownParser extends IRenderMime.IMarkdownParser {}
207
+ export interface IMarkdownParser extends IRenderMime.IMarkdownParser {
208
+ /**
209
+ * Parse markdown and extract heading metadata.
210
+ *
211
+ * @param source - The markdown string to parse.
212
+ * @returns - A promise of heading metadata.
213
+ */
214
+ getHeadingTokens?: (source: string) => Promise<IMarkdownHeadingToken[]>;
215
+ }
216
+
217
+ /**
218
+ * Markdown heading metadata.
219
+ */
220
+ export interface IMarkdownHeadingToken {
221
+ /**
222
+ * Line number in source markdown (0-based)
223
+ */
224
+ line: number;
225
+
226
+ /**
227
+ * Raw markdown text of the heading
228
+ */
229
+ raw: string;
230
+ }
208
231
 
209
232
  /**
210
233
  * The URL resolver factory.