DEV: apply coding standards (#20)
This commit is contained in:
parent
926fbdbb3d
commit
e3068bb476
|
@ -1 +1,4 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
yarn-error.log
|
||||
.rubocop-https---raw-githubusercontent-com-discourse-*
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
module.exports = {
|
||||
plugins: ["ember-template-lint-plugin-discourse"],
|
||||
extends: "discourse:recommended",
|
||||
};
|
|
@ -4,7 +4,7 @@ import loadScript from "discourse/lib/load-script";
|
|||
function ensureKaTeX() {
|
||||
return loadScript("/plugins/discourse-math/katex/katex.min.js").then(() => {
|
||||
return loadScript("/plugins/discourse-math/katex/katex.min.css", {
|
||||
css: true
|
||||
css: true,
|
||||
}).then(() => {
|
||||
return loadScript("/plugins/discourse-math/katex/mhchem.min.js");
|
||||
});
|
||||
|
@ -64,5 +64,5 @@ export default {
|
|||
initializeMath(api);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ function initMathJax(opts) {
|
|||
TeX: { extensions: ["AMSmath.js", "AMSsymbols.js", "autoload-all.js"] },
|
||||
extensions: extensions,
|
||||
showProcessingMessages: false,
|
||||
root: getURLWithCDN("/plugins/discourse-math/mathjax")
|
||||
root: getURLWithCDN("/plugins/discourse-math/mathjax"),
|
||||
};
|
||||
|
||||
if (opts.zoom_on_hover) {
|
||||
|
@ -132,7 +132,7 @@ export default {
|
|||
let discourse_math_opts = {
|
||||
zoom_on_hover: siteSettings.discourse_math_zoom_on_hover,
|
||||
enable_accessibility: siteSettings.discourse_math_enable_accessibility,
|
||||
enable_asciimath: siteSettings.discourse_math_enable_asciimath
|
||||
enable_asciimath: siteSettings.discourse_math_enable_asciimath,
|
||||
};
|
||||
if (
|
||||
siteSettings.discourse_math_enabled &&
|
||||
|
@ -142,5 +142,5 @@ export default {
|
|||
initializeMath(api, discourse_math_opts);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -170,13 +170,13 @@ export function setup(helper) {
|
|||
enable_asciimath = siteSettings.discourse_math_enable_asciimath;
|
||||
});
|
||||
|
||||
helper.registerPlugin(md => {
|
||||
helper.registerPlugin((md) => {
|
||||
if (enable_asciimath) {
|
||||
md.inline.ruler.after("escape", "asciimath", asciiMath);
|
||||
}
|
||||
md.inline.ruler.after("escape", "math", inlineMath);
|
||||
md.block.ruler.after("code", "math", blockMath, {
|
||||
alt: ["paragraph", "reference", "blockquote", "list"]
|
||||
alt: ["paragraph", "reference", "blockquote", "list"],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"author": "Discourse",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint-config-discourse": "latest"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue