Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify specifying custom directives from sbt #35

Closed
jrudolph opened this issue Oct 12, 2016 · 0 comments
Closed

Simplify specifying custom directives from sbt #35

jrudolph opened this issue Oct 12, 2016 · 0 comments

Comments

@jrudolph
Copy link
Contributor

We need a custom directive for akka-http for a customization of @snip to include scala signatures from files. This is possible to do by adapting the paradoxProcessor key like this:

  val paradoxWithSignatureDirective = Seq(
    paradoxProcessor in Compile ~= { _ =>
      // FIXME: this is a HACK so far that copies stuff over from paradox
      // it would be better if the plugin has a way of specifying extra directives through normal sbt mechanisms
      new ParadoxProcessor(writer =
        new Writer(serializerPlugins = context =>
          Seq(
          new ActiveLinkSerializer,
          new AnchorLinkSerializer,
          new DirectiveSerializer(Writer.defaultDirectives(context) :+
            new SignatureDirective(context.location.tree.label) // <-- only line that is no boilerplate
      ))))
    }
  )

It would be nice if custom directives could be specified by just adding them to key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants