module.exports = function()

in supplemental-ui/extensions/swagger.extension.js [18:42]


module.exports = function (registry) {
  registry.blockMacro('swagger', function () {
    var self = this
    self.process(function (parent, target, args) {
      var id = uniqueid();
      var html = `
      <div id="swagger-ui_${id}"></div>
      
      <script>
        document.addEventListener('DOMContentLoaded', function() {
          SwaggerUIBundle({
            url: "${target}",
            dom_id: "#swagger-ui_${id}",
            presets: [
              SwaggerUIBundle.presets.apis,
              SwaggerUIStandalonePreset
            ]
          })
        }, false);
      </script>
      `;
      return self.createBlock(parent, 'pass', html)
    })
  })
}