Skip to content

VSCode extension for discourse plugin syntax highlighting

License

Notifications You must be signed in to change notification settings

zcuric/vscode-discourse-plugin

Repository files navigation

discourse-plugin-syntax-highlighting

vs-marketplace version github license

Syntax highlighting support for HTML <script> tags using type="text/discourse-plugin" which is actually javascript.

For example

<script type="text/discourse-plugin">
  const settings = Discourse.SiteSettings,
    taggingEnabled = settings.tagging_enabled,
    title = settings.title;

  if (taggingEnabled) {
    console.log("Yay! "+title+" has tagging enabled!")
  } else {
    console.log("Ohh nooos! "+title+"Does not allow tagging.")
  }
</script>

More on discourse theme plugin development here.