Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    RAJKUMAR NATARAJAN
    @rajcspsg
    tutNameFilter := """.*\.(md|json|css|html)""".r
    when using mdoc plugin, I've settings as below
    mdoc / include := """.*\.(md|json|css|html)""".r
    When I run sbt docs/mdoc, I get below error

    /Users/rajkumar.natarajan/Documents/Coding/OS/reftree/build.sbt:121: error: not found: value include

    mdoc / include := """.*.(md|json|css|html)""".r,

          ^

    sbt.compiler.EvalException: Type error in expression

    what is wrong with my new settings?
    Bill Frasure
    @swoogles
    Hey Folks, are there any tips to trick Intellij into treating fenced Scala Mdoc snippets as plain Scala snippets?
    When I have plain scala in my snippets, I get syntax highlighting and autocomplete, but when I use scala mdoc... I get all the cool features of mdoc, but lose the basic Scala features in the IDE
    Ólafur Páll Geirsson
    @olafurpg
    @swoogles might be worth reporting to intellij. Syntax highlighting works in VS Code
    Bill Frasure
    @swoogles
    Thanks @olafurpg
    Bill Frasure
    @swoogles

    I've defined a format PostModifier, which is working great.

    Goal: Combine this with the Predefined Modifiers, to write snippets like
    scala mdoc:crash:format
    scala mdoc:nest:format
    or
    scala mdoc:format:crash
    scala mdoc:format:nest

    If I do format:crash, then crash is ignored, because it's just an unused parameter to my custom format PostModifier.
    If I do crash:format, then I get Invalid mode 'crash:format'

    Is there some way of saying "I want both of these behaviors, but independently, rather than trying to parse them as some combined operation" ?

    Ólafur Páll Geirsson
    @olafurpg
    @swoogles this is not supported right now but would be a cool feature
    Bill Frasure
    @swoogles
    Darn, thanks for confirming the gap!
    Would it be helpful to write up a ticket?
    Ólafur Páll Geirsson
    @olafurpg
    Sure. Although no promises about when it might get picked up by somebody
    But a ticket is a great place to consolidate discussions
    Bill Frasure
    @swoogles
    Righto, created - scalameta/mdoc#537
    If you have any tips for where in the codebase this could be implemented, I could take a crack at it :)
    I'm working on a book currently, and this feature would be beneficial enough that I could justify putting some hours towards it
    Bill Frasure
    @swoogles

    Does MDoc not support Scala 3 end markers?

    '''scala mdoc (Backticks in my actual code)
    def displayTemperature(
        behavior: String
    ): String =
      val temperature =
        try
          getTemperature(behavior)
        catch
          case (ex: RuntimeException) =>
            null
    
      "Temperature: " + temperature
    end displayTemperature
    '''

    When I execute mdoc in my project now, I get this-

    Not found: end
    end displayTemperature
    ^^^

    If I remove the end markers, the rest of the Scala 3 syntax (eg optional braces) works fine

    Tomasz Godzik
    @tgodzik
    the latest version should work @swoogles
    it was released recently
    Bill Frasure
    @swoogles
    Ah, thanks @tgodzik !
    going from 2.2.21 => 2.2.22 did the trick :)
    Bill Frasure
    @swoogles

    Hey all, another question about potential features-

    Would in-line/single backtick fences that are verified by mdoc be possible?
    The amount of refactoring I am able to confidently do on my larger code fences is awesome, but now of course I'm getting greedy and want that power in-line too :)
    I wouldn't actually want the full capabilities from fenced blocks (nested, crash, etc), but primarily basic existence checks.

    More concretely, if I have this in my document:

    ```scala mdoc
    def badlyNamedFunction() = ???
    ```
    
    Blah blah, call `scala mdoc badlyNamedFunction`, then blah blah

    Then later I renamed badlyNamedFunction to perfectlyNamedFunction, it would be fantastic if mdoc would break and alert me that I was referring to a non-existent function.

    Ólafur Páll Geirsson
    @olafurpg
    @swoogles feel free to open a feature request!
    its not a bad idea and it can probably be done
    Bill Frasure
    @swoogles
    Jack Koenig
    @jackkoenig
    Any plan for a v2.2.23? I'd love to take advantage of scalameta/mdoc#551 :slight_smile:
    Ólafur Páll Geirsson
    @olafurpg
    @jackkoenig I just triggered a 2.2.23 release https://github.com/scalameta/mdoc/releases/tag/v2.2.23
    may take a while to sync to maven
    Bill Frasure
    @swoogles

    I'm getting a weird error message the latest mdoc release.
    This code was working on 2.2.22

    ```scala mdoc
    import zio.ZIO
    import zio.Runtime.default.unsafeRun
    
    def getTemperatureZ(behavior: String): ZIO[
      Any,
      GpsException | NetworkException,
      String
    ] =
      if (behavior == "GPS Error")
        ZIO.fail(new GpsException())
      else if (behavior == "Network Error")
        // TODO Use a non-exceptional error
        ZIO.fail(new NetworkException())
      else
        ZIO.succeed("30 degrees")
    
    unsafeRun(getTemperatureZ("Succeed"))
    ```
    ... other prose and fences ...
    ```scala mdoc:crash
    unsafeRun( getTemperatureZ("GPS Error") )
    ```

    but now gives this error:

    12_Hello_Failures.md:160 (mdoc generated code) 
     Line is indented too far to the left, or a `}` is missing
        $doc.endStatement();
    It's reporting the failure on a line before my mdoc:crash fence, regardless of what I put in between the 2 fences
    I know the crash behavior just got updated with this last release, and I'm worried there was a regression of some kind. Instead of seeing an error with my src code, it's spitting out internal errors
    Bill Frasure
    @swoogles
    Tomasz Godzik
    @tgodzik
    I think the indentation is wrong when using objects, does crash create objects underneath?
    please do report it in an issue
    Bill Frasure
    @swoogles
    Tomasz Godzik
    @tgodzik
    Thanks!
    Jack Koenig
    @jackkoenig
    Thanks @olafurpg!!! And thanks again for this wonderful tool!
    Bill Frasure
    @swoogles
    Is Gitter or Discord the preferred platform for discussion of current work?
    I'm getting pretty dizzy working on a PR, and want to discuss where it will have the most visibility
    Tomasz Godzik
    @tgodzik
    @swoogles people are probably a bit more responsive on discord
    Megan Wachs
    @mwachs5
    does mdoc command-line support pulling in resources from .jar files?
    1 reply
    Tomasz Godzik
    @tgodzik
    https://discord.gg/JSUjmTeG <- you can ask here
    people are more responsiive on discord currently