Skip to content

Instantly share code, notes, and snippets.

@markbates
Created June 25, 2017 00:41
Show Gist options
  • Save markbates/a2aa2ba86ac665903408c10566ce49f0 to your computer and use it in GitHub Desktop.
Save markbates/a2aa2ba86ac665903408c10566ce49f0 to your computer and use it in GitHub Desktop.
<%= f.InputTag("Title") %>
<%= f.TextArea("Body", {rows: 10}) %>
<div id="body-preview"></div>
<button class="btn btn-success" role="submit">Save</button>
require('expose-loader?$!expose-loader?jQuery!jquery');
require("bootstrap/dist/js/bootstrap.js");
let marked = require("marked/lib/marked.js");
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false
});
$(() => {
$("#story-Body").keyup((e)=>{
let text = $(e.target).val();
$("#body-preview").html(marked(text));
})
});
{
"name": "coke",
"version": "1.0.0",
"description": "Thank you for choosing Buffalo for your web development needs.",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.1.0",
"babel-preset-env": "^1.5.2",
"bootstrap": "^3.3.7",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.4",
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^2.1.2",
"file-loader": "^0.11.2",
"font-awesome": "^4.7.0",
"jquery": "^3.2.1",
"jquery-ujs": "^1.2.2",
"marked": "^0.3.6",
"node-sass": "^4.5.3",
"npm-install-webpack-plugin": "^4.0.4",
"path": "^0.12.7",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.9",
"webpack": "^2.3.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment