BrightSide Workbench Full Report + Source Code
org.turro.parser.wiki.WikiCompiler Class Reference

Public Member Functions

String html ()
 
WikiCompiler elWiki ()
 
WikiCompiler legacy ()
 
WikiCompiler constructor (IConstructor constructor)
 
WikiCompiler resolver (IWikiResolver resolver)
 

Static Public Member Functions

static WikiCompiler source (String source)
 
static WikiCompiler preview (String source)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file WikiCompiler.java.

Member Function Documentation

◆ constructor()

WikiCompiler org.turro.parser.wiki.WikiCompiler.constructor ( IConstructor  constructor)

Definition at line 76 of file WikiCompiler.java.

76  {
77  this.constructor = constructor;
78  return this;
79  }

◆ elWiki()

WikiCompiler org.turro.parser.wiki.WikiCompiler.elWiki ( )

Definition at line 62 of file WikiCompiler.java.

62  {
63  elWiki = true;
64  return this;
65  }

◆ html()

String org.turro.parser.wiki.WikiCompiler.html ( )

Definition at line 37 of file WikiCompiler.java.

37  {
38  String html;
39  if(elWiki) {
40  WikiResult result = WikiParser.instance()
41  .onProcessor(wmacro -> WikiProcessors.instance().constructor(constructor()).resolve(wmacro))
42  .addResolvers(resolvers)
43  .parse(source);
44  html = result.getHtml();
45  } else {
46  Parser parser = new Parser("$wiki\n" + source);
47  parser.setResolver(w -> {
48  for(IWikiResolver resolver : resolvers) {
49  w = resolver.apply(w);
50  }
51  return w;
52  });
53  html = parser.parse(constructor());
54  }
55  return (preview ? styleSheets() : "") + html;
56  }
WikiCompiler resolver(IWikiResolver resolver)
Here is the call graph for this function:

◆ legacy()

WikiCompiler org.turro.parser.wiki.WikiCompiler.legacy ( )

Definition at line 67 of file WikiCompiler.java.

67  {
68  elWiki = false;
69  return this;
70  }

◆ preview()

static WikiCompiler org.turro.parser.wiki.WikiCompiler.preview ( String  source)
static

Definition at line 111 of file WikiCompiler.java.

111  {
112  return new WikiCompiler(source, true);
113  }

◆ resolver()

WikiCompiler org.turro.parser.wiki.WikiCompiler.resolver ( IWikiResolver  resolver)

Definition at line 92 of file WikiCompiler.java.

92  {
93  if(resolver != null) resolvers.add(resolver);
94  return this;
95  }
Here is the caller graph for this function:

◆ source()

static WikiCompiler org.turro.parser.wiki.WikiCompiler.source ( String  source)
static

Definition at line 107 of file WikiCompiler.java.

107  {
108  return new WikiCompiler(source, false);
109  }

The documentation for this class was generated from the following file: