sxr

A Scala source code browser

License

License

BSD New
Categories

Categories

Scala Languages
GroupId

GroupId

org.scala-sbt.sxr
ArtifactId

ArtifactId

sxr_2.10.6
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

sxr
A Scala source code browser
Project URL

Project URL

http://www.scala-sbt.org/sxr/
Project Organization

Project Organization

org.scala-sbt.sxr
Source Code Management

Source Code Management

https://github.com/sbt/sxr

Download sxr_2.10.6

How to add to project

<!-- https://jarcasting.com/artifacts/org.scala-sbt.sxr/sxr_2.10.6/ -->
<dependency>
    <groupId>org.scala-sbt.sxr</groupId>
    <artifactId>sxr_2.10.6</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.scala-sbt.sxr/sxr_2.10.6/
implementation 'org.scala-sbt.sxr:sxr_2.10.6:1.0.2'
// https://jarcasting.com/artifacts/org.scala-sbt.sxr/sxr_2.10.6/
implementation ("org.scala-sbt.sxr:sxr_2.10.6:1.0.2")
'org.scala-sbt.sxr:sxr_2.10.6:jar:1.0.2'
<dependency org="org.scala-sbt.sxr" name="sxr_2.10.6" rev="1.0.2">
  <artifact name="sxr_2.10.6" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.scala-sbt.sxr', module='sxr_2.10.6', version='1.0.2')
)
libraryDependencies += "org.scala-sbt.sxr" % "sxr_2.10.6" % "1.0.2"
[org.scala-sbt.sxr/sxr_2.10.6 "1.0.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6

provided (1)

Group / Artifact Type Version
org.scala-lang : scala-compiler jar 2.10.6

Project Modules

There are no modules declared in this project.

NOTE: This project is UNSUPPORTED. It's been forked into sbt organization just to do the minimal maintenance required by sbt project. If you would like to take over the ownership of sxr, please contact sbt-dev list.

Browsable Scala source code in HTML with:

  • syntax highlighting
  • types/applied implicits in tooltips
  • references/definition highlighted on mouseover
  • links to definition

See http://harrah.github.com/browse/samples/index.html for samples.

Still in development. Bugs are features and features are accidental.

To build with sbt (see http://scala-sbt.org/release/docs/Getting-Started/Setup.html for setup instructions):

$ sbt package

This produces a compiler plugin in target/.

To test, either run the tests directly:

$ sbt test/test
$ sbt testLink/test

Or run the all-encompassing command:

$ sbt testAll

Usage

Add the following options to your compile command for your project:

  -Xplugin:<path-to-sxr>/sxr-0.3.0-SNAPSHOT.jar
  -P:sxr:base-directory:<src-dir>

If you are using sbt, add sxr as a compiler plugin and configure it:

resolvers += Resolver.url("Typesafe Releases", url("http://repo.typesafe.com/typesafe/ivy-releases"))(Resolver.ivyStylePatterns)

addCompilerPlugin("org.scala-sbt.sxr" %% "sxr" % "0.3.0")

scalacOptions <+= scalaSource in Compile map { "-P:sxr:base-directory:" + _.getAbsolutePath }

You will get a directory .sxr that mirrors the directory structure of your sources relative to the specified base directory with one HTML file for each source file. You can make simple changes to the syntax highlighting in the style.css file in the root output directory. The linked.js file implements the highlighting of refererences, among other things.

Other options include specifying the output format and linking to other sxr sources.

To link to other sxr sources (produced with sxr 0.2.5 or later), follow these two steps.

  1. put the URLs of the other sxr sources in a file, say 'sxr.links'. The URLs should point to the base directories, not to 'index.html' or any specific file.
  2. Specify the location of this file in the 'link-file' sxr option. For example, in addition to the settings above, use:
scalacOptions <+= baseDirectory map { base =>
  val linkFile = base / "sxr.links"
  "-P:sxr:link-file:" + linkFile.getAbsolutePath)
}
org.scala-sbt.sxr

sbt

Community organization for all sbt plugin authors, sbt modules and sbt itself.

Versions

Version
1.0.2