Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions "DEPRECATION WARNING" but no documentation #224

Closed
approxit opened this issue Dec 19, 2015 · 3 comments
Closed

Extensions "DEPRECATION WARNING" but no documentation #224

approxit opened this issue Dec 19, 2015 · 3 comments
Assignees

Comments

@approxit
Copy link

I just realized that I'm getting DEPRECATION WARNING: some_extension is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated! with my extensions, but there is no documentation how to make it in "new way".

@approxit approxit changed the title "DEPRECATION WARNING" Extensions "DEPRECATION WARNING" but no documentation Dec 19, 2015
@tivie tivie self-assigned this Dec 26, 2015
@tivie
Copy link
Member

tivie commented Dec 26, 2015

You're absolutely right. I will update the documentation as soon as possible.

@ErisDS
Copy link
Contributor

ErisDS commented Apr 17, 2016

Just an FYI here - I would also really appreciate some info about what's changing and how to use it! 😁

@tivie
Copy link
Member

tivie commented Apr 17, 2016

My fault. I've updated the wiki to reflect the new extension loading mechanism.

Regardless, I'm also posting here some boilerplate code for extensions, with conditional loading and showdown's new proper loading mechanism, for quick reference.

(function (extension) {
  if (typeof showdown !== 'undefined') {
    // global (browser or nodejs global)
    extension(showdown);
  } else if (typeof define === 'function' && define.amd) {
    // AMD
    define(['showdown'], extension);
  } else if (typeof exports === 'object') {
    // Node, CommonJS-like
    module.exports = extension(require('showdown'));
  } else {
    // showdown was not found so we throw
    throw Error('Could not find showdown library');
  }

}(function (showdown) {

  // loading extension into shodown
  showdown.extension('myext', function () {
    var myext = { /* ... actual extension code ... */ };
    return [myext];
  });
}));

@tivie tivie closed this as completed May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants