public void setExampleProject(String type, String fileName) { String projectKey = "example.project." + type; setProperty(projectKey, fileName); }
public void setTemplateFileNameForDocType(String docType, String fileName) { String templateKey = DOCTYPE_TEMPLATE_PREFIX + docType + DOCTYPE_FILE_POSTFIX; setProperty(templateKey, fileName); }
public void setTemplateExtensionForDocType(String docType, String extension) { String templateExtensionKey = DOCTYPE_TEMPLATE_PREFIX + docType + DOCTYPE_EXTENSION_POSTFIX; setProperty(templateExtensionKey, extension); }
public void setImgPathUPdate(boolean imgPathUpdate) { setProperty(JBakeProperty.IMG_PATH_UPDATE, imgPathUpdate); } }
public void setPostsPerPage(int postsPerPage) { setProperty(JBakeProperty.POSTS_PER_PAGE, postsPerPage); }
public void setAssetIgnoreHidden(boolean assetIgnoreHidden) { setProperty(JBakeProperty.ASSET_IGNORE_HIDDEN, assetIgnoreHidden); }
public void setDatabaseStore(String storeType) { setProperty(JBakeProperty.DB_STORE, storeType); }
public void setDefaultType(String type) { setProperty(JBakeProperty.DEFAULT_TYPE, type); }
public void setOutputExtension(String outputExtension) { setProperty(JBakeProperty.OUTPUT_EXTENSION, outputExtension); }
public void setUriWithoutExtension(boolean withoutExtension) { setProperty(JBakeProperty.URI_NO_EXTENSION, withoutExtension); }
public void setDestinationFolder(File destinationFolder) { if (destinationFolder != null) { setProperty(DESTINATION_FOLDER_KEY, destinationFolder); setProperty(JBakeProperty.DESTINATION_FOLDER, destinationFolder.getName()); } }
public void setTemplateFolder(File templateFolder) { if (templateFolder != null) { setProperty(TEMPLATE_FOLDER_KEY, templateFolder); setProperty(JBakeProperty.TEMPLATE_FOLDER, templateFolder.getName()); } }
public void setAssetFolder(File assetFolder) { if (assetFolder != null) { setProperty(ASSET_FOLDER_KEY, assetFolder); setProperty(JBakeProperty.ASSET_FOLDER, assetFolder.getName()); } }
public void setContentFolder(File contentFolder) { if (contentFolder != null) { setProperty(CONTENT_FOLDER_KEY, contentFolder); setProperty(JBakeProperty.CONTENT_FOLDER, contentFolder.getName()); } }
public void setMarkdownExtensions(String... extensions) { setProperty(JBakeProperty.MARKDOWN_EXTENSIONS, StringUtils.join(extensions, ",")); }
public void setSourceFolder(File sourceFolder) { setProperty(SOURCE_FOLDER_KEY, sourceFolder); setupPathsRelativeToSourceFile(); }
public void setDestinationFolderName(String folderName) { setProperty(JBakeProperty.DESTINATION_FOLDER, folderName); setupDefaultDestination(); }
@Test public void shouldReturnAnAsciidoctorOption() throws Exception { File sourceFolder = TestUtils.getTestResourcesAsSourceFolder(); DefaultJBakeConfiguration config = (DefaultJBakeConfiguration) util.loadConfig(sourceFolder); config.setProperty("asciidoctor.option.requires", "asciidoctor-diagram"); config.setProperty("asciidoctor.option.template_dirs", "src/template1,src/template2"); Object option = config.getAsciidoctorOption("requires"); assertThat(String.valueOf(option)).contains("asciidoctor-diagram"); }
@Test public void shouldReturnAListOfAsciidoctorOptionsKeys() throws Exception { File sourceFolder = TestUtils.getTestResourcesAsSourceFolder(); DefaultJBakeConfiguration config = (DefaultJBakeConfiguration) util.loadConfig(sourceFolder); config.setProperty("asciidoctor.option.requires", "asciidoctor-diagram"); config.setProperty("asciidoctor.option.template_dirs", "src/template1,src/template2"); List<String> options = config.getAsciidoctorOptionKeys(); assertThat(options).contains("requires", "template_dirs"); }
@Test public void shouldReturnAnAsciidoctorOptionWithAListValue() throws Exception { File sourceFolder = TestUtils.getTestResourcesAsSourceFolder(); DefaultJBakeConfiguration config = (DefaultJBakeConfiguration) util.loadConfig(sourceFolder); config.setProperty("asciidoctor.option.requires", "asciidoctor-diagram"); config.setProperty("asciidoctor.option.template_dirs", "src/template1,src/template2"); Object option = config.getAsciidoctorOption("template_dirs"); assertTrue(option instanceof List); assertThat((List<String>) option).contains("src/template1", "src/template2"); }