Actually the command for the @mjason4x fix is on my setup:
$ cp node_modules/socket.io-client/dist/socket.io.js node_modules/socket.io-client/
Actually the command for the @mjason4x fix is on my setup:
$ cp node_modules/socket.io-client/dist/socket.io.js node_modules/socket.io-client/
Thank you @rbeer, with the help of your examples and th socket.io library I implemented it in this commit.
Here are some elements:
In the server side I've created a socket with a function to pass the desired config:
// Create a socket to pass config to the client-side
PluginSocket.Katex = {};
PluginSocket.Katex.getConfig = function (socket, callback) {
var data = {
dollarInline: _self.config.dollarInline,
};
callback(data);
};
In the client side I retrieve the config from the socket using a jquert deferred.promise:
// Retrieve config from the plugin socket and then add the composer button
var Katex = {};
var deferred = new $.Deferred();
function callBack(config) {
Katex.dollarInline = config.dollarInline;
deferred.resolve(config);
}
// do the async call to the socket.
socket.emit('plugins.Katex.getConfig', callBack);
...
// add the usd button to the composer when config caught from socket
$.when(deferred).then(addComposerButton);
Hi, I just written the [nodebb-plugin-katex], and I'd like to change the delimiters inside the formatting.addButtonDipatch
function in the client.js
script here when the user change the dollarInline
setting inside the ACP.
To do this, I need to get the value of the setting called dollarInline
inside this client script. I know that I can retrieve this setting from the server side using:
meta.settings.get('katex', function (err, options) {
console.log(err, options.dollarInline);
});
However, I can't figure out how I can get this value from the client side?
Hi, I just published the first version of nodebb-plugin-katex, even if it's the first version it seems to work as expected, if there is any issue just open a ticket on github
This plugin uses Katex to render the tex code inside your posts, it seems to work well with the markdown plugin.
\(...\)
for inline maths, and \[...\]
or $$...$$
for maths blocks.$
to wrap inline tex code.$
button has been added to the composer toolbar to facilitate usage.Feedbacks are welcome.
Hi, I just published a plugin that parse tex
code using katex, his name is nodebb-plugin-katex if you want to give it a try. Feedbacks are welcome.