Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rui Morais
    @rmorais
    sbt:root> docs/mdoc [info] running mdoc.Main --screen-height 10 --no-link-hygiene
    Main seems to recognize the option
    sbt:root> docs/mdoc [info] running mdoc.Main --screen-sfasdfasdfheight 10 --no-link-hygiene error: found argument '--screenSfasdfasdfheight' which wasn't expected, or isn't valid in this context. Did you mean '--screen-height’?
    Anton Sviridov
    @keynmol

    You're right, I can reproduce the behaviour in the CLI (with coursier):

    test.md

    val x = List.fill(100)(0)
    ➜  cs launch org.scalameta::mdoc:2.2.8 -- --screen-height 10 --in test.md --out test.processed.md
    info: Compiling 1 file to /.../test.processed.md
    info: Compiled in 2.09s (0 errors)
    ➜   cat test.processed.md | wc -l
          53
    I wonder if this only applies to worksheets
    Rui Morais
    @rmorais
    I have no idea. These setting have a @hidden annotation so maybe they can only be used internally
    Ólafur Páll Geirsson
    @olafurpg
    @rmorais If you run the command-line tool with --screen-height then it doesn't appear to have an effect on the output of pprint
    the --screen-height flag is currently only used by worksheets in Metals
    it should be possible to change that to respect --screen-height
    Anton Sviridov
    @keynmol

    If no one gets to it first, I want to look into it - this will make my slides easier to control.

    @olafurpg do you think it's possible to make it into a modifier? i.e. scala mdoc:height-10 so one can vary it on a per-section basis? Or is it a different stage in mdoc (I haven't looked much into internals)?

    Anton Sviridov
    @keynmol
    Created scalameta/mdoc#387 for tracking and will give it a go later today/over the weekend
    Rui Morais
    @rmorais
    Thank you both for having a look into this
    Anton Sviridov
    @keynmol

    I got the custom modifiers to work, but the way pprint's tokenization and truncation work is puzzling:

    @ val x = List.fill(15)("helloasdasdasdasdasdasdasdasd!")
    x: List[String] = List(
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
      "helloasdasdasdasdasdasdasdasd!",
    ...
    
    @ pprint.PPrinter.BlackWhite.tokenize(x, height=5, width=10, initialOffset=0).foreach(print)
    List(
      "helloasdasdasdasdasdasdasda...

    Is this what one would expect for those values?

    image.png
    ^ which is why I got the thing to work, but the actual results are just weird
    Anton Sviridov
    @keynmol
    I've created a PR with plumbing, but pprint's logic doesn't look right to me: scalameta/mdoc#389
    Anton Sviridov
    @keynmol

    @olafurpg before I go digging through the code, do you know why 2.2.3 broke CLI invocation of mdoc?

    ➜  subatomic git:(master) ✗ cat content/blog/test-mdoc.md
    Test me!
    
    ```scala mdoc
    import cats.effect._
    
    val x = IO{
      println("hello")
    }
    
    (x *> x *> x).unsafeRunSync()
    
    ```%                                                                                                                                                                               
    
    ➜  subatomic git:(master) ✗ cs launch org.scalameta::mdoc:2.2.2 org.typelevel::cats-effect:2.1.4  -- --in content/blog/test-mdoc.md --out test.md
    info: Compiling 1 file to /Users/velvetbaldmime/Personal/subatomic/test.md
    info: Compiled in 2.3s (0 errors)
    
    ➜  subatomic git:(master) ✗ cs launch org.scalameta::mdoc:2.2.3 org.typelevel::cats-effect:2.1.4  -- --in content/blog/test-mdoc.md --out test.md
    info: Compiling 1 file to /Users/velvetbaldmime/Personal/subatomic/test.md
    error: /Users/velvetbaldmime/Personal/subatomic/content/blog/test-mdoc.md:4:8: not found: value cats
    import cats.effect._
           ^^^^
    error: /Users/velvetbaldmime/Personal/subatomic/content/blog/test-mdoc.md:6:9: not found: value IO
    val x = IO{
            ^^
    info: Compiled in 1.06s (2 errors)

    I've tested all versions from 2.2.2 to 2.2.9 and the first broken one is 2.2.3

    Ólafur Páll Geirsson
    @olafurpg
    What happens if you use the —classpath flag in mdoc?
    we fixed a “bug” where the mdoc classpath conflicted with the user classpath
    You’ll need two separate cs invocations
    Anton Sviridov
    @keynmol
    ah, so it's a feature! :) let me check

    beautiful, it works :) thanks.

    I'll create an issue to update the docs and will PR it in

    Ben Fradet
    @BenFradet

    Hello, I have an sbt project with scalaVersion := "0.27.0-RC1". However, when I run sbt "myProject/mdoc", I get:

    java.lang.ClassNotFoundException: mdoc.Main

    Any way we can use mdoc with scala 3?

    Anton Sviridov
    @keynmol
    @olafurpg whenever you have time :pray: scalameta/mdoc#389
    @BenFradet as far as I know, mdoc cannot document dotty code yet, but if you can get something like withDottyCompat trick to work with plugins, you might be able to use mdoc's 2.13 version in a dotty project.
    Caveat - I haven't tried to do that myself, but will soon for another open source project :)
    Also - is there a reason why mdoc is not using sbt-scalafmt plugin? I'm having issues locally with bin/scalafmt giving a different result to what CI achieves and I'm surprised there's a custom binary for mdoc
    Ben Fradet
    @BenFradet
    ok, thank you :+1:
    Julien Truffaut
    @julien-truffaut
    Hi all
    do I understand correctly that you need to commit the public and private keys generated? I am following the publish to github ci doc: https://scalameta.org/mdoc/docs/docusaurus.html#deploy-key
    Anton Sviridov
    @keynmol
    The public key should be added to your repo's SSH deploy keys configuration (so not commited to the repo), and the private key would be in the secrets managed by your CI
    So no keys are actually committed to the repo itself
    Julien Truffaut
    @julien-truffaut
    @keynmol that also what I thought. However, when I read the doc I had the impression I should commit it. Thanks for clarifying.
    I probably didn't read carefully. I am awful at these sort of things.
    Andrew Valencik
    @valencik
    Is there anyway to "hook" into when mdoc completes while running with --watch? Or would this require the life-cycle methods work to be merged in? (scalameta/mdoc#245)
    Ólafur Páll Geirsson
    @olafurpg
    @valencik there are no hooks at the moment
    ik not opposed to having something like that if you have a concrete proposal
    the pr you link is a bit different
    Andrew Valencik
    @valencik
    Oh, interesting. Ok, I'll put together a concrete issue describing what I'd like to do. I'd be happy to contribute the code, but might need some guidance on the design you'd prefer and where it should hook in.
    Andrew Valencik
    @valencik
    @olafurpg I've created scalameta/mdoc#411 to hopefully clear up the problem. In terms of the solution I'm up for anything.
    Alessandro
    @ImGrayMouser_twitter

    Hi everyone,
    I am quite new to the mdoc world, so please bear with me. I followed the tutorial at https://scalameta.org/mdoc/docs/tut.html and now I have in my project an folder as 'folder_name/target/` with many sub-directory. One is named 'mdoc' and containts the markdown files.
    Here the silly question. How can I publish the "compiled" .md files in GitHub if they appear into a target folder (ie the result of a compilation). Obviously I am missing some steps / concept.

    How can i publish my documentation in GH as "compiled" / verified markdown files ?
    Thanks

    Ólafur Páll Geirsson
    @olafurpg
    @ImGrayMouser_twitter you can configure the mdocOut setting if you want yo generate the files somewhere to commit into your got repository
    git*
    I personally use the docusaurus integration to release websites to gh-pages
    its
    up to you which publish step you prefer to use
    Alessandro
    @ImGrayMouser_twitter
    @olafurpg thank you very much for the quick response. Do you happen to have a repo in GH I can take a look at for inspiration? First time I hear of "docusauros" so I don't know if that would suite my needs ;)
    Ólafur Páll Geirsson
    @olafurpg
    that page contains links to several repos, you can also look at mdoc itself that uses the docusaurus integration to generate that exact website