public IpnbCell createCell()

in src/org/jetbrains/plugins/ipnb/format/IpnbParser.java [262:287]


    public IpnbCell createCell(boolean isValidSource) {
      final IpnbCell cell;
      if (cell_type.equals("markdown")) {
        cell = new IpnbMarkdownCell(isValidSource ? source : new ArrayList<>(), metadata);
      }
      else if (cell_type.equals("code")) {
        final List<IpnbOutputCell> outputCells = new ArrayList<>();
        for (CellOutputRaw outputRaw : outputs) {
          outputCells.add(outputRaw.createOutput());
        }
        final Integer prompt = prompt_number != null ? prompt_number : execution_count;
        cell = new IpnbCodeCell(language == null ? "python" : language,
                                input == null ? (isValidSource ? source : new ArrayList<>()) : input,
                                prompt, outputCells, metadata);
      }
      else if (cell_type.equals("raw")) {
        cell = new IpnbRawCell(isValidSource ? source : new ArrayList<>());
      }
      else if (cell_type.equals("heading")) {
        cell = new IpnbHeadingCell(isValidSource ? source : new ArrayList<>(), level, metadata);
      }
      else {
        cell = null;
      }
      return cell;
    }