Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations doesn't seems to work when importing code from a file into a codeblock #439

Open
aromko opened this issue Aug 30, 2024 · 4 comments

Comments

@aromko
Copy link

aromko commented Aug 30, 2024

Hey,
I'm trying to use annotations when importing code from a file. It works in the old version but in the new version it seems that I'm missing something.

I tried this:

<CH.Code style={{ height: 500 }}>

`tsx TabsActionExample.tsx use-v1
// !focus(14:22)
!from ./_components/TabsActionExample.tsx
`

`tsx Link.tsx
// from ./_components/Link.tsx
`

</CH.Code>

This leads to:
Bildschirmfoto 2024-08-30 um 10 19 00

When I remove // !focus(14:22) the code is loaded.

What am I doing wrong?

@pomber
Copy link
Contributor

pomber commented Aug 30, 2024

you are using v1.0.0, right? yes, currently you can only have the !from inside the codeblock. you can put annotations inside the imported file if it helps, but the idea is to make it more flexible soon, allowing annotations, extra code, extra froms.

related #401

@aromko
Copy link
Author

aromko commented Aug 30, 2024

Yeah. sorry I'm trying to upgrade to the new version.

@pomber
Copy link
Contributor

pomber commented Aug 30, 2024

no problem, let me know any other issue you have

@aromko
Copy link
Author

aromko commented Aug 30, 2024

So you mean I can use the annotations in the .tsx files? e.g

const App = () => (
  // !focus(14:22)
  <MarigoldProvider theme={theme} className="h-[340px]">
    <Tabs defaultActiveTab="description">
...

That doesn't seems to work and I think I don't want it into my components :-D So I need to wait until it is supported :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants