Jakub Jirutka
a89fad58cf
Enable ESLint for tests and update rules overrides
2019-10-03 02:17:55 +02:00
Jakub Jirutka
7b90320c49
Fix code-style: Don't use template literals without placeholders
2019-10-02 02:18:58 +02:00
Jakub Jirutka
48f089c6d7
Use RegExp#exec instead of String#match where possible
...
See https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
2019-10-02 02:18:49 +02:00
Jakub Jirutka
909d01e732
Bump eslint packages to the latest versions and update rules
2019-10-02 02:18:49 +02:00
Jakub Jirutka
fd653f08de
Fix code-style: Remove unnecessary type annotation
2019-10-02 02:18:44 +02:00
Jakub Jirutka
db98cb4f74
Generalize renderer
2019-10-01 13:22:42 +02:00
Jakub Jirutka
0dd5a9ee53
Generalize elementCreator
2019-10-01 13:22:41 +02:00
Jakub Jirutka
ec70c7713e
Don't export HTMLElement from elementCreator module
2019-10-01 13:18:26 +02:00
Jakub Jirutka
782fc305e7
Set class using setAttribute() instead of className
...
To minimalize used HTMLElement's API surface.
2019-10-01 13:18:13 +02:00
Jakub Jirutka
34ab834a6d
Bump nodom to ^2.4.0
2019-09-30 17:23:42 +02:00
Jakub Jirutka
1e0126fc48
Release version 0.1.0-beta.4
2019-09-29 02:10:42 +02:00
Jakub Jirutka
a9a38c4419
Use JSX in renderer tests
2019-09-29 02:05:44 +02:00
Jakub Jirutka
e7d8cfa193
Add Jest matcher toMatchElement()
2019-09-29 02:04:50 +02:00
Jakub Jirutka
5dcada84dd
Add JSX support for tests
2019-09-29 02:03:02 +02:00
Jakub Jirutka
f4bca35e80
Add tests for renderer module
2019-09-29 02:03:01 +02:00
Jakub Jirutka
1416f80634
Improve matcher toHtmlEqual() to support array of elements
2019-09-29 02:02:14 +02:00
Jakub Jirutka
ac53ba2541
Refactor internal/utils.test to utilize jest-chain
2019-09-29 02:02:14 +02:00
Jakub Jirutka
3a46203257
Add jest-chain
2019-09-29 02:02:14 +02:00
Jakub Jirutka
1c91dcf9f3
Load test/setup.ts implicitly
2019-09-29 02:02:14 +02:00
Jakub Jirutka
35ba8cc87f
Handle empty cell.source in CodeCell() instead of Source()
2019-09-29 02:02:06 +02:00
Jakub Jirutka
f5e5006e04
Don't return undefined in executionCountAttrs()
2019-09-28 16:04:51 +02:00
Jakub Jirutka
21044fe8a2
Remove fallback to notebook.metadata.kernelspec.language
...
nbformat 4.x defines only `notebook.metadata.language_info.name` for the
notebook language. `notebook.metadata.kernelspec.language` is
non-standard, probably from some older nbformat version. It just
increases complexity for testing, so get rid of it.
2019-09-28 15:19:54 +02:00
Jakub Jirutka
7718f4b606
Change buildRenderer() to accept elementCreator as first argument
2019-09-28 15:19:53 +02:00
Jakub Jirutka
196b37827f
Disable ESLint rule consistent-type-definitions
...
It's actually better to use "interface" instead of "type" - interfaces
preserve their name in error messages, types do not (they are just
aliases).
2019-09-28 01:05:25 +02:00
Jakub Jirutka
85875d7663
Fix code-style in readNotebookTitle.test
2019-09-27 14:53:54 +02:00
Jakub Jirutka
17390b1e9d
Bump nodom to ^2.3.0
...
This version fixes the issue with duplicating element attributes.
2019-09-27 12:28:22 +02:00
Jakub Jirutka
ecce6b8485
Move module utils to directory internal
2019-09-26 18:17:51 +02:00
Jakub Jirutka
8771eff957
Fix attribute classes on Source's code element, should be class
2019-09-25 20:33:27 +02:00
Jakub Jirutka
a981901940
Fix argument type of embeddedImageEl()
2019-09-25 16:10:39 +02:00
Jakub Jirutka
9c19c9f340
Add type MultilineString to nbformat
2019-09-25 16:08:33 +02:00
Jakub Jirutka
7963bc442b
Handle unsupported Cell and Output types
2019-09-25 16:02:21 +02:00
Jakub Jirutka
3d2e312e4b
Add type MimeBundle to nbformat
2019-09-25 14:35:54 +02:00
Jakub Jirutka
0a4f4a09a3
Fix mathExtractor to recognize inline code
with line breaks
2019-09-24 01:36:54 +02:00
Jakub Jirutka
53dfd524e0
Use non-capturing groups inside regexps in mathExtractor
2019-09-24 01:16:11 +02:00
Jakub Jirutka
05d38601c1
Add tests for mathExtractor
2019-09-24 00:34:45 +02:00
Jakub Jirutka
5193f92ed2
Trim leading/trailing whitespaces in MathExpression.value
2019-09-23 17:40:36 +02:00
Jakub Jirutka
9c18c74085
Release version v0.1.0-beta.3
2019-09-22 23:29:10 +02:00
Jakub Jirutka
36131b9ed2
Add workaround for SageMath latex outputs
2019-09-22 23:26:58 +02:00
Jakub Jirutka
20f4dec62c
Release version 0.1.0-beta.2
2019-09-20 18:17:28 +02:00
Jakub Jirutka
745346150e
Add module readNotebookTitle
2019-09-20 18:15:25 +02:00
Jakub Jirutka
526a7b51ea
Fix wrong type of Notebook.nbformat
2019-09-18 13:18:00 +02:00
Jakub Jirutka
1d4dd89b21
Release version 0.1.0-beta.1
2019-09-18 00:00:05 +02:00
Jakub Jirutka
cee6f20158
Replace ansi_up with anser
...
It's smaller...
2019-09-17 23:54:58 +02:00
Jakub Jirutka
a944bf2d27
Pre-configure renderer with all external components
2019-09-17 23:54:58 +02:00
Jakub Jirutka
030b4297ba
Add markdownRenderer with marked, katex and highlight.js
2019-09-17 23:54:58 +02:00
Jakub Jirutka
457e1716d9
mathExtractor: Escape marker-like sequences instead of returning them
2019-09-17 23:54:57 +02:00
Jakub Jirutka
34cf2c4620
Replace if-else-if statements with switch statement
...
I think that it's a bit more readable. But still, why TypeScript still
doesn't have pattern matching, only this crappy C-like switch? :(
2019-09-17 22:06:03 +02:00
Jakub Jirutka
86754fbd98
Reformat comments on renderer.Options
2019-09-17 22:06:03 +02:00
Jakub Jirutka
ca9bae9483
Don't escape math that will be passed to math renderer
...
KaTeX doesn't interpret escaped <>& correctly and it escapes unsafe
characters in the output implicitly.
2019-09-17 22:06:02 +02:00
Jakub Jirutka
18a7a512cc
Don't escape text passed to codeHighlighter
...
highlight.js does it implicitly.
2019-09-16 23:08:32 +02:00