docusaurus-live-brython 3.0.0-beta.27 → 3.0.0-beta.28

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.
@@ -1,3 +1,3 @@
1
1
  import { RouterType } from '@docusaurus/types';
2
- export declare const runCode: (code: string, preCode: string, postCode: string, codeId: string, libDir: string, router: RouterType) => string;
2
+ export declare const runCode: (code: string, preCode: string, postCode: string, codeId: string, libDir: string, router: RouterType, cache?: boolean) => string;
3
3
  //# sourceMappingURL=bryRunner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bryRunner.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/WithScript/bryRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,eAAO,MAAM,OAAO,SACV,MAAM,WACH,MAAM,YACL,MAAM,UACR,MAAM,UACN,MAAM,UACN,UAAU,WA0BrB,CAAC"}
1
+ {"version":3,"file":"bryRunner.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/WithScript/bryRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,eAAO,MAAM,OAAO,SACV,MAAM,WACH,MAAM,YACL,MAAM,UACR,MAAM,UACN,MAAM,UACN,UAAU,UACX,OAAO,WA2BjB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { DOM_ELEMENT_IDS } from '../constants';
2
2
  import { sanitizePyScript } from './helpers';
3
- export const runCode = (code, preCode, postCode, codeId, libDir, router) => {
3
+ export const runCode = (code, preCode, postCode, codeId, libDir, router, cache = true) => {
4
4
  const lineShift = preCode
5
5
  .trim()
6
6
  .split(/\n/)
@@ -21,7 +21,8 @@ export const runCode = (code, preCode, postCode, codeId, libDir, router) => {
21
21
  */
22
22
  setTimeout(() => {
23
23
  window.__BRYTHON__.runPythonSource(src, {
24
- pythonpath: router === 'hash' ? [] : [libDir]
24
+ pythonpath: router === 'hash' ? [] : [libDir],
25
+ cache: cache
25
26
  });
26
27
  }, 0);
27
28
  return src;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-live-brython",
3
- "version": "3.0.0-beta.27",
3
+ "version": "3.0.0-beta.28",
4
4
  "description": "Docusaurus live code block component for python.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -8,7 +8,8 @@ export const runCode = (
8
8
  postCode: string,
9
9
  codeId: string,
10
10
  libDir: string,
11
- router: RouterType
11
+ router: RouterType,
12
+ cache: boolean = true
12
13
  ) => {
13
14
  const lineShift = preCode
14
15
  .trim()
@@ -30,7 +31,8 @@ export const runCode = (
30
31
  */
31
32
  setTimeout(() => {
32
33
  (window as any).__BRYTHON__.runPythonSource(src, {
33
- pythonpath: router === 'hash' ? [] : [libDir]
34
+ pythonpath: router === 'hash' ? [] : [libDir],
35
+ cache: cache
34
36
  });
35
37
  }, 0);
36
38
  return src;