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

Delegating rules #140

Open
RBusarow opened this issue May 26, 2023 · 0 comments
Open

Delegating rules #140

RBusarow opened this issue May 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@RBusarow
Copy link
Member

Rules (at least for code samples) should be able to delegate to other rules by passing them their output.

For instance, given this code sample:

val kotlinConfig = """
  plugins{
    kotlin("jvm") version $kotlinVersion
    kotlin("plugin.serialization") version $kotlinVersion
    id("com.square.anvil") version $anvilVersion
  }

  // ...
""".trimIndent()

That rule's output would put the literal strings of $kotlinVersion and $anvilVersion into the markdown file's codeblock. In order to correct that, you'd have to add more rules like this:

<!--doks the-actual-code-sample:1, dollar-anvilVersion:1, dollar-kotlinVersion:2 -->
<!--doks END-->

It would be nice if those rules could just be declared as part of the code sample rule, since they're intrinsically linked.

@RBusarow RBusarow added the enhancement New feature or request label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant