Browse Source

initial commit

master
jose marin 3 years ago
commit
8194e9edc6
17 changed files with 1555 additions and 0 deletions
  1. +0
    -0
      README.md
  2. +45
    -0
      index.html
  3. +3
    -0
      javascript/highlight.min.js
  4. +1217
    -0
      javascript/jsvim.js
  5. +44
    -0
      javascript/main.js
  6. +6
    -0
      javascript/marked.min.js
  7. +1
    -0
      javascript/vim.min.js
  8. +2
    -0
      lib/codemirror.min.css
  9. +1
    -0
      lib/codemirror.min.js
  10. +1
    -0
      lib/vim.min.js
  11. +1
    -0
      styles/dracula.css
  12. +1
    -0
      styles/ir-black.css
  13. +137
    -0
      styles/main.css
  14. +83
    -0
      styles/monokai-sublime.css
  15. +1
    -0
      styles/qtcreator_dark.css
  16. +11
    -0
      styles/semantic.min.css
  17. +1
    -0
      styles/xt256.css

+ 0
- 0
README.md View File


+ 45
- 0
index.html View File

@ -0,0 +1,45 @@
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VIM markdown editor</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="styles/semantic.min.css">
<link rel="stylesheet" href="styles/xt256.css">
<link rel="stylesheet" href="lib/codemirror.min.css">
<link rel="stylesheet" href="styles/main.css">
</head>
<body id="book">
<div class="ui inverted menu" style="margin-bottom: 0;">
<div class="header item">
Home
</div>
<a class="item">
vim.MD
</a>
<a class="item">
Export
</a>
</div> <!--/nav -->
<div class="book-wrapper">
<div class="book-wrapper-inner">
<div class="book-col--40">
</div>
<div class="book-col--60">
<div class="book-content">
<div class="main-content js-content" style="padding-bottom: 100px;"></div>
</div>
</div>
</div>
</div>
<script src="javascript/highlight.min.js"></script>
<script src="javascript/marked.min.js"></script>
<script src="javascript/jsvim.js"></script>
<script src="lib/codemirror.min.js"></script>
<script src="lib/vim.min.js"></script>
<script src="javascript/main.js"></script>
</body>
</html>

+ 3
- 0
javascript/highlight.min.js
File diff suppressed because it is too large
View File


+ 1217
- 0
javascript/jsvim.js
File diff suppressed because it is too large
View File


+ 44
- 0
javascript/main.js View File

@ -0,0 +1,44 @@
(function() {
const myCodeMirror = CodeMirror(document.querySelector('.book-col--40'), {
value: window.localStorage.getItem('data'),
mode: "javascript",
//lineNumbers: true,
keyMap: 'vim'
});
console.log(myCodeMirror.getValue() )
CodeMirror.Vim.map('kj', '<Esc>', 'insert') // comment out if you want to use normal <Esc> key to exit insert mode
if (myCodeMirror) {
hljs.initHighlightingOnLoad();
if (window.localStorage.getItem('data')) {
myCodeMirror.value = window.localStorage.getItem('data');
document.querySelector('.js-content').innerHTML = marked(window.localStorage.getItem('data'));
}
else {
document.querySelector('.js-content').innerHTML = myCodeMirror.getValue();
}
document.querySelector('.CodeMirror-code').addEventListener('keyup', event => {
const val = event.target.value;
const transformed = marked(val);
document.querySelector('.js-content').innerHTML = transformed;
for (let i = 0; i < document.getElementsByTagName('code').length; i++) {
hljs.highlightBlock(document.getElementsByTagName('code')[i]);
}
setTimeout(() => {
document.querySelector('.js-content').parentElement.scrollTop = 10000000;
}, 250)
window.localStorage.setItem('data', val);
});
}
// const vim = new VIM();
// vim.attach_to(document.querySelector('.js-input'));
// document.querySelector('.CodeMirror-code').focus();
})();

+ 6
- 0
javascript/marked.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
javascript/vim.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
lib/codemirror.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
lib/codemirror.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
lib/vim.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
styles/dracula.css View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#282a36}.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-section,.hljs-link{color:#8be9fd}.hljs-function .hljs-keyword{color:#ff79c6}.hljs,.hljs-subst{color:#f8f8f2}.hljs-string,.hljs-title,.hljs-name,.hljs-type,.hljs-attribute,.hljs-symbol,.hljs-bullet,.hljs-addition,.hljs-variable,.hljs-template-tag,.hljs-template-variable{color:#f1fa8c}.hljs-comment,.hljs-quote,.hljs-deletion,.hljs-meta{color:#6272a4}.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-title,.hljs-section,.hljs-doctag,.hljs-type,.hljs-name,.hljs-strong{font-weight:bold}.hljs-emphasis{font-style:italic}

+ 1
- 0
styles/ir-black.css View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#000;color:#f8f8f8}.hljs-comment,.hljs-quote,.hljs-meta{color:#7c7c7c}.hljs-keyword,.hljs-selector-tag,.hljs-tag,.hljs-name{color:#96cbfe}.hljs-attribute,.hljs-selector-id{color:#ffffb6}.hljs-string,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-addition{color:#a8ff60}.hljs-subst{color:#daefa3}.hljs-regexp,.hljs-link{color:#e9c062}.hljs-title,.hljs-section,.hljs-type,.hljs-doctag{color:#ffffb6}.hljs-symbol,.hljs-bullet,.hljs-variable,.hljs-template-variable,.hljs-literal{color:#c6c5fe}.hljs-number,.hljs-deletion{color:#ff73fd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}

+ 137
- 0
styles/main.css View File

@ -0,0 +1,137 @@
html, body {
width: 100%;
height: 100%;
min-height: 100%;
font-
}
.book-wrapper {
position: fixed;
/* top: 0; removed for top nav bar */
left: 0;
width: 100%;
height: 100%;
overflow: auto;
}
.book-wrapper-inner {
width: 100%;
height: 100%;
position: relative;
top: 0;
left: 0;
display: flex;
flex-direction: row;
flex-wrap: no-wrap;
}
.book-col--40 {
width: 40%;
overflow: hidden; /* to specific put else where */
}
.book-col--60 {
width: 60%;
overflow: auto; /* to specific put else where */
}
.book__col--60,
.book__col--40 {
height: 100%;
overflow: auto;
}
.book-content {
width: 100%;
background-color: white;
overflow: auto;
padding: 20px;
}
#book .colitem {
background-color: transparent;
color: white;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
}
.book-input {
width: 100%;
height: 100%;
font-size: 20px;
}
#book .main-content > * {
width: 80%;
max-width: 1024px;
margin-left: auto;
margin-right: auto;
}
#book .main-content h1 {
font-weight: 900;
font-size: 4rem;
font-variant: small-caps;
}
#book .main-content h2 {
font-weight: 900;
font-size: 3rem;
font-variant: small-caps;
}
#book .main-content h3 {
font-weight: 900;
font-size: 2.25rem;
font-variant: small-caps;
}
#book .main-content h4 {
font-weight: 900;
font-size: 2rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content h5 {
font-weight: 900;
font-size: 1.75rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content h6 {
font-weight: 900;
font-size: 1.5rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content pre {
margin-left: -20px;
margin-right: 0;
width: calc( 100% + 40px );
max-width: initial;
background-color: #000000;
}
#book .main-content pre code {
width: 80%;
max-width: 1024px;
margin-left: auto;
margin-right: auto;
}
#book .flex-centered {
align-self: center;
}
#book .CodeMirror {
height: 100%;
}

+ 83
- 0
styles/monokai-sublime.css View File

@ -0,0 +1,83 @@
/*
Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #23241f;
}
.hljs,
.hljs-tag,
.hljs-subst {
color: #f8f8f2;
}
.hljs-strong,
.hljs-emphasis {
color: #a8a8a2;
}
.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
color: #ae81ff;
}
.hljs-code,
.hljs-title,
.hljs-section,
.hljs-selector-class {
color: #a6e22e;
}
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-attr {
color: #f92672;
}
.hljs-symbol,
.hljs-attribute {
color: #66d9ef;
}
.hljs-params,
.hljs-class .hljs-title {
color: #f8f8f2;
}
.hljs-string,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-variable {
color: #e6db74;
}
.hljs-comment,
.hljs-deletion,
.hljs-meta {
color: #75715e;
}

+ 1
- 0
styles/qtcreator_dark.css View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#000000}.hljs,.hljs-subst,.hljs-tag,.hljs-title{color:#aaaaaa}.hljs-strong,.hljs-emphasis{color:#a8a8a2}.hljs-bullet,.hljs-quote,.hljs-number,.hljs-regexp,.hljs-literal{color:#ff55ff}.hljs-code .hljs-selector-class{color:#aaaaff}.hljs-emphasis,.hljs-stronge,.hljs-type{font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-function,.hljs-section,.hljs-symbol,.hljs-name{color:#ffff55}.hljs-attribute{color:#ff5555}.hljs-variable,.hljs-params,.hljs-class .hljs-title{color:#8888ff}.hljs-string,.hljs-selector-id,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-type,.hljs-built_in,.hljs-builtin-name,.hljs-template-tag,.hljs-template-variable,.hljs-addition,.hljs-link{color:#ff55ff}.hljs-comment,.hljs-meta,.hljs-deletion{color:#55ffff}

+ 11
- 0
styles/semantic.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
styles/xt256.css View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;color:#eaeaea;background:#000;padding:0.5}.hljs-subst{color:#eaeaea}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}.hljs-builtin-name,.hljs-type{color:#eaeaea}.hljs-params{color:#da0000}.hljs-literal,.hljs-number,.hljs-name{color:#ff0000;font-weight:bolder}.hljs-comment{color:#969896}.hljs-selector-id,.hljs-quote{color:#00ffff}.hljs-template-variable,.hljs-variable,.hljs-title{color:#00ffff;font-weight:bold}.hljs-selector-class,.hljs-keyword,.hljs-symbol{color:#fff000}.hljs-string,.hljs-bullet{color:#00ff00}.hljs-tag,.hljs-section{color:#000fff}.hljs-selector-tag{color:#000fff;font-weight:bold}.hljs-attribute,.hljs-built_in,.hljs-regexp,.hljs-link{color:#ff00ff}.hljs-meta{color:#fff;font-weight:bolder}

Loading…
Cancel
Save