Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    I'm shadowing mdoc.Main with my own copy that adds a customized variablePrinter to the configuration all the way up at the top.
    Making pprinter into a ctor arg for ReplVariablePrinter in mdoc itself would cut this in half, I may do that.
    Making the entry point configurable would make shadowing unnecessary.
    Ólafur Páll Geirsson
    @olafurpg
    I’m all for making these kinds of changes easier 👍
    Did you try tweaking MainSettings?
    you dont need to poke into internals to change the variable printer
    I’m on the phone right now, there should be something like “withVariablePrinter()” https://github.com/scalameta/mdoc/blob/ccab290c46a41ab8679f0cd072455c94d1e1f2bc/mdoc-docs/src/main/scala/mdoc/docs/Docs.scala
    The steps to use mdoc as a library are documented here https://scalameta.org/mdoc/docs/installation.html#library
    Nikita Gazarov
    @raquo
    Hey guys, has anyone gotten JSC_UNDEFINED_VARIABLE errors trying to run mdoc? I'm getting these starting with mdoc 2.2.12. Seems to be related to having more than one mdoc:js code block in several .md files. I made a small reproduction here: https://github.com/scalameta/mdoc/issues/454#issuecomment-772372505
    Anton Sviridov
    @keynmol
    huh, 2.2.12 was exactly just a bump to sjs 1.3.0
    Nikita Gazarov
    @raquo
    Also a scalajs-bundler bump. Although, the same scalajs-bundler runs tests and in production ok. It's only via mdoc that the problem surfaces. I'm so lost sigh.
    Anton Sviridov
    @keynmol

    And I was the last one who ever touched the JsModifier.scala in mdoc :sweat:

    I'll take a look - it might be something to do with using the linker as incremental in mdoc - I tried to reproduce by effectively running mdoc-js via CLI (against some laminar snippets) but couldn't - I'll try again with your minimization

    Nikita Gazarov
    @raquo
    Thanks, indeed, please try my latest repro. It is very sensitive to .md contents. Half of my snippets worked just fine, and even the problematic ones work fine if they are arranged differently among the .md files.
    Anton Sviridov
    @keynmol

    I'll ask Sebastien as well - Mdoc basically mimics incremental compilation of SJS by reusing a lot, as long as classpath remains unchanged.

    Worst scenario, some of that stuff can be moved behind a flag and a fresh linker used for each file. It will be slower but I think will 99% mimic what SJS does in batch mode.

    the act that the repro is sensitive to filenames doesn't fill me with confidence :D
    Nikita Gazarov
    @raquo
    just the order, you know, "a" < "b" < "c". It's weird, yes.
    Andrew Valencik
    @valencik
    Is the example report broken in the docs? https://scalameta.org/munit/docs/reports.html I'm just seeing some ending table tags
    Ólafur Páll Geirsson
    @olafurpg
    @valencik I opened scalameta/munit#305 to remove that page
    Anton Sviridov
    @keynmol

    I've started fleshing out a repro for @raquo's issue here: scalameta/mdoc#455

    Sadly the naive approach doesn't seem to work, tests are still passing

    I have another approach of intercepting a CLI command one of my tool makes and trying to make it match the reproducible in the issue.

    Nikita Gazarov
    @raquo
    Thanks, is there some way I could make my own repro branch even smaller / more useful? mdoc internals are beyond me, but I could... rip out some more stuff from my branch if that helps?
    Anton Sviridov
    @keynmol

    I think the closest we will get is to get a CLI reproducible: https://scalameta.org/mdoc/docs/js.html#command-line

    Admittedly, it's quite hairy and that's why I wanted to reproduce it in tests first.

    Is this blocking you from upgrading laminar to 1.3x (asking because I thought you wanted to postpone that)

    Nikita Gazarov
    @raquo
    It's technically blocking me from releasing Laminar 0.12.0 because its dependencies require 1.3.0, but we can re-release the dependencies based on 1.1.0. Since this issue appears to be complicated, I think we will end up doing that to avoid creating an urgency for the fix.
    Anton Sviridov
    @keynmol
    Ok, so by invoking CLI directly (well, through my tool) I seem to be able to compile this file with laminar being a dependency
    3 replies
    image.png
    (mdoc 2.12.16, SJS 1.3.0)
    So next step is reproducing those peculiar files
    Anton Sviridov
    @keynmol
    a-ha! I just got the error. Reduced it down to a single java -classpath command!
    It's full of refs to my own folders, but from here I can make it into a coursier-only reproducible.
    image.png
    Nikita Gazarov
    @raquo
    :tada: Nice
    Anton Sviridov
    @keynmol
    Even better - here's a single bash script (with coursier) reproduction on CI :) https://github.com/keynmol/mdoc-scalajs-problem/runs/1834922392?check_suite_focus=true#step:4:22
    not sure it's possible to go even more minimal
    Anton Sviridov
    @keynmol

    Ok, at this point I need to disappear, given the time, but now I have something where I can vary mdoc version to see if I can fix this. (I've also confirmed 2.2.11 -> 2.2.12 jump being the regression).

    Sorry that that you hit this issue, it sucks that I can't help more :-/

    Nikita Gazarov
    @raquo
    This is great progress, thanks!
    Ólafur Páll Geirsson
    @olafurpg
    @keynmol I think the CI release process only triggers when you push a git tag
    I have a git release 1.2.4 script like this
    ❯ cat `which git-release`
    set -eux
    version=$1
    git tag -af "v$version" -m "v$version" && git push -f origin v$version
    the --force flag is options, but I use it by default since I occasionally need to push a new tag to trigger a CI job
    Anton Sviridov
    @keynmol
    so weird that it shows a tag "pushed" 8 hours ago - I usually tag projects through UI as well
    I'll re-push the tag then
    Anton Sviridov
    @keynmol
    ok it's building now :+1: I wonder if it's because of release-drafter? in another project Github Actions does recognise the new releases as pushes of new tags
    Ólafur Páll Geirsson
    @olafurpg
    I think the release yaml config in the mdoc repo doesnt run on the “release” event. Changing that should fix it.
    Julien Truffaut
    @julien-truffaut
    Hi all, is there a way to produce to produce a docusaurus website with mdoc with most pages in two versions: one for scala 2.13 and one for scala 3
    Anton Sviridov
    @keynmol
    I don't think mdoc supports building scala3 markdowns yet? It was depending on Scalameta, I think
    Julien Truffaut
    @julien-truffaut
    ah thanks for letting me know
    Anton Sviridov
    @keynmol
    I'd suggest verifying this, but this is still there :) scalameta/mdoc#414
    Ólafur Páll Geirsson
    @olafurpg
    @julien-truffaut at the moment there's no support to generated mixed-version docs. It would be a nice feature
    you can use crossScalaVersions to cross-build the docs sbt project against multiple versions, but that would give you independent copies of the entire website
    scala 3 is not yet supported for processing markdown files