mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 22:22:41 +00:00
Rename files, add some instructions to markdown.js
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
const diceFont = require('../../../themes/fonts/icon fonts/diceFont.js');
|
const diceFont = require('../../../themes/fonts/iconFonts/diceFont.js');
|
||||||
const elderberryInn = require('../../../themes/fonts/icon fonts/elderberryInn.js');
|
const elderberryInn = require('../../../themes/fonts/iconFonts/elderberryInn.js');
|
||||||
const fontAwesome = require('../../../themes/fonts/icon fonts/fontAwesome.js');
|
const fontAwesome = require('../../../themes/fonts/iconFonts/fontAwesome.js');
|
||||||
|
|
||||||
const emojis = {
|
const emojis = {
|
||||||
...diceFont,
|
...diceFont,
|
||||||
@@ -8,7 +8,7 @@ const emojis = {
|
|||||||
...fontAwesome
|
...fontAwesome
|
||||||
};
|
};
|
||||||
|
|
||||||
const showEmojiAutocomplete = function(CodeMirror, editor) {
|
const showAutocompleteEmoji = function(CodeMirror, editor) {
|
||||||
CodeMirror.commands.autocomplete = function(editor) {
|
CodeMirror.commands.autocomplete = function(editor) {
|
||||||
editor.showHint({
|
editor.showHint({
|
||||||
completeSingle: false,
|
completeSingle: false,
|
||||||
@@ -78,5 +78,5 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
showEmojiAutocomplete
|
showAutocompleteEmoji
|
||||||
};
|
};
|
||||||
@@ -5,7 +5,7 @@ const createClass = require('create-react-class');
|
|||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const cx = require('classnames');
|
const cx = require('classnames');
|
||||||
const closeTag = require('./close-tag');
|
const closeTag = require('./close-tag');
|
||||||
const autoCompleteEmojis = require('./autocomplete-emoji');
|
const autoCompleteEmoji = require('./autocompleteEmoji');
|
||||||
|
|
||||||
let CodeMirror;
|
let CodeMirror;
|
||||||
if(typeof window !== 'undefined'){
|
if(typeof window !== 'undefined'){
|
||||||
@@ -183,7 +183,7 @@ const CodeEditor = createClass({
|
|||||||
|
|
||||||
// Add custom behaviors (auto-close curlies and auto-complete emojis)
|
// Add custom behaviors (auto-close curlies and auto-complete emojis)
|
||||||
closeTag.autoCloseCurlyBraces(CodeMirror, this.codeMirror);
|
closeTag.autoCloseCurlyBraces(CodeMirror, this.codeMirror);
|
||||||
autoCompleteEmojis.showEmojiAutocomplete(CodeMirror, this.codeMirror);
|
autoCompleteEmoji.showAutocompleteEmoji(CodeMirror, this.codeMirror);
|
||||||
|
|
||||||
// Note: codeMirror passes a copy of itself in this callback. cm === this.codeMirror. Either one works.
|
// Note: codeMirror passes a copy of itself in this callback. cm === this.codeMirror. Either one works.
|
||||||
this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());});
|
this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());});
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
@import (less) 'codemirror/addon/hint/show-hint.css';
|
@import (less) 'codemirror/addon/hint/show-hint.css';
|
||||||
|
|
||||||
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
||||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||||
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
|
@import (less) './themes/fonts/iconFonts/elderberryInn.less';
|
||||||
|
|
||||||
@keyframes sourceMoveAnimation {
|
@keyframes sourceMoveAnimation {
|
||||||
50% {background-color: red; color: white;}
|
50% {background-color: red; color: white;}
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ const { gfmHeadingId: MarkedGFMHeadingId } = require('marked-gfm-heading-id');
|
|||||||
const { markedEmoji: MarkedEmojis} = require('marked-emoji');
|
const { markedEmoji: MarkedEmojis} = require('marked-emoji');
|
||||||
|
|
||||||
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
||||||
const diceFont = require('../../themes/fonts/icon fonts/diceFont.js');
|
const diceFont = require('../../themes/fonts/iconFonts/diceFont.js');
|
||||||
const elderberryInn = require('../../themes/fonts/icon fonts/elderberryInn.js');
|
const elderberryInn = require('../../themes/fonts/iconFonts/elderberryInn.js');
|
||||||
const fontAwesome = require('../../themes/fonts/icon fonts/fontAwesome.js');
|
const fontAwesome = require('../../themes/fonts/iconFonts/fontAwesome.js');
|
||||||
|
|
||||||
const MathParser = require('expr-eval').Parser;
|
const MathParser = require('expr-eval').Parser;
|
||||||
const renderer = new Marked.Renderer();
|
const renderer = new Marked.Renderer();
|
||||||
@@ -676,6 +676,12 @@ function MarkedVariables() {
|
|||||||
//^=====--------------------< Variable Handling >-------------------=====^//
|
//^=====--------------------< Variable Handling >-------------------=====^//
|
||||||
|
|
||||||
// Emoji options
|
// Emoji options
|
||||||
|
// To add more icon fonts, need to do 4 things:
|
||||||
|
// 1) Add the font file as .woff2 to themes/fonts/iconFonts folder
|
||||||
|
// 2) Create a .less file mapping CSS class names to the font character
|
||||||
|
// 3) Create a .js file mapping Autosuggest names to CSS class names
|
||||||
|
// 4) Import the .js file to shared/naturalcrit/codeEditor/autocompleteEmoji.js and add to `emojis` object
|
||||||
|
// 5) Import the .js file here to markdown.js, and add to `emojis` object below
|
||||||
const MarkedEmojiOptions = {
|
const MarkedEmojiOptions = {
|
||||||
emojis: {
|
emojis: {
|
||||||
...diceFont,
|
...diceFont,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@import (less) './themes/assets/assets.less';
|
@import (less) './themes/assets/assets.less';
|
||||||
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
|
@import (less) './themes/fonts/iconFonts/elderberryInn.less';
|
||||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
//Colors
|
//Colors
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@import (less) './themes/fonts/5e/fonts.less';
|
@import (less) './themes/fonts/5e/fonts.less';
|
||||||
@import (less) './themes/assets/assets.less';
|
@import (less) './themes/assets/assets.less';
|
||||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
//Colors
|
//Colors
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
font-family : 'DiceFont';
|
font-family : 'DiceFont';
|
||||||
font-style : normal;
|
font-style : normal;
|
||||||
font-weight : normal;
|
font-weight : normal;
|
||||||
src : url('../../../fonts/icon fonts/diceFont.woff2');
|
src : url('../../../fonts/iconFonts/diceFont.woff2');
|
||||||
}
|
}
|
||||||
|
|
||||||
.df {
|
.df {
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
font-family : 'Elderberry-Inn';
|
font-family : 'Elderberry-Inn';
|
||||||
font-style : normal;
|
font-style : normal;
|
||||||
font-weight : normal;
|
font-weight : normal;
|
||||||
src : url('../../../fonts/icon fonts/elderberryInn.woff2');
|
src : url('../../../fonts/iconFonts/elderberryInn.woff2');
|
||||||
}
|
}
|
||||||
|
|
||||||
.ei {
|
.ei {
|
||||||
Reference in New Issue
Block a user