
com.asayama.gwt.angular.site.examples.client.view.PrettifyExampleDocumentation.html Maven / Gradle / Ivy
gwt-angular-prettify offers google-code-prettify
inside your GWT Angular code.
View
There are two ways you can make use of gwtPrettify directive, either as an
attribute directive, or as a class directive.
If you have a fairly small code, or a piece of code that is not intended
for compilation but simply for documentation, consider using the class
directive. The class directive allows you to inline your code snippet inside
your <PRE>
. You will have to escape any occurrence of
characters that may conflict with HTML parsing and rendering, of course.
Controller
If you have a fairly large code snippet, consider using the attribute
directive. data-gwt-prettify
directive takes a single argument,
which is a TextResource
. You can define your TextResource
as you would normally do with your GWT applications. You can see an
example of this below, MyResources
, which is used to expose the
code to the view via the controller in VIEW_CODE
public final
property.
Configuration
The following modules are required in the gwt.xml.
The following Maven dependencies are required in the pom.xml.
<dependency>
<groupId>com.asayama.gwt</groupId>
<artifactId>gwt-angular-prettify</artifactId>
<version>{{ PROJECT_VERSION }}</version>
</dependency>
You can also browse the full source code on Github.
{{ GITHUB_SOURCE_URL }}/gwt-angular-site/gwt-angular-examples/Prettify