コード例 #1
0
 public String detectExtendedType(String contents, String extendedType, TextFileType fileType) {
   if (extendedType.length() == 0 && fileType.isMarkdown() && useRMarkdownV2(contents)) {
     return "rmarkdown";
   } else {
     return extendedType;
   }
 }
コード例 #2
0
  public boolean verifyPrerequisites(
      String feature, WarningBarDisplay display, TextFileType fileType) {
    if (feature == null) feature = fileType.getLabel();

    // if this file requires knitr then validate pre-reqs
    boolean haveRMarkdown = fileTypeCommands_.getHTMLCapabiliites().isRMarkdownSupported();
    if (!haveRMarkdown) {
      if (fileType.isRpres()) {
        showKnitrPreviewWarning(display, "R Presentations", "1.2");
        return false;
      } else if (fileType.requiresKnit()
          && !session_.getSessionInfo().getRMarkdownPackageAvailable()) {

        showKnitrPreviewWarning(display, feature, "1.2");
        return false;
      }
    }

    return true;
  }