public String detectExtendedType(String contents, String extendedType, TextFileType fileType) { if (extendedType.length() == 0 && fileType.isMarkdown() && useRMarkdownV2(contents)) { return "rmarkdown"; } else { return extendedType; } }
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; }