INNER CODE UNIT · JavaScript

ABCPlugin

obgnail/typora_plugin · plugin/abc/index.js:1

class ABCPlugin extends BasePlugin {
  ABCJS = null

  hotkey = () => [{ hotkey: this.config.HOTKEY, callback: this.call }]

  call = () => this.utils.insertBlockCode(null, this.config.LANGUAGE, this.config.TEMPLATE)

  process = () => {
    const defaults = (prop, fallback) => Object.hasOwn(this.config.RENDER_OPTIONS, prop) ? this.config.RENDER_OPTIONS[prop] : fallback
    const parser = this.utils.thirdPartyDiagramParser
    parser.register({
      lang: this.config.LANGUAGE,
      mappingLang: "javascript",
      destroyWhenUpdate: false,
      interactiveMode: this.config.INTERACTIVE_MODE,
      metaConfigSchema: {
        ...parser.helpers.styleMetaConfigSchema.wrapDefaultStyle({
          height: this.config.DEFAULT_FENCE_HEIGHT,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…