Switch to Github Flavored Markdown mode for ~~strikethu~~; add continuelist.js for fancy listmaking.

This commit is contained in:
jkaplon 2017-08-31 14:56:22 -04:00
parent 7cc9d0594d
commit 9d229dde5c
2 changed files with 21 additions and 5 deletions

View File

@ -1,4 +1,4 @@
FROM node:6.10.0-slim FROM node:8-alpine
EXPOSE 3000 EXPOSE 3000
@ -8,12 +8,17 @@ RUN mkdir -p /usr/src/app/db
VOLUME ["/usr/src/app/db"] VOLUME ["/usr/src/app/db"]
RUN npm install -g nodemon RUN npm install -g nodemon
RUN apt-get update && apt-get install -y vim git RUN apk --no-cache add vim git
COPY .vimrc /root/.vimrc COPY .vimrc /root/.vimrc
COPY package.json /usr/src/app/ COPY package.json /usr/src/app/
COPY . /usr/src/app COPY . /usr/src/app
RUN npm install RUN npm install
# Currently at CodeMirror-5.29.0.
# To upgrade, in host CodeMirror dir, do `git pull` and `git checkout tags/###`.
# Running `npm run build` here to save a step.
RUN cd /usr/src/app/CodeMirror && npm run build
# Use nodemon to start app. # Use nodemon to start app.
CMD [ "nodemon" ] CMD [ "nodemon" ]

View File

@ -10,10 +10,13 @@
<link rel="stylesheet" href="lib/codemirror.css"> <link rel="stylesheet" href="lib/codemirror.css">
<link rel="stylesheet" href="addon/dialog/dialog.css"> <link rel="stylesheet" href="addon/dialog/dialog.css">
<script src="lib/codemirror.js"></script> <script src="lib/codemirror.js"></script>
<script src="addon/edit/continuelist.js"></script>
<script src="addon/mode/overlay.js"></script>
<script src="mode/markdown/markdown.js"></script>
<script src="mode/gfm/gfm.js"></script>
<script src="addon/selection/active-line.js"></script> <script src="addon/selection/active-line.js"></script>
<script src="addon/dialog/dialog.js"></script> <script src="addon/dialog/dialog.js"></script>
<script src="addon/search/searchcursor.js"></script> <script src="addon/search/searchcursor.js"></script>
<script src="mode/markdown/markdown.js"></script>
<script src="addon/edit/matchbrackets.js"></script> <script src="addon/edit/matchbrackets.js"></script>
<script src="keymap/vim.js"></script> <script src="keymap/vim.js"></script>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script> <script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
@ -39,6 +42,7 @@
.CodeMirror { .CodeMirror {
height: 96%; height: 96%;
} }
.cm-s-default .cm-emoji {color: #009688;}
</style> </style>
<!-- favicon design by Rockicon of thenounproject.com --> <!-- favicon design by Rockicon of thenounproject.com -->
</head> </head>
@ -52,7 +56,12 @@
<script> <script>
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), { var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
mode: "markdown", mode: {
name: "gfm",
tokenTypeOverrides: {
emoji: "emoji"
}
},
lineNumbers: "true", lineNumbers: "true",
keyMap: "vim", keyMap: "vim",
matchBrackets: true, matchBrackets: true,
@ -60,7 +69,9 @@
viewportMargin: Infinity, viewportMargin: Infinity,
indentUnit: 4, indentUnit: 4,
styleActiveLine: true, styleActiveLine: true,
autofocus: true autofocus: true,
theme: "default",
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
}); });
// Add my .vimrc stuff. // Add my .vimrc stuff.
CodeMirror.Vim.map('jj', '<Esc>', 'insert'); CodeMirror.Vim.map('jj', '<Esc>', 'insert');