@Test public void section() throws IOException, OfxAuthoringException, OfxConfigurationException { Section section = new Section(); section.getContent().add(XmlTitleFactory.build("test")); section.getContent().add(listing); rSection.render(section); List<String> content = rSection.getContent(); OfxContentDebugger.debug(content); }
public void render(Listing listing) throws OfxAuthoringException, OfxConfigurationException { dsm.apply(listing); StringBuffer sb = new StringBuffer(); sb.append("\\lstset{language=XML"); sb.append(",basicstyle=\\scriptsize"); sb.append(",tabsize=2"); sb.append(",frame=none"); sb.append(",backgroundcolor=\\color{lgrau}"); sb.append(",showstringspaces=false"); if(listing.isSetNumbering() && listing.isNumbering()){sb.append(",numbers=left,numberstyle=\\scriptsize");} else{sb.append(",numbers=none");} if(listing.isSetLinebreak() && listing.isLinebreak()){sb.append(",breaklines=true,breakatwhitespace=true,postbreak=\\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookrightarrow\\space}}");} sb.append("}"); txt.add(sb.toString()); if(listing.isSetExternal()) { StringBuffer sbInput = new StringBuffer(); sbInput.append("\\lstinputlisting{"); sbInput.append(listing.getExternal()); sbInput.append("}"); txt.add(sbInput.toString()); } else { txt.add("\\begin{lstlisting}"); txt.add(listing.getRaw().getValue()); txt.add("\\end{lstlisting}"); } }
LatexListingRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Listing listing) throws OfxAuthoringException, OfxConfigurationException { dsm.apply(listing); StringBuffer sb = new StringBuffer(); sb.append("\\lstset{language=XML"); sb.append(",basicstyle=\\scriptsize"); sb.append(",tabsize=2"); sb.append(",frame=none"); sb.append(",backgroundcolor=\\color{lgrau}"); sb.append(",showstringspaces=false"); if(listing.isSetNumbering() && listing.isNumbering()){sb.append(",numbers=left,numberstyle=\\scriptsize");} else{sb.append(",numbers=none");} if(listing.isSetLinebreak() && listing.isLinebreak()){sb.append(",breaklines=true,breakatwhitespace=true,postbreak=\\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookrightarrow\\space}}");} sb.append("}"); txt.add(sb.toString()); if(listing.isSetExternal()) { StringBuffer sbInput = new StringBuffer(); sbInput.append("\\lstinputlisting{"); sbInput.append(listing.getExternal()); sbInput.append("}"); txt.add(sbInput.toString()); } else { txt.add("\\begin{lstlisting}"); txt.add(listing.getRaw().getValue()); txt.add("\\end{lstlisting}"); } } }
LatexListingRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Listing listing) throws OfxAuthoringException, OfxConfigurationException { dsm.apply(listing); StringBuffer sb = new StringBuffer(); sb.append("\\lstset{language=XML"); sb.append(",basicstyle=\\scriptsize"); sb.append(",tabsize=2"); sb.append(",frame=none"); sb.append(",backgroundcolor=\\color{lgrau}"); sb.append(",showstringspaces=false"); if(listing.isSetNumbering() && listing.isNumbering()){sb.append(",numbers=left,numberstyle=\\scriptsize");} else{sb.append(",numbers=none");} if(listing.isSetLinebreak() && listing.isLinebreak()){sb.append(",breaklines=true,breakatwhitespace=true,postbreak=\\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookrightarrow\\space}}");} sb.append("}"); txt.add(sb.toString()); if(listing.isSetExternal()) { StringBuffer sbInput = new StringBuffer(); sbInput.append("\\lstinputlisting{"); sbInput.append(listing.getExternal()); sbInput.append("}"); txt.add(sbInput.toString()); } else { txt.add("\\begin{lstlisting}"); txt.add(listing.getRaw().getValue()); txt.add("\\end{lstlisting}"); } } LatexListingRenderer(CrossMediaManager cmm, DefaultSettingsManager dsm); }
LatexListingRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Listing listing) throws OfxAuthoringException, OfxConfigurationException { dsm.apply(listing); StringBuffer sb = new StringBuffer(); sb.append("\\lstset{language=XML"); sb.append(",basicstyle=\\scriptsize"); sb.append(",tabsize=2"); sb.append(",frame=none"); sb.append(",backgroundcolor=\\color{lgrau}"); sb.append(",showstringspaces=false"); if(listing.isSetNumbering() && listing.isNumbering()){sb.append(",numbers=left,numberstyle=\\scriptsize");} else{sb.append(",numbers=none");} if(listing.isSetLinebreak() && listing.isLinebreak()){sb.append(",breaklines=true,breakatwhitespace=true,postbreak=\\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookrightarrow\\space}}");} sb.append("}"); txt.add(sb.toString()); if(listing.isSetExternal()) { StringBuffer sbInput = new StringBuffer(); sbInput.append("\\lstinputlisting{"); sbInput.append(listing.getExternal()); sbInput.append("}"); txt.add(sbInput.toString()); } else { txt.add("\\begin{lstlisting}"); txt.add(listing.getRaw().getValue()); txt.add("\\end{lstlisting}"); } } LatexListingRenderer(CrossMediaManager cmm, DefaultSettingsManager dsm); void render(Listing listing); }
LatexListingRenderer extends AbstractOfxLatexRenderer implements OfxLatexRenderer { public void render(Listing listing) throws OfxAuthoringException, OfxConfigurationException { dsm.apply(listing); StringBuffer sb = new StringBuffer(); sb.append("\\lstset{language=XML"); sb.append(",basicstyle=\\scriptsize"); sb.append(",tabsize=2"); sb.append(",frame=none"); sb.append(",backgroundcolor=\\color{lgrau}"); sb.append(",showstringspaces=false"); if(listing.isSetNumbering() && listing.isNumbering()){sb.append(",numbers=left,numberstyle=\\scriptsize");} else{sb.append(",numbers=none");} if(listing.isSetLinebreak() && listing.isLinebreak()){sb.append(",breaklines=true,breakatwhitespace=true,postbreak=\\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookrightarrow\\space}}");} sb.append("}"); txt.add(sb.toString()); if(listing.isSetExternal()) { StringBuffer sbInput = new StringBuffer(); sbInput.append("\\lstinputlisting{"); sbInput.append(listing.getExternal()); sbInput.append("}"); txt.add(sbInput.toString()); } else { txt.add("\\begin{lstlisting}"); txt.add(listing.getRaw().getValue()); txt.add("\\end{lstlisting}"); } } LatexListingRenderer(CrossMediaManager cmm, DefaultSettingsManager dsm); void render(Listing listing);  }