by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rob Norris
    @tpolecat
    @olafurpg here we go, Ross pointed me here --> https://github.com/http4s/http4s-jdk-http-client/blob/master/build.sbt
    Ólafur Páll Geirsson
    @olafurpg
    Cool! That build looks good.
    Saskia Gennrich
    @pektinasen
    Hello everyone. How does your editor setup for mdoc look like?
    I found the "toggle preview locking" setting in vscode, but if I have a larger document the view jumps back to the top on compile. Is there a way to make the markdown preview remember the position of the generated markdown file.
    I'm on windows, in case that's makes a difference 🙈
    Ólafur Páll Geirsson
    @olafurpg
    @pektinasen I use mdoc --watch and open the localhost:4000 URL which is printed to the console
    Saskia Gennrich
    @pektinasen
    @olafurpg oh, thank you. I didn't see that. 🤦‍♀️
    Luis Miguel Mejía Suárez
    @BalmungSan

    Hello, I am getting a funny behavior with comments at the end of a line.

    For example, consider this:

    ```scala mdoc:compile-only
    // a
    val a = 10
    val b = 20 // b
    val c = 30
    ```

    It produces this:

    ```scala
    // a
    val a = 10
    val b = 20 // b // b
    val c = 30
    ```

    You can see that the // b comment was duplicated.
    Also, without the compile-only modified this happens:

    ```scala
    // a
    val a = 10
    // a: Int = 10
    val b = 20 // b
    // b: Int = 20 // b
    val c = 30
    // c: Int = 30
    ```

    After playing with it for a while, it seems it only happens with comments at the end of a line, since // a wasn't affected.
    And that it requires more statements after; if it is the last one the error doesn't happen (but it may be any arbitrary number of blank lines between b and c)

    Using mdoc v2.1.1 through sbt-microsite 1.1.5


    (sorry if this was already identified, but I didn't found anything in the issues of the project)

    Ólafur Páll Geirsson
    @olafurpg
    @BalmungSan good catch! This looks like a bug, can you please report an issue?
    I suspect the problem is that mdoc parses the statements and position of the statements don't enclose the trailing comments
    Luis Miguel Mejía Suárez
    @BalmungSan
    Roger, reporting it.
    BTW, thanks for all your great work :D
    Luis Miguel Mejía Suárez
    @BalmungSan
    Ben Fradet
    @BenFradet
    Hello, is there a way to make warnings outputted my mdoc (such as unknown links) fail the task? -X-fatal-warnings doesn't seem to fit the bill
    Ólafur Páll Geirsson
    @olafurpg
    (it's a fairly new feature)
    Ben Fradet
    @BenFradet
    thanks I'll give that a shot :+1:
    Jakub Kozłowski
    @kubukoz
    How does one set up the preview like in the first gif here? https://scalameta.org/mdoc/
    I can preview markdown just fine but I haven't been able to do with mdoc's workings
    ah nice, I already asked about that :joy: https://gitter.im/scalameta/mdoc?at=5e40913d340a8019bbb13f04
    Ólafur Páll Geirsson
    @olafurpg
    @kubukoz I use docs/mdoc -w to get a quick edit/preview feedback loop
    mdoc has a built-in static file server that renders the generated .md files as HTML
    It probably should launch the browser on the right page to make it easier to find the URL, I always cmd+click on the link that's printed to the console
    Artur Opala
    @arturopala
    @olafurpg hi, thanks for mdoc, it really makes difference!
    @olafurpg do you think it would be possible to have an option to render lists and other collections horizontally rather than vertically?
    // res76: List[String] = List(
    //   "j",
    //   "i",
    //   "h",
    //   "g",
    //   "f",
    //   "ee",
    //   "d",
    //   "c",
    //   "b",
    //   "a"
    // )
    Ólafur Páll Geirsson
    @olafurpg
    @arturopala the mdoc printer is configurable in the library API
    Artur Opala
    @arturopala
    Thanks!
    Julien Truffaut
    @julien-truffaut
    Hi all, do you know where can I find an example of how to customise the output?
    I would like to change resX: Type = Value to resX: Type = \n Value
    Ólafur Páll Geirsson
    @olafurpg
    @julien-truffaut did you see right above? https://gitter.im/scalameta/mdoc?at=5eb2f52db311696be80d7a9f
    Julien Truffaut
    @julien-truffaut
    ahah no I didn't even check the previous comment. Thanks and sorry for that.
    Ólafur Páll Geirsson
    @olafurpg
    the variable printer can only be customized with the library API
    mdoc.MainSettings.withVariablePrinter()
    Julien Truffaut
    @julien-truffaut
    ah so you cannot use it within a markdown file?
    Ólafur Páll Geirsson
    @olafurpg
    you can use the mdoc:to-string modifier
    Julien Truffaut
    @julien-truffaut
    thanks
    Julien Truffaut
    @julien-truffaut
    have you already seen an error like this:
    Assertion failed:
    Trying to access the this of another class: tree.symbol = class Session$App16, class symbol = <$anon: monocle.PPrism> compilation unit: prism.md
    Ólafur Páll Geirsson
    @olafurpg
    @julien-truffaut i haven’t seen that error before. Could it be related to a macro? mdoc prints normal source code that you can see with —verbose. mdoc doesn’t poke at compiler internals
    Yilin Wei
    @yilinwei
    Hello, is someone working on/is there a github issue capturing dotty support? I can only find a few comments in the gitter chat about it; otherwise happy to give it a go.
    Yilin Wei
    @yilinwei
    OK, it looks like the markdown compiler uses the compiler that MDOC has on the classpath? I guess I need to take a look at whether the dotty compiler has the same API and what the dotty plugin is actually doing.
    Ólafur Páll Geirsson
    @olafurpg
    @yilinwei see https://contributors.scala-lang.org/t/metals-and-scala-3/4274 for a recent update on Dotty support. Metals uses mdoc for worksheets
    it’s currently blocked on Dotty syntax support in Scalameta
    there’s an open pr in Scalameta/Scalameta which implements some missing pieces
    Another blocking issue is getting Dotty support for pprint.TPrint which mdoc uses for rendering types
    mdoc itself depends on a very small surface of the Scala 2 compiler api and I estimate it would be easy to abstract over that to use Dotty-interfaces instead
    Yilin Wei
    @yilinwei
    @olafurpg Looking through TPrint, it looks like it might be quite challenging, since it tries to capture something outside of the scope defined in the macro.
    I'll give it a go though.
    Ólafur Páll Geirsson
    @olafurpg
    @yilinwei worst case we can use Type.toString with fully qualified names
    I think it would be useful if the dotty macro api supported the ability to lookup a name in scope
    Yilin Wei
    @yilinwei
    @olafurpg FYI: lihaoyi/PPrint#39. I'm not sure whether it's important to lookup a name in a scope. I think that TPrint used to do this because the previous macros didn't capture some of the alias information but I think they do now in TASTY.