I’d like to customize the way posts are rendered on my hosted Discourse instance. For example, if I wanted to link stock symbols that start with a dollar sign (“cashtags”) like $AAPL, how would I do this?
You would need to write a plugin that would scan the post content for /\$(\w+)\b/ and replace it with a link to the corresponding stock.
Note: if you are hosted with us, we only allow custom plugin on the enterprise data plan.
Where would they link to?
Interessant..
Am besten wäre einfach Yahoo Finance?
Vielleicht finviz.com oder barchart.com?
Ich hätte gerne ein Plugin mit dieser Funktionalität.
Gibt es eine Möglichkeit, nach der Eingabe eines Symbols einen Live-Preis anzuzeigen? Eventuell mit bedingter Formatierung in Grün oder Rot, je nach Kursbewegung.
z. B.
$APPL $148.70
Das wäre mit einer benutzerdefinierten Theme-Komponente möglich, die decorateCookedElement aus der Discourse-API verwendet. Sie müssten eine Anfrage an einen Drittanbieterdienst stellen, um die Aktieninformationen zu erhalten, und diese dann einbinden.
Danke @awesomerobot, ich werde mich dazu etwas genauer informieren.
Schau dir als Ausgangspunkt an: Custom Mentionables - plugin - Discourse Meta (du müsstest jedoch den Datensatz erstellen).