diff --git a/README.md b/README.md
index 6119d1d..a84d0fc 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Markdown Preview for Alfresco Share
-This module adds a markdown preview to Alfresco Share:
+This module adds a markdown preview and edit button to Alfresco Share:

@@ -13,12 +13,19 @@ You will need:
* Parashift's alfresco amp plugin from here: https://bitbucket.org/parashift/alfresco-amp-plugin
* Run `gradle amp` from the `share` and `repo` directories
-### Installing to Alfresco
+## Installing to Alfresco
* Deploy the amp to both the repo and share end using alfresco-mmt or other methods
-### Usage
+## Usage
-The usage is automatic.
+### Previewing a Markdown document
-Any documents with the mime type `text/x-markdown` will display within the document details view.
+* Navigate to the document details page of a markdown document
+
+
+### Editing a Markdown document
+
+* Find a markdown document within the document library
+* Select `Edit Markdown`
+* When you are finished, select `Save Markdown`
diff --git a/repo/build.gradle b/repo/build.gradle
index 581307a..6c0ca66 100644
--- a/repo/build.gradle
+++ b/repo/build.gradle
@@ -20,7 +20,7 @@ allprojects {
}
}
-version = "1.0.0"
+version = "1.1.0"
ext {
alfresco = [:]
diff --git a/share/build.gradle b/share/build.gradle
index 79f98e4..e821508 100644
--- a/share/build.gradle
+++ b/share/build.gradle
@@ -30,7 +30,7 @@ configurations {
all*.exclude group: 'maven-plugins'
}
-version = "1.0.0"
+version = "1.1.0"
ext {
alfresco = [:]
diff --git a/share/src/main/resources/META-INF/components/documentlibrary/actions/document-markdown-edit-16.png b/share/src/main/resources/META-INF/components/documentlibrary/actions/document-markdown-edit-16.png
new file mode 100644
index 0000000..6cca482
Binary files /dev/null and b/share/src/main/resources/META-INF/components/documentlibrary/actions/document-markdown-edit-16.png differ
diff --git a/share/src/main/resources/META-INF/components/images/filetypes/markdown-file-16.png b/share/src/main/resources/META-INF/components/images/filetypes/markdown-file-16.png
new file mode 100644
index 0000000..099cb83
Binary files /dev/null and b/share/src/main/resources/META-INF/components/images/filetypes/markdown-file-16.png differ
diff --git a/share/src/main/resources/META-INF/components/markdown-edit.css b/share/src/main/resources/META-INF/components/markdown-edit.css
new file mode 100644
index 0000000..9fafd10
--- /dev/null
+++ b/share/src/main/resources/META-INF/components/markdown-edit.css
@@ -0,0 +1,35 @@
+.markdown-section {
+ overflow: hidden;
+ border: 1px solid #ccc !important;
+ background-color: #fff;
+ margin: 10px 0;
+ box-shadow: 0.33px 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.markdown-section .markdown-body {
+ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
+ -moz-box-sizing: border-box; /* Firefox, other Gecko */
+ box-sizing: border-box; /* Opera/IE 8+ */
+ border: 0px;
+ overflow-x: auto;
+
+}
+
+.markdown-editor, .markdown-preview {
+ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
+ -moz-box-sizing: border-box; /* Firefox, other Gecko */
+ box-sizing: border-box; /* Opera/IE 8+ */
+ float: left;
+ width: 50%;
+ padding: 5px;
+}
+
+
+.markdown-text {
+ width: 100% !important;
+}
+
+
+.markdown-section h1 {
+ border-bottom: 3px solid #ccc;
+}
diff --git a/share/src/main/resources/META-INF/components/markdown-edit.js b/share/src/main/resources/META-INF/components/markdown-edit.js
new file mode 100644
index 0000000..9971310
--- /dev/null
+++ b/share/src/main/resources/META-INF/components/markdown-edit.js
@@ -0,0 +1,96 @@
+require(["dojo/dom", "dojo/query", "dojo/on", "dojo/request", "showdown", "dojo/domReady!"], function(dom, query, on, request, showdown){
+
+ function resizeFrame(elem) {
+ elem.style.height = (window.innerHeight - 280) + "px";
+ }
+
+ function getURLParameter(name) {
+ return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null
+ }
+
+ var nodePath = getURLParameter("nodeRef").replace(":/","");
+
+ request.get(Alfresco.constants.PROXY_URI_RELATIVE + "/slingshot/doclib2/node/" + nodePath,{ handleAs: "json"}).then(function(nodeData) {
+
+
+ var locationPath = Alfresco.constants.PROXY_URI_RELATIVE + "markdown" + nodeData.item.location.repoPath + "/";
+
+ //Once we have the content, let's create a converter and add the html to the div element
+ var converter = new showdown.Converter({
+ extensions: [
+ function() {
+ return [{
+ type: 'output',
+ filter: function(source) {
+ return source.replace(/
-
+
+
+
+