-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(migrate): Integrate a command to migrate from V1 to V2 note cont…
…ent for file import.
- Loading branch information
Showing
47 changed files
with
2,124 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('nothing!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"extraScripts": [ | ||
"driver/markdownItRuler/frontMatter/index.ts" | ||
"driver/markdownItRuler/frontMatter/index.ts", | ||
"driver/codemirror/frontmatter/index.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
interface JoplinNotebook { | ||
export interface iJoplinNotebook { | ||
id: string; | ||
title: string; | ||
parent_id: string; | ||
} | ||
|
||
export class joplinNotebook implements iJoplinNotebook { | ||
id: string; | ||
title: string; | ||
parent_id: string; | ||
} | ||
export { JoplinNotebook }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* BEGIN HEADER | ||
* | ||
* Contains: Utility function | ||
* CVM-Role: <none> | ||
* Maintainer: Hendrik Erz | ||
* License: GNU GPL v3 | ||
* | ||
* Description: This function transforms an arbitrary string into a string | ||
* that is safe to use in CSS class names. It is being used in | ||
* the markdown-zkn mode as well as the clickable-yaml-tags | ||
* plugin, both defined in the main editor. | ||
* | ||
* END HEADER | ||
*/ | ||
|
||
/** | ||
* Takes a string as input and sanitizes it for usage in a CSS class name or | ||
* identifier. It may return an empty string in case the input does not contain | ||
* any allowed characters. | ||
* | ||
* @param {string} unsaneText The string to sanitize for CSS | ||
* | ||
* @return {string} The sane string | ||
*/ | ||
export default function cssSafeString(unsaneText: string): string { | ||
// From the W3C (https://www.w3.org/TR/CSS21/syndata.html#characters): | ||
// | ||
// > In CSS, identifiers (including element names, classes, and IDs in | ||
// > selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 | ||
// > characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); | ||
// > they cannot start with a digit, two hyphens, or a hyphen followed by a | ||
// > digit. | ||
// | ||
// To keep it simple, we only allow [a-zA-Z0-9], hyphens, and underscores. | ||
return ( | ||
unsaneText | ||
.toLowerCase() | ||
// Spaces --> Hyphens | ||
.replace(/\s/g, '-') | ||
// Remove anything non-a-z0-9 | ||
.replace(/[^a-z0-9-_]/g, '') | ||
// Replace a leading digit with underscore | ||
.replace(/^\d/, '_') | ||
// Replace two leading hyphens with underscores | ||
.replace(/^--/, '__') | ||
// Replace a leading hyphen-digit combo with underscores | ||
.replace(/^-\d/, '__') | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* BEGIN HEADER | ||
* | ||
* Contains: Utility function | ||
* CVM-Role: <none> | ||
* Maintainer: Ville Kukkonen | ||
* License: GNU GPL v3 | ||
* | ||
* Description: Given an array of language selectors as strings, this function will | ||
* generate a regex that matches fenced code block openings with given | ||
* language selectors. | ||
* | ||
* END HEADER | ||
*/ | ||
|
||
/** | ||
* Given an array of language selectors as strings, this function will | ||
* generate a regex that matches fenced code block openings with given | ||
* language selectors. | ||
* | ||
* @param {string[]} selectors The language selectors to match against (e.g. js) | ||
* | ||
* @return {RegExp} The regex | ||
*/ | ||
export default function generateRegexForHighlightMode( | ||
selectors: string[] | ||
): RegExp { | ||
// The following regex will match fenced code block headers with or without attribute lists. | ||
// Without attribute lists, the language selector is matched on the first word. | ||
// In attribute lists, the language is matched on the first word prefixed with a dot (.). | ||
return new RegExp( | ||
// ``` or ~~~ preceded by zero or more whitespace | ||
'^\\s*(?:`{3}|~{3})' + | ||
// zero or more whitespace followed by either... | ||
'\\s*(?:' + | ||
// ... empty pattern, i.e. go directly to selectors ... | ||
'|' + | ||
// ... {. as a special case with no whitespace between the brace and dot... | ||
'{\\.|' + | ||
// ... { followed by anything up until first dot (.) preceded by whitespace. | ||
'{[^\\.]*\\s\\.' + | ||
// any of the given selectors | ||
')(' + | ||
selectors.join('|') + | ||
')\\b.*$' | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export interface iOldNoteFormat { | ||
Title: string; | ||
Body: string; | ||
Tags: Array<string>; | ||
PDFMETADATATEXT: iOldPDFMetaData; | ||
PDFCONTENTTEXT: string; | ||
FILEHASHSTART: string; | ||
Folder: string; | ||
} | ||
|
||
export interface iOldPDFMetaData { | ||
Title: string; | ||
Subject: string; | ||
Author: string; | ||
CreationDate: Date; | ||
Keywords: string; | ||
} | ||
|
||
export class oldNoteFormat implements iOldNoteFormat { | ||
Title: string; | ||
Body: string; | ||
Tags: string[]; | ||
PDFMETADATATEXT: iOldPDFMetaData; | ||
PDFCONTENTTEXT: string; | ||
FILEHASHSTART: string; | ||
Folder: string; | ||
} |
Oops, something went wrong.