Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 76e7995

Browse files
committed
In text search, 1.2.6
1 parent 903a5dd commit 76e7995

File tree

8 files changed

+149
-12
lines changed

8 files changed

+149
-12
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vendor/CodeMirror-search"]
2+
path = vendor/CodeMirror-search
3+
url = [email protected]:mobitar/CodeMirror-search.git

dist/dist.css

+18-3
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ span.CodeMirror-selectedtext { background: none; }
782782
resize: none;
783783
}
784784
.sn-component input.sk-input.clear {
785+
color: var(--sn-stylekit-foreground-color);
785786
background-color: transparent;
786787
border: none;
787788
}
@@ -2229,7 +2230,10 @@ body, html {
22292230
position: relative;
22302231
height: 100%;
22312232
overflow: hidden;
2232-
padding-right: 20px;
2233+
}
2234+
2235+
.CodeMirror-scroll {
2236+
padding: 8px;
22332237
}
22342238

22352239
.CodeMirror {
@@ -2243,15 +2247,18 @@ body, html {
22432247
height: 100%;
22442248
resize: none;
22452249
font-size: var(--sn-stylekit-font-size-editor);
2246-
padding: 15px;
2247-
padding: 8px;
2250+
padding: 0;
22482251
}
22492252
.CodeMirror .CodeMirror-code .cm-comment {
22502253
background: var(--sn-stylekit-contrast-background-color);
22512254
color: var(--sn-stylekit-info-color);
22522255
font-family: Consolas, monaco, "Ubuntu Mono", courier, monospace !important;
22532256
font-size: 90%;
22542257
}
2258+
.CodeMirror .CodeMirror-code .cm-comment.CodeMirror-selectedtext {
2259+
color: var(--sn-stylekit-info-contrast-color) !important;
2260+
background: transparent;
2261+
}
22552262
.CodeMirror .cm-header {
22562263
color: var(--sn-stylekit-editor-foreground-color);
22572264
}
@@ -2261,9 +2268,17 @@ body, html {
22612268
.CodeMirror .cm-variable-2 {
22622269
color: var(--sn-stylekit-info-color) !important;
22632270
}
2271+
.CodeMirror .cm-variable-2.CodeMirror-selectedtext {
2272+
color: var(--sn-stylekit-info-contrast-color) !important;
2273+
background: transparent;
2274+
}
22642275
.CodeMirror .cm-link, .CodeMirror .cm-string, .CodeMirror .cm-keyword {
22652276
color: var(--sn-stylekit-info-color) !important;
22662277
}
2278+
.CodeMirror .cm-link.CodeMirror-selectedtext, .CodeMirror .cm-string.CodeMirror-selectedtext, .CodeMirror .cm-keyword.CodeMirror-selectedtext {
2279+
color: var(--sn-stylekit-info-contrast-color) !important;
2280+
background: transparent;
2281+
}
22672282
.CodeMirror .CodeMirror-linenumber {
22682283
color: gray !important;
22692284
}

dist/dist.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11389,7 +11389,8 @@ document.addEventListener("DOMContentLoaded", function (event) {
1138911389
editor = CodeMirror.fromTextArea(document.getElementById("code"), {
1139011390
mode: "markdown",
1139111391
lineWrapping: true,
11392-
styleSelectedText: true
11392+
styleSelectedText: true,
11393+
extraKeys: { "Alt-F": "findPersistent" }
1139311394
});
1139411395
editor.setSize("100%", "100%");
1139511396

index.html

+93-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,104 @@
55
<meta charset="UTF-8">
66

77
<script src="dist/dist.js"></script>
8+
9+
<script src="node_modules/sn-codemirror-search/search.js"></script>
10+
<script src="node_modules/sn-codemirror-search/searchcursor.js"></script>
11+
<script src="node_modules/sn-codemirror-search/dialog/dialog.js"></script>
12+
813
<link rel="stylesheet" media="all" href="dist/dist.css">
14+
<link rel="stylesheet" media="all" href="node_modules/sn-codemirror-search/dialog/dialog.css">
915
</head>
1016

1117
<body>
1218
<div id="wrapper">
13-
<textarea id="code" name="code"></textarea>
19+
<textarea id="code" name="code">
20+
# An exhibit of Markdown
21+
22+
This note demonstrates some of what [Markdown][1] is capable of doing.
23+
24+
*Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.*
25+
26+
## Basic formatting
27+
28+
Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.
29+
30+
Paragraphs must be separated by a blank line. Basic formatting of *italics* and **bold** is supported. This *can be **nested** like* so.
31+
32+
## Lists
33+
34+
### Ordered list
35+
36+
1. Item 1
37+
2. A second item
38+
3. Number 3
39+
4. Ⅳ
40+
41+
*Note: the fourth item uses the Unicode character for [Roman numeral four][2].*
42+
43+
### Unordered list
44+
45+
* An item
46+
* Another item
47+
* Yet another item
48+
* And there's more...
49+
50+
## Paragraph modifiers
51+
52+
### Code block
53+
54+
Code blocks are very useful for developers and other people who look at code or other things that are written in plain text. As you can see, it uses a fixed-width font.
55+
56+
You can also make `inline code` to add code into other things.
57+
58+
### Quote
59+
60+
> Here is a quote. What this is should be self explanatory. Quotes are automatically indented when they are used.
61+
62+
## Headings
63+
64+
There are six levels of headings. They correspond with the six levels of HTML headings. You've probably noticed them already in the page. Each level down uses one more hash character.
65+
66+
### Headings *can* also contain **formatting**
67+
68+
### They can even contain `inline code`
69+
70+
Of course, demonstrating what headings look like messes up the structure of the page.
71+
72+
I don't recommend using more than three or four levels of headings here, because, when you're smallest heading isn't too small, and you're largest heading isn't too big, and you want each size up to look noticeably larger and more important, there there are only so many sizes that you can use.
73+
74+
## URLs
75+
76+
URLs can be made in a handful of ways:
77+
78+
* A named link to [MarkItDown][3]. The easiest way to do these is to select what you want to make a link and hit `Ctrl+L`.
79+
* Another named link to [MarkItDown](http://www.markitdown.net/)
80+
* Sometimes you just want a URL like <http://www.markitdown.net/>.
81+
82+
## Horizontal rule
83+
84+
A horizontal rule is a line that goes across the middle of the page.
85+
86+
---
87+
88+
It's sometimes handy for breaking things up.
89+
90+
## Images
91+
92+
Markdown can also contain images. I'll need to add something here sometime.
93+
94+
## Finally
95+
96+
There's actually a lot more to Markdown than this. See the official [introduction][4] and [syntax][5] for more information. However, be aware that this is not using the official implementation, and this might work subtly differently in some of the little things.
97+
98+
99+
[1]: http://daringfireball.net/projects/markdown/
100+
[2]: http://www.fileformat.info/info/unicode/char/2163/index.htm
101+
[3]: http://www.markitdown.net/
102+
[4]: http://daringfireball.net/projects/markdown/basics
103+
[5]: http://daringfireball.net/projects/markdown/syntax
104+
105+
</textarea>
14106
<div>
15107

16108
</body>

package-lock.json

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "sn-minimal-markdown-editor",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "",
55
"main": "dist/dist.js",
66
"author": "Standard Notes <[email protected]>",
7-
"dependencies": {},
7+
"dependencies": {
8+
"sn-codemirror-search": "1.0.0"
9+
},
810
"devDependencies": {
911
"codemirror": "^5.41.0",
1012
"sn-components-api": "1.2.3",

src/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
7676
editor = CodeMirror.fromTextArea(document.getElementById("code"), {
7777
mode: "markdown",
7878
lineWrapping: true,
79-
styleSelectedText: true
79+
styleSelectedText: true,
80+
extraKeys: {"Alt-F": "findPersistent"}
8081
});
8182
editor.setSize("100%", "100%");
8283

src/main.scss

+21-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ body, html {
1111
position: relative;
1212
height: 100%;
1313
overflow: hidden;
14-
padding-right: 20px;
14+
// padding-right: 20px;
15+
}
16+
17+
.CodeMirror-scroll {
18+
padding: 8px;
1519
}
1620

1721
.CodeMirror {
@@ -27,14 +31,18 @@ body, html {
2731
height: 100%;
2832
resize: none;
2933
font-size: var(--sn-stylekit-font-size-editor);
30-
padding: 15px;
31-
padding: 8px;
34+
padding: 0;
3235

3336
.CodeMirror-code .cm-comment {
3437
background: var(--sn-stylekit-contrast-background-color);
3538
color: var(--sn-stylekit-info-color);
3639
font-family: Consolas, monaco, "Ubuntu Mono", courier, monospace !important;
3740
font-size: 90%; // font-family makes font look a bit big
41+
42+
&.CodeMirror-selectedtext {
43+
color: var(--sn-stylekit-info-contrast-color) !important;
44+
background: transparent;
45+
}
3846
}
3947

4048
.cm-header {
@@ -48,10 +56,20 @@ body, html {
4856

4957
.cm-variable-2 {
5058
color: var(--sn-stylekit-info-color) !important;
59+
60+
&.CodeMirror-selectedtext {
61+
color: var(--sn-stylekit-info-contrast-color) !important;
62+
background: transparent;
63+
}
5164
}
5265

5366
.cm-link, .cm-string, .cm-keyword {
5467
color: var(--sn-stylekit-info-color) !important;
68+
69+
&.CodeMirror-selectedtext {
70+
color: var(--sn-stylekit-info-contrast-color) !important;
71+
background: transparent;
72+
}
5573
}
5674

5775
.CodeMirror-linenumber {

0 commit comments

Comments
 (0)