SXR
Scala XRay
Template by
presentationmagazine.com
Scala XRay
• A plugin for scalac
• Generates browsable source in HTML
– Syntax highlighting
– Callouts for type info
– Linking & highlighting for declarations
Examples
• A full library
• Extract in a Blog
Getting it
• git clone git://github.com/harrah/browse.git
• sbt “+update” “+package”
– The plus performs actions for all targeted
scala versions “crossbuilding”
Using it
• Configure the compiler to use it
• With scalac
Xplugin:<pathtosxrjar>
P:sxr:basedirectory:<srcdir>
Using it with SBT
• In your project class
– Mix in AutoCompilerPlugins trait
– Add compiler plugin to the compile options
The output
• Inside <src>.sxr path, we'll find stuff
– HTML – an index & one per each source file
– Javascript (jquery) and css
Extracts
• Extract in an iframe
– Click export and copy/paste the snippet
– Honours current window size
– Source HTML must be at permanent address
Project
• http://github.com/harrah/browse
• By Mark Harrah, author of SBT
• Written as a POC, but good enough to use
• Seeking contributors
0 comments
Post a comment