当前位置: 首页>>代码示例>>Java>>正文


Java MarkdownService类代码示例

本文整理汇总了Java中org.eclipse.egit.github.core.service.MarkdownService的典型用法代码示例。如果您正苦于以下问题:Java MarkdownService类的具体用法?Java MarkdownService怎么用?Java MarkdownService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MarkdownService类属于org.eclipse.egit.github.core.service包,在下文中一共展示了MarkdownService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connect

import org.eclipse.egit.github.core.service.MarkdownService; //导入依赖的package包/类
public boolean connect(String username, String password){

		this.username=username;
		client = new GitHubClient();
		client.setCredentials(username, password);
		
		repoService = new MyRepositoriesService(client);
		userService = new UserService(client);
		issueService = new IssueService(client);
		milestoneService = new MilestoneService(client);
		labelService = new LabelService(client);
		commitService = new CommitService(client);
		markdownService = new MarkdownService(client);
		colaboratorService = new CollaboratorService(client);
		contentsService = new ContentsService(client);
		
		
		
		try {
			loadInformations();
			return true;
		} catch (IOException e) {
			mainApp.writeNotification(e.getMessage());
			return false;
		}
	}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:27,代码来源:GitHubModel.java

示例2: GFMMassConverter

import org.eclipse.egit.github.core.service.MarkdownService; //导入依赖的package包/类
public GFMMassConverter() throws IOException {

		gFMMassConverterConfiguration = new GFMMassConverterConfiguration();

		//GitHub client with optional authentication token
		gitHubClient = new GitHubClient();
		final String authenticationToken = gFMMassConverterConfiguration.getGFMAuthenticationToken();
		if( null != authenticationToken && ! authenticationToken.isEmpty() ) {
			gitHubClient.setOAuth2Token( authenticationToken );
		}

		final String gitHubUser = gFMMassConverterConfiguration.getGFMGitHubUser();
		final String gitHubProjet = gFMMassConverterConfiguration.getGFMGitHubRepository();

		//Get the optional repository configured
		if( null != gitHubUser && ! gitHubUser.isEmpty() && null != gitHubProjet && ! gitHubProjet.isEmpty() ) {

			final RepositoryService repositoryService = new RepositoryService( gitHubClient );
			gitHubProjectRepository = repositoryService.getRepository( gitHubUser, gitHubProjet );
		}
		else {
			gitHubProjectRepository = null;
		}

		markdownService = new MarkdownService( gitHubClient );
	}
 
开发者ID:Sylvain-Bugat,项目名称:github-flavored-markdown-converter,代码行数:27,代码来源:GFMMassConverter.java

示例3: convertFile

import org.eclipse.egit.github.core.service.MarkdownService; //导入依赖的package包/类
/**
 * Open and convert a markdown file
 *
 * @param path file to convert
 * @throws IOException
 */
private void convertFile( final Path path ) throws IOException {

	if( ! Files.exists( path ) ) {
		return;
	}

	final byte[] rawFileContent = Files.readAllBytes( path );
	final String fileContent = new String( rawFileContent, gFMMassConverterConfiguration.getGFMFileEncoding() );

	final Path htmlPath = Paths.get( path.toString().replaceFirst( ".md$", ".html" ) );

	if( null != gitHubProjectRepository ) {
		try( final InputStream markdownStream = markdownService.getRepositoryStream( gitHubProjectRepository, fileContent ) ) {

			Files.copy( markdownStream, htmlPath, StandardCopyOption.REPLACE_EXISTING );
		}
	}
	else {
		try( final InputStream markdownStream = markdownService.getStream( fileContent, MarkdownService.MODE_MARKDOWN ) ) {

			Files.copy( markdownStream, htmlPath, StandardCopyOption.REPLACE_EXISTING );
		}
	}
}
 
开发者ID:Sylvain-Bugat,项目名称:github-flavored-markdown-converter,代码行数:31,代码来源:GFMMassConverter.java

示例4: markdownToHtml

import org.eclipse.egit.github.core.service.MarkdownService; //导入依赖的package包/类
@Override
@SneakyThrows
public String markdownToHtml(String accessToken, String markdown) {
	MarkdownService markdownService = new MarkdownService(createClient(accessToken));
	return markdownService.getHtml(markdown, "gfm");
}
 
开发者ID:pivotalsoftware,项目名称:pivotal-cla,代码行数:7,代码来源:MylynGitHubApi.java


注:本文中的org.eclipse.egit.github.core.service.MarkdownService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。