-
-
Save Andr3as/bfee6e814b6b2989a1a1 to your computer and use it in GitHub Desktop.
Display markdown preview in a modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Copyright (c) Codiad & Andr3as, distributed | |
as-is and without warranty under the MIT License. | |
See http://opensource.org/licenses/MIT for more information. | |
This information must remain intact. | |
--> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>__title__</title> | |
<link rel="stylesheet" href="plugins/Codiad-MarkdownPreview-master/markdown.css"> | |
<script src="js/jquery-1.7.2.min.js"></script> | |
<script src="plugins/Codiad-MarkdownPreview-master/template.js"></script> | |
</head> | |
<body id="markdown_preview_modal"> | |
<header> | |
Change layout: <button id="markdown">Markdown.css</button><button id="github">GitHub.css</button> | |
</header> | |
__content__ | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) Codiad & Andr3as, distributed | |
* as-is and without warranty under the MIT License. | |
* See http://opensource.org/licenses/MIT for more information. | |
* This information must remain intact. | |
*/ | |
$(document).ready(function(){ | |
var markdown = '<link rel="stylesheet" href="plugins/Codiad-MarkdownPreview-master/markdown.css">'; | |
var github = '<link rel="stylesheet" href="plugins/Codiad-MarkdownPreview-master/github.css">'; | |
$('#markdown').click(function(){ | |
$('link[href="plugins/Codiad-MarkdownPreview-master/github.css"]').replaceWith(markdown); | |
}); | |
$('#github').click(function(){ | |
$('link[href="plugins/Codiad-MarkdownPreview-master/markdown.css"]').replaceWith(github); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment