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

document methods on base classes #2

Open
freeman-lab opened this issue May 23, 2016 · 3 comments
Open

document methods on base classes #2

freeman-lab opened this issue May 23, 2016 · 3 comments

Comments

@freeman-lab
Copy link
Member

We need to document the methods available on the base data types rather than just images and series thanks to @kkcthans for flagging this!

@boazmohar
Copy link
Contributor

@freeman-lab I thought I could contribute here, but not sure exactly how, should I start by adding a base.md and maybe also a blocks.md?
Do you generate these *.md files automatically from the repo?

@freeman-lab
Copy link
Member Author

Just updated the README with more detailed info on how to build and where different components are sourced from, hopefully that helps!

@boazmohar
Copy link
Contributor

@freeman-lab Thanks!
I was able to npm install and changes conf.js and run npm run build
I tried to npm start and I get the following error in marked.js:1226

Uncaught TypeError: Cannot read property 'replace' of undefined
Please report this to https://github.com/chjj/marked.

Here is the code (!!!! marks line 1226):

/**
 * Marked
 */

function marked(src, opt, callback) {
  if (callback || typeof opt === 'function') {
    if (!callback) {
      callback = opt;
      opt = null;
    }

    opt = merge({}, marked.defaults, opt || {});

    var highlight = opt.highlight
      , tokens
      , pending
      , i = 0;

    try {
      tokens = Lexer.lex(src, opt)
    } catch (e) {
      return callback(e);
    }

    pending = tokens.length;

    var done = function(err) {
      if (err) {
        opt.highlight = highlight;
        return callback(err);
      }

      var out;

      try {
        out = Parser.parse(tokens, opt);
      } catch (e) {
        err = e;
      }

      opt.highlight = highlight;

      return err
        ? callback(err)
        : callback(null, out);
    };

    if (!highlight || highlight.length < 3) {
      return done();
    }

    delete opt.highlight;

    if (!pending) return done();

    for (; i < tokens.length; i++) {
      (function(token) {
        if (token.type !== 'code') {
          return --pending || done();
        }
        return highlight(token.text, token.lang, function(err, code) {
          if (err) return done(err);
          if (code == null || code === token.text) {
            return --pending || done();
          }
          token.text = code;
          token.escaped = true;
          --pending || done();
        });
      })(tokens[i]);
    }

    return;
  }
  try {
    if (opt) opt = merge({}, marked.defaults, opt);
    return Parser.parse(Lexer.lex(src, opt), opt);
  } catch (e) {
    e.message += '\nPlease report this to https://github.com/chjj/marked.';
    if ((opt || marked.defaults).silent) {
      return '<p>An error occured:</p><pre>'
        + escape(e.message + '', true)
        + '</pre>';
    }
    throw e; !!!!!!
  }
}

@boazmohar boazmohar mentioned this issue Jul 30, 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

2 participants