Examples of SyntaxHighlighter


Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  }

  @Test
  public void plainJavaCode() throws Exception {
    String options = "java";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(code, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(code), eq(options), eq(false), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  }

  @Test
  public void javaCodeWithNumberedLines() throws Exception {
    String options = "java #";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(code, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(code), eq("java"), eq(true), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  @Test
  public void plainRubyCode() throws Exception {
    String options = "ruby";
    String rubyCode = "@name = \"Gabriel\"\n" + "puts \"Hello, \" + name";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(rubyCode, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(rubyCode), eq("ruby"), eq(false), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  @Test
  public void noLanguageDefinedIsTreatedAsText() throws Exception {
    String options = "";
    String noParticularLanguage = "Some text explaining some new bizarre\n" + "syntax in a very code alike way";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(noParticularLanguage, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(noParticularLanguage), eq("text"), eq(false), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  @Test
  public void noLanguageDefinedIsTreatedAsTextEvenWhenItIsNumbered() throws Exception {
    String options = "#";
    String noParticularLanguage = "Some text explaining some new bizarre\n" + "syntax in a very code alike way";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(noParticularLanguage, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(noParticularLanguage), eq("text"), eq(true), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  @Test
  public void shouldNotConsiderLabelAsLanguage() throws Exception {
    String options = "label=world";
    String noParticularLanguage = "Some code";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(noParticularLanguage, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(noParticularLanguage), eq("text"), eq(false), eq(emptyList), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

  @Test
  public void shouldConsiderLineHighlightOption() throws Exception {
    String options = "h=1,2";
    String noParticularLanguage = "Some code";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(noParticularLanguage, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(noParticularLanguage), eq("text"), eq(false), eq(Arrays.asList(1, 2)), Mockito.anyString());
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

 
  @Test
  public void shouldConsiderPygmentsOptions() throws Exception {
    String options = "label=somelabel options=\'startinline=true\'";
    String noParticularLanguage = "Some code";
    SyntaxHighlighter htmlCodeHighlighter = mock(SyntaxHighlighter.class);
    HtmlAndKindleCodeTag codeTag = new HtmlAndKindleCodeTag(htmlCodeHighlighter);
    CodeChunk chunk = new CodeChunk(noParticularLanguage, options);
    codeTag.parse(chunk);
    verify(htmlCodeHighlighter).highlight(eq(noParticularLanguage), eq("text"), eq(false), eq(emptyList), eq("startinline=true"));
  }
View Full Code Here

Examples of br.com.caelum.tubaina.parser.html.desktop.SyntaxHighlighter

    private CodeTag code;
    private GistResultRetriever retriever;

    public GistTag(Indentator i, GistResultRetriever retriever) {
        this.code = new CodeTag(i, new SyntaxHighlighter(new SimpleCommandExecutor(), CodeOutputType.LATEX, new CodeCache(CodeOutputType.LATEX)));
        this.retriever = retriever;
    }
View Full Code Here

Examples of com.intellij.openapi.fileTypes.SyntaxHighlighter

    public TextContentType getContentType() {
        return userValueHolder.getContentType();
    }

    public void setContentType(TextContentType contentType) {
        SyntaxHighlighter syntaxHighlighter = SyntaxHighlighter.PROVIDER.create(contentType.getFileType(), userValueHolder.getProject(), null);
        EditorColorsScheme colorsScheme = editor.getColorsScheme();
        editor.setHighlighter(HighlighterFactory.createHighlighter(syntaxHighlighter, colorsScheme));
        userValueHolder.setContentType(contentType);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.