How to use the @jupyterlab/cells.MarkdownCellModel function in @jupyterlab/cells

To help you get started, we’ve selected a few @jupyterlab/cells examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab-data-explorer / tests / test-cells / src / model.spec.ts View on Github external
it('should be set with type "markdown"', () => {
        const model = new MarkdownCellModel({});
        expect(model.type).to.equal('markdown');
      });
    });
github jupyterlab / jupyterlab / tests / test-cells / src / model.spec.ts View on Github external
it('should be set with type "markdown"', () => {
        const model = new MarkdownCellModel({});
        expect(model.type).to.equal('markdown');
      });
    });
github jupyterlab / jupyterlab / test / src / cells / widget.spec.ts View on Github external
describe('MarkdownCellWidget', () => {

    let contentFactory = createBaseCellFactory();
    let model = new MarkdownCellModel({});

    describe('#constructor()', () => {

      it('should create a markdown cell widget', () => {
        let widget = new MarkdownCellWidget({ model, rendermime, contentFactory });
        expect(widget).to.be.a(MarkdownCellWidget);
      });

      it('should accept a custom contentFactory', () => {
        let widget = new MarkdownCellWidget({ model, rendermime, contentFactory });
        expect(widget).to.be.a(MarkdownCellWidget);
      });

      it('should set the default mimetype to text/x-ipythongfm', () => {
        let widget = new MarkdownCellWidget({ model, rendermime, contentFactory });
        expect(widget.model.mimeType).to.be('text/x-ipythongfm');
github jupyterlab / jupyterlab / test / src / cells / model.spec.ts View on Github external
it('should be set with type "markdown"', () => {
        let model = new MarkdownCellModel({});
        expect(model.type).to.be('markdown');
      });
github jupyterlab / jupyterlab / packages / notebook / src / model.ts View on Github external
createMarkdownCell(options: CellModel.IOptions): IMarkdownCellModel {
      if (this.modelDB) {
        if (!options.id) {
          options.id = UUID.uuid4();
        }
        options.modelDB = this.modelDB.view(options.id);
      }
      return new MarkdownCellModel(options);
    }
github jupyterlab / jupyterlab / packages / chatbox / src / chatbox.ts View on Github external
private _createMarkdownCellOptions(text: string = ''): MarkdownCell.IOptions {
    let contentFactory = this.contentFactory.markdownCellContentFactory;
    let model = new MarkdownCellModel({ });
    this._disposables.add(model);
    let rendermime = this._rendermime;
    model.value.text = text || '';
    return { model, rendermime, contentFactory };
  }
github jupyterlab / jupyterlab / packages / notebook / src / model.ts View on Github external
createMarkdownCell(options: CellModel.IOptions): IMarkdownCellModel {
      if (this.modelDB) {
        if (!options.id) {
          options.id = UUID.uuid4();
        }
        options.modelDB = this.modelDB.view(options.id);
        let cell;
        this.modelDB.withTransaction(() => {
          cell = new MarkdownCellModel(options);
        });
        return cell;
      }
      return new MarkdownCellModel(options);
    }
github yuvipanda / simplest-notebook / packages / chatbox / src / chatbox.ts View on Github external
private _createMarkdownCellOptions(text: string = ''): MarkdownCell.IOptions {
    let contentFactory = this.contentFactory.markdownCellContentFactory;
    let model = new MarkdownCellModel({ });
    this._disposables.add(model);
    let rendermime = this._rendermime;
    model.value.text = text || '';
    return { model, rendermime, contentFactory };
  }