Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Export to carbon-sh (#67)
Browse files Browse the repository at this point in the history
* added export to carbon function and corresponding ui button

* added styles on export-to-carbon button
matfire authored and lauthieb committed Mar 14, 2019

Verified

This commit was signed with the committer’s verified signature.
pkwarren Philip K. Warren
1 parent a9091f5 commit 7ca686b
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer/components/notes-list/note-card/NoteCard.html
Original file line number Diff line number Diff line change
@@ -37,6 +37,9 @@ <h4>{{value.name}}
title="Copy to clipboard">
<b-icon icon="clipboard"></b-icon>
</a>
<a id="export-carbon" @click="exportToCarbon(value.content)" title="Export to Carbon">
<b-icon icon="image"></b-icon>
</a>
</span>
</h4>
<editor :code="value.content"
7 changes: 7 additions & 0 deletions src/renderer/components/notes-list/note-card/NoteCard.scss
Original file line number Diff line number Diff line change
@@ -64,6 +64,13 @@
#copy-file {
color: $dark;

&:hover {
color: lighten($black, 20%);
}
}
#export-carbon {
color: $dark;

&:hover {
color: lighten($black, 20%);
}
4 changes: 4 additions & 0 deletions src/renderer/components/notes-list/note-card/NoteCard.vue
Original file line number Diff line number Diff line change
@@ -61,6 +61,10 @@ export default {
open(link) {
this.$electron.shell.openExternal(link);
},
exportToCarbon(content) {
let url = `https://carbon.now.sh/?bg=rgba(0,0,0,0)&t=dracula&l=auto&ds=true&wc=true&wa=true&pv=43px&ph=57px&ln=false&code=`;
this.$electron.shell.openExternal(`${url}${encodeURI(content)}`)
}
},
};
</script>

0 comments on commit 7ca686b

Please sign in to comment.