Replies: 8 comments 8 replies
-
There are several aspects which are unclear, e.g. what exactly For example, the I don't know what the project does you are adapting from, but it seems like you might have just "lost" some of the original setup in the process. Regarding |
Beta Was this translation helpful? Give feedback.
-
Thank you for the fast response. You are correct. I missed the I am now working on the docs.laika laika.parse.markup.DocumentParser$InvalidDocuments: One or more invalid documents:
/README
[1]: unresolved internal reference: about.md
^
[1]: unresolved internal reference: installation.md
^
[1]: unresolved internal reference: api/index.html
^ Were is this README coming from? I have no such file in my sources. Do I need to configure something related to this file? TIA |
Beta Was this translation helpful? Give feedback.
-
I can't see the Helium config you are using, but when the Helium configuration adds a landing page, the name will be |
Beta Was this translation helpful? Give feedback.
-
Looking at the documentation on the landing page. The Helium configuration, that I copied verbatim, has this section (see below). Seeing as I copied this code, I am assuming that the links are correct. I then looked a the site that was generated with this configuration. I noticed that their is no Now I will look at how the templates are used, but given the configuration below, would I be correct to say that I need to add these templates to the source folder so that Laika picks these up instead of generating a landing page from a README? Apologies for the newbie questions but I have not used Laika quite some time. TIA val tlSiteHeliumConfig = Helium.defaults.site
.metadata(
title = Some("Storch"),
authors = developers.map(_.name),
language = Some("en"),
version = Some(version_)
)
.site
.layout(
contentWidth = px(860),
navigationWidth = px(275),
topBarHeight = px(50),
defaultBlockSpacing = px(10),
defaultLineHeight = 1.5,
anchorPlacement = laika.helium.config.AnchorPlacement.Right
)
.site
.topNavigationBar(
navLinks = Seq(
IconLink.internal(
Root / "api" / "index.html",
HeliumIcon.api,
options = Styles("svg-link")
),
IconLink.external(
browsableLink,
HeliumIcon.github,
options = Styles("svg-link")
)
)
)
.site
.landingPage(
logo = Some(
Image.internal(Root / "img" / "storch.svg", height = Some(Length(300, LengthUnit.px)))
),
title = Some("Storch"),
subtitle = Some("GPU Accelerated Deep Learning for Scala 3"),
license = Some("Apache 2"),
documentationLinks = Seq(
TextLink.internal(Root / "about.md", "About"),
TextLink.internal(Root / "installation.md", "Getting Started"),
TextLink.internal(Root / "api" / "index.html", "API (Scaladoc)")
),
projectLinks = Seq(
IconLink.external(
browsableLink,
HeliumIcon.github,
options = Styles("svg-link")
)
),
teasers = Seq(
Teaser(
"Build Deep Learning Models in Scala",
"""
|Storch provides GPU accelerated tensor operations, automatic differentiation,
|and a neural network API for building and training machine learning models.
|""".stripMargin
),
Teaser(
"Get the Best of PyTorch & Scala",
"""
|Storch aims to be close to the original PyTorch API, while still leveraging Scala's powerful type
|system for safer tensor operations.
|""".stripMargin
),
Teaser(
"Powered by LibTorch & JavaCPP",
"""
|Storch is based on <a href="https://pytorch.org/cppdocs/">LibTorch</a>, the C++ library underlying PyTorch.
|JVM bindings are provided by <a href="https://github.com/bytedeco/javacpp">JavaCPP</a> for seamless
|interop with native code & CUDA support.
|""".stripMargin
)
)
) |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what you mean with "as I copied this code, I am assuming that the links are correct" as that would only be true if you also copied all the Markdown sources, which does not seem to be the case? I am still not sure if you are using someone else's setup code with a completely different set of input sources or if you also copied existing Markdown over. If you have different inputs you might have a quicker path with just writing your own setup logic. For example, having a Helium-style landing page is entirely opt-in, you can alternatively have just a |
Beta Was this translation helpful? Give feedback.
-
I did some more testing including using Scala 2.12.3 and version 0.18.3 (1 README, 1 Markdown file, no theme configuration, no As suggested I used separate parsing and rendering as per the documentation. As of this moment, I tested only as a standard application using the setup above. It generates the HTML EPUB and PDF correctly. I am going back to the Mill script using this technique, but it does seem something is amiss here. I also note that sbt-laika seems to use this technique. Working code can be found here. Thanks |
Beta Was this translation helpful? Give feedback.
-
Thank you for looking into this. I will investigate myself in the coming days. Btw. the main reason the sbt plugin uses parsers and renderers separately is actually for performance, since you can generate HTML, EPUB and PDF in one task, it parses once and then passes the same result to three different renderers. But it might be that this also meant that an issue with the transformer remained undiscovered. When users use the API instead of the plugin, it is often a pure transformer, constructed without calling |
Beta Was this translation helpful? Give feedback.
-
Just to report back, now that I have investigated a bit myself. So far I am unable to replicate the issue you had with internal links on the landing page not validating. In my tests it makes no difference whether I am using a I tested with the most minimal setup, just one document and a nearly empty landing page with a single link pointing to it: val helium =
Helium.defaults
.site.landingPage(projectLinks = Seq(
TextLink.internal(Root / "doc.md", "Link")
))
.build
val transformer = Transformer
.from(Markdown)
.to(HTML)
.parallel[IO]
.withTheme(helium)
.build And then added I think I'll stop investigating further for now. In case you are able to create a smaller, self-contained test setup that replicates your original issue I'm happy to continue the investigation. |
Beta Was this translation helpful? Give feedback.
-
I am trying to adapt an SBT project to use Mill. I have the following set-up:
I use the following transformer:
I am assuming that all the
from
paths are merged into a single root so that the/api
should be visible. Here is (part of) the error I get:docs.laika laika.parse.markup.DocumentParser$InvalidDocuments: One or more invalid documents: /README [1]: unresolved internal reference: api/index.html ^ /about.md [1]: unresolved internal reference: api/index.html ^ [1]: unresolved internal reference: api/index.html ^ /installation.md [1]: unresolved internal reference: api/index.html ^ [1]: unresolved internal reference: api/index.html ^
The first thing I realize is that I don't have a README. In the
storch/docs
path I have thedirectory.conf
file with (no mention of README):The second thing I realize is that the
\about.md
has no link toapi/index.html
. In fact I don't see any references to anindex.html
in any of the sources. Looking further in the error messages I see a different error, which does not seem to be related:I also see the markdown source uses the following directives:
@:api
@:select(build-tool)
@:choice(sbt)
@:callout(info)
@:callout(warning)
@:@
but the
about.md
does not have these directives (/installation.md
does). However the source does use code fences tagged withmdoc
. So my question are:TIA
Beta Was this translation helpful? Give feedback.
All reactions