I wanted to document using <embed-code> XML for embedding the documentation in my Markdown document. Here's the code I have in my .md file:
````markdown
<embed-code
file="$root/version.gradle.kts"
start="val validationVersion"
end="val validationVersion">
</embed-code>
```kotlin
val validationVersion by extra("2.0.0-SNAPSHOT.419")
```
````
Checking samples fails with the following console output:
> Task :docs:checkSamples
Using user's local bash profile.
export plugin already enabled
Running locally on macOS.
Running embed-code v1.1.0.
Panic: runtime error: index out of range [-1]
Codex tells me that the nature of the error is this:
New docs break the embed-code check. embedded-examples.md (line 126) and procedures.md (line 124) include literal examples that the checker scans as real embed directives. ./gradlew :docs:checkSamples fails with Panic: runtime error: index out of range [-1]. The procedures.md text also says to add an empty fenced block, but the example omits it. I’d either avoid literal tags in examples, or use a four-backtick outer Markdown fence and include a real inner fenced block after the directive.
Workaround
As a fallback for <embed-code> samples I replaced the dash in embed-code with the n-dash. It looks almost the same, but fools the tool around the XML.
I wanted to document using
<embed-code>XML for embedding the documentation in my Markdown document. Here's the code I have in my .md file:Checking samples fails with the following console output:
Codex tells me that the nature of the error is this:
Workaround
As a fallback for
<embed-code>samples I replaced the dash inembed-codewith the n-dash. It looks almost the same, but fools the tool around the XML.