mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +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 elderberryInn = require('../../../themes/fonts/icon fonts/elderberryInn.js');
|
||||
const fontAwesome = require('../../../themes/fonts/icon fonts/fontAwesome.js');
|
||||
const diceFont = require('../../../themes/fonts/iconFonts/diceFont.js');
|
||||
const elderberryInn = require('../../../themes/fonts/iconFonts/elderberryInn.js');
|
||||
const fontAwesome = require('../../../themes/fonts/iconFonts/fontAwesome.js');
|
||||
|
||||
const emojis = {
|
||||
...diceFont,
|
||||
@@ -8,7 +8,7 @@ const emojis = {
|
||||
...fontAwesome
|
||||
};
|
||||
|
||||
const showEmojiAutocomplete = function(CodeMirror, editor) {
|
||||
const showAutocompleteEmoji = function(CodeMirror, editor) {
|
||||
CodeMirror.commands.autocomplete = function(editor) {
|
||||
editor.showHint({
|
||||
completeSingle: false,
|
||||
@@ -78,5 +78,5 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
showEmojiAutocomplete
|
||||
showAutocompleteEmoji
|
||||
};
|
||||
@@ -5,7 +5,7 @@ const createClass = require('create-react-class');
|
||||
const _ = require('lodash');
|
||||
const cx = require('classnames');
|
||||
const closeTag = require('./close-tag');
|
||||
const autoCompleteEmojis = require('./autocomplete-emoji');
|
||||
const autoCompleteEmoji = require('./autocompleteEmoji');
|
||||
|
||||
let CodeMirror;
|
||||
if(typeof window !== 'undefined'){
|
||||
@@ -183,7 +183,7 @@ const CodeEditor = createClass({
|
||||
|
||||
// Add custom behaviors (auto-close curlies and auto-complete emojis)
|
||||
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.
|
||||
this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());});
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
@import (less) 'codemirror/addon/hint/show-hint.css';
|
||||
|
||||
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
||||
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
|
||||
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||
@import (less) './themes/fonts/iconFonts/elderberryInn.less';
|
||||
|
||||
@keyframes sourceMoveAnimation {
|
||||
50% {background-color: red; color: white;}
|
||||
|
||||
@@ -7,9 +7,9 @@ const { gfmHeadingId: MarkedGFMHeadingId } = require('marked-gfm-heading-id');
|
||||
const { markedEmoji: MarkedEmojis} = require('marked-emoji');
|
||||
|
||||
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
||||
const diceFont = require('../../themes/fonts/icon fonts/diceFont.js');
|
||||
const elderberryInn = require('../../themes/fonts/icon fonts/elderberryInn.js');
|
||||
const fontAwesome = require('../../themes/fonts/icon fonts/fontAwesome.js');
|
||||
const diceFont = require('../../themes/fonts/iconFonts/diceFont.js');
|
||||
const elderberryInn = require('../../themes/fonts/iconFonts/elderberryInn.js');
|
||||
const fontAwesome = require('../../themes/fonts/iconFonts/fontAwesome.js');
|
||||
|
||||
const MathParser = require('expr-eval').Parser;
|
||||
const renderer = new Marked.Renderer();
|
||||
@@ -676,6 +676,12 @@ function MarkedVariables() {
|
||||
//^=====--------------------< Variable Handling >-------------------=====^//
|
||||
|
||||
// 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 = {
|
||||
emojis: {
|
||||
...diceFont,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@import (less) './themes/assets/assets.less';
|
||||
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
|
||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
||||
@import (less) './themes/fonts/iconFonts/elderberryInn.less';
|
||||
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||
|
||||
:root {
|
||||
//Colors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@import (less) './themes/fonts/5e/fonts.less';
|
||||
@import (less) './themes/assets/assets.less';
|
||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
||||
@import (less) './themes/fonts/iconFonts/diceFont.less';
|
||||
|
||||
:root {
|
||||
//Colors
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
font-family : 'DiceFont';
|
||||
font-style : normal;
|
||||
font-weight : normal;
|
||||
src : url('../../../fonts/icon fonts/diceFont.woff2');
|
||||
src : url('../../../fonts/iconFonts/diceFont.woff2');
|
||||
}
|
||||
|
||||
.df {
|
||||
@@ -3,7 +3,7 @@
|
||||
font-family : 'Elderberry-Inn';
|
||||
font-style : normal;
|
||||
font-weight : normal;
|
||||
src : url('../../../fonts/icon fonts/elderberryInn.woff2');
|
||||
src : url('../../../fonts/iconFonts/elderberryInn.woff2');
|
||||
}
|
||||
|
||||
.ei {
|
||||
Reference in New Issue
Block a user