jgm / typst-hs

Haskell library for parsing and evaluating typst
Other
44 stars 5 forks source link

Identifier `<x>` not found #21

Open ntjess opened 11 months ago

ntjess commented 11 months ago

Sorry for so many back-to-back issues, haha. I'm converting a somewhat large project to markdown and reporting all the errors that ensue.

#rect(fill: gradient.linear(..color.map.viridis))

Produces the error

Identifier "gradient" not found
ntjess commented 11 months ago

Also occurs for version

jgm commented 11 months ago

What do you mean, version? Give a full example.

ntjess commented 11 months ago

https://typst.app/docs/reference/foundations/version/

#version(1)
ntjess commented 11 months ago

Also occurs with renamed imports.

Consider two files: an empty lib.typ and the following main.typ in the same folder:

#import "lib.typ" as mylib
#repr(mylib)

Pandoc will produce the error:

Identifier "mylib" not found
jgm commented 11 months ago

Yeah, I haven't supported renamed imports yet. Nor gradients. Nor versions as types.

jgm commented 11 months ago

Thanks for reporting all these things, though. It's helpful to have real-world testing.

ntjess commented 11 months ago

Happy to help!

CGMossa commented 5 months ago

Hello! I'm facing something similar, but content instead:

pandoc main.typ -o main.tex
"helpers.typ" (line 4, column 4):
Identifier "content" not found

Full helpers.typ file

#let r = body => [
  #let body = if type(body) == content and body.func() == raw { body.text } else { body } // error here
  #raw(lang: "r", body)
]

#let rust = body => [
  #let body = if type(body) == content and body.func() == raw { body.text } else { body }
  #raw(lang: "rust", body)
]

#let todo = box(fill: red.lighten(80%), inset: (x: 2pt), outset: (y: 2pt), radius: 2pt)[`TODO`]