Skip to content

Instantly share code, notes, and snippets.

View amitmerchant1990's full-sized avatar

Amit Merchant amitmerchant1990

View GitHub Profile
convert(this) {
if(this.toggleVal==true){
if(this.plainText && this.plainText!=''){
let plainText = this.plainText
this.markdownText = marked(plainText.toString())
this.content = this.markdownText
}else{
this.toggleVal=false
}
textarea {
max-width: 100%;
width: 100%;
height: 100vh;
}
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h2>Welcome to Markdownify!</h2>
<ion-item>
<ion-label>Convert to Markdown</ion-label>
<h2>Welcome to Markdownify!</h2>
<ion-item>
<ion-label>Convert to Markdown</ion-label>
<ion-toggle></ion-toggle>
</ion-item>
<ion-item>
<ion-textarea rows="6" placeholder="Strat writing your markdown below..."></ion-textarea>
</ion-item>
<h2>Welcome to Markdownify!</h2>
<ion-item>
<ion-textarea rows="6" [(ngModel)]="plainText" placeholder="Strat writing your markdown below..."></ion-textarea>
</ion-item>
{
"name": "electron-markdownify",
"version": "1.1.6",
"description": "A minimalist Markdown Editor",
"main": "main.js",
"productName": "Markdownify",
"scripts": {
"start": "electron main.js",
"build": "rm -rf dist && gulp build"
},
// Commented out for brevity
$(document).ready(function(){
$('#note').bind('input propertychange', function(){
localStorage.setItem("note", $(this).val());
});
if(localStorage.getItem("note") && localStorage.getItem("note")!=''){
var noteItem = localStorage.getItem("note")
$('#note').val(noteItem);
{
"short_name": "Notepad",
"name": "Notepad",
"display": "standalone",
"icons": [
{
"src": "img/icon-48.png",
"sizes": "48x48",
"type": "image/png"
},
importScripts('js/cache-polyfill.js');
var CACHE_VERSION = 'app-v1';
self.addEventListener('install', function (event) {
event.waitUntil(
caches.open(CACHE_VERSION)
.then(function (cache) {
console.log('Opened cache');
return cache.addAll(CACHE_FILES);
// Registering ServiceWorker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
}