jneug / typst-mantys

Template for documenting Typst Packages and Templates.
MIT License
40 stars 5 forks source link

Label defined multiple times #5

Open tingerrr opened 6 months ago

tingerrr commented 6 months ago

I wanted to try out mantys for a new package I was working on and ran into an issue, the following code complained about the labels for the functions being defined multiple times:

#import "@preview/mantys:0.1.1": *

#import "/src/lib.typ" as subpar

#let package = toml("/typst.toml")

#show: mantys.with(
  ..package,
  title: [subpar],
  date: datetime.today().display(),
  abstract: [
    Subpar provides easy to use subfigures with sensible default numbering and related features like chapter-relative numbering in mind.
  ],
  example-scope: (subpar: subpar)
)

#tidy-module(read("/src/lib.typ"))

You can see the full repository at this point here.

jneug commented 6 months ago

mantys and tidy both create labels for the functions and without a namespace for the tidy module, those labels collide. I will look into that. For now, you can simply set a name when calling tidy-module:

#tidy-module(read("/src/lib.typ"), name:"lib")
jneug commented 6 months ago

As a sidenote: String arguments seem to be escaped twice. I opened an issue (#6) and will look into that as well.