Skip to content
Snippets Groups Projects
Commit 13f1b24b authored by Adam Procter's avatar Adam Procter
Browse files

added markdown support

small changed to CSS for myNodes and OtherNodes vue files as well (removed scoped)
parent a44ba5d2
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
_3rd September 2021_ _3rd September 2021_
## Added
- markdown support added for all nodes
## Fixed ## Fixed
- nodes are now correctly colored in the Cards view - nodes are now correctly colored in the Cards view as well as Collect view
# 0.2.2 # 0.2.2
......
{ {
"name": "nodenogg.in", "name": "nodenogg.in",
"version": "0.2.2", "version": "0.2.3",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
......
...@@ -45,9 +45,11 @@ ...@@ -45,9 +45,11 @@
<button @click.prevent="discardNode(nodes.node_id)">Discard</button> <button @click.prevent="discardNode(nodes.node_id)">Discard</button>
</template> </template>
<template v-else> <template v-else>
<p class="readmode" :id="nodes.node_id"> <p
{{ nodes.node_text }} class="readmode"
</p> :id="nodes.node_id"
v-html="marked(nodes.node_text)"
></p>
<button @click.prevent="toggleMode(nodes.node_id)">Edit</button> <button @click.prevent="toggleMode(nodes.node_id)">Edit</button>
</template> </template>
</form> </form>
...@@ -87,9 +89,6 @@ export default { ...@@ -87,9 +89,6 @@ export default {
...mapState({ ...mapState({
myNodes: (state) => state.myNodes, myNodes: (state) => state.myNodes,
}), }),
markdowntoHTML() {
return marked(this.markdown)
},
}, },
watch: { watch: {
...@@ -111,6 +110,7 @@ export default { ...@@ -111,6 +110,7 @@ export default {
}, },
methods: { methods: {
marked,
loadData() { loadData() {
var nodesFiltered = this.myNodes.myNodes.filter( var nodesFiltered = this.myNodes.myNodes.filter(
(nodes) => nodes.node_deleted == false (nodes) => nodes.node_deleted == false
...@@ -155,7 +155,37 @@ export default { ...@@ -155,7 +155,37 @@ export default {
} }
</script> </script>
<style scoped> <style>
h1 {
margin: 0em;
padding: 0em;
font-size: 4.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
h2 {
margin: 0em;
padding: 0em;
font-size: 3.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
h3 {
margin: 0em;
padding: 0em;
font-size: 2.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
.nodes { .nodes {
width: 95%; width: 95%;
border: 2px dashed black; border: 2px dashed black;
...@@ -172,4 +202,8 @@ textarea { ...@@ -172,4 +202,8 @@ textarea {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
img {
width: 45%;
}
</style> </style>
...@@ -7,15 +7,18 @@ ...@@ -7,15 +7,18 @@
backgroundColor: nodes.node_color, backgroundColor: nodes.node_color,
}" }"
> >
<p class="readmode" :id="nodes.node_id"> <p
{{ nodes.node_text }} class="readmode"
</p> :id="nodes.node_id"
v-html="marked(nodes.node_text)"
></p>
</div> </div>
</template> </template>
<script> <script>
// @ is an alias to /src // @ is an alias to /src
import { mapState } from 'vuex' import { mapState } from 'vuex'
import marked from 'marked'
export default { export default {
name: 'OtherNodes', name: 'OtherNodes',
...@@ -36,15 +39,49 @@ export default { ...@@ -36,15 +39,49 @@ export default {
loadData() { loadData() {
this.$store.dispatch('setOthernodes') this.$store.dispatch('setOthernodes')
}, },
marked,
}, },
} }
</script> </script>
<style scoped> <style>
h1 {
margin: 0em;
padding: 0em;
font-size: 4.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
h2 {
margin: 0em;
padding: 0em;
font-size: 3.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
h3 {
margin: 0em;
padding: 0em;
font-size: 2.2em;
font-family: houschka-rounded, sans-serif;
font-weight: 700;
font-style: normal;
color: black;
}
.nodes { .nodes {
width: 95%; width: 95%;
background-color: rgb(155, 194, 216); background-color: rgb(155, 194, 216);
margin-top: 1em; margin-top: 1em;
margin-left: 0.5em; margin-left: 0.5em;
} }
img {
width: 45%;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment