Skip to content

Commit 0a6f4ec

Browse files
committed
Genesis
0 parents  commit 0a6f4ec

8 files changed

+68
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Version 1.0
2+
3+
Initial release

LICENSE.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2020 John Fieber
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Marked 2 for Nova
2+
3+
This extensions adds a *View in Marked 2* command to the *Editor* menu to open the current [Nova](https://nova.app) document with the [Marked 2](https://marked2app.com) Markdown previewer.
4+
5+
This extension is not written or endorsed by [Brett Terpstra](https://brettterpstra.com), the creator of [Marked 2](https://marked2app.com).
6+
7+
[Markdown logo](https://fontawesome.com/icons/markdown?style=brands) from Font Awesome Free 5.4.1 by @fontawesome - https://fontawesome.com licensed under the [Creative Commons](https://en.wikipedia.org/wiki/en:Creative_Commons) [Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/deed.en) license.

Scripts/main.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
nova.commands.register("marked.runMarked2", (editor) => {
2+
3+
var process = new Process("/usr/bin/open", {
4+
args: ["-a", "Marked 2", editor.document.path],
5+
});
6+
7+
var lines = [];
8+
process.onStderr(function (data) {
9+
if (data) {
10+
lines.push(data);
11+
}
12+
});
13+
14+
process.onDidExit(function (status) {
15+
if (status != 0) {
16+
nova.workspace.showInformativeMessage(
17+
nova.localize("Error Launching Marked 2:") + "\n\n" + lines.join("")
18+
);
19+
}
20+
});
21+
22+
process.start();
23+
});

extension.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"identifier": "org.ursamaris.nova.marked2",
3+
"name": "Marked 2",
4+
"organization": "John Fieber",
5+
"description": "View Markdown files with Marked 2.",
6+
"version": "1.0",
7+
"categories": ["commands"],
8+
"repository": "https://github.com/jfieber/Marked.novaextension",
9+
"bugs": "https://github.com/jfieber/Marked.novaextension/issues",
10+
"license": "MIT",
11+
"main": "main.js",
12+
"activationEvents": ["onLanguage:markdown"],
13+
"entitlements": {
14+
"process": true
15+
},
16+
"commands": {
17+
"editor": [
18+
{
19+
"title": "View in Marked 2",
20+
"command": "marked.runMarked2",
21+
"when": "editorHasFocus && documentHasPath && editorSyntax == 'markdown'"
22+
}
23+
]
24+
}
25+
}

extension.png

1.38 KB
Loading

extension@2x.png

2.21 KB
Loading

0 commit comments

Comments
 (0)