google / budoux

https://google.github.io/budoux/
Apache License 2.0
1.44k stars 32 forks source link

Implementing of budoux in Webflow Website. #726

Closed anupuxdesigner closed 4 weeks ago

anupuxdesigner commented 1 month ago

budoux I wanted to implement Budoux for a Japanese website in Webflow. I applied CDN, but using the import function was giving errors, saying unable to import.

I tried another workaround to add HTML embed as text and enclose it in Budoux like "Google の​使命は、​世界中の​情報を​整理し、​世界中の​人が​アクセスできて​使えるように​する​ことです。" It worked! but, It would be good if, instead of using HTML embed element, I could use attributes to apply Budoux directly to my native Webflow text elements. I tried using "budou-this=true" , and , "budou-this=ja" but it did not worked. I don't know if i can use it with attributes or not.

budoux attributes

tushuhei commented 1 month ago

Hi there, thanks for reporting! Webflow is new to me, and I'm not sure if I can help make BudouX work the way you want.

I applied CDN, but using the import function was giving errors, saying unable to import.

Could you please clarify which CDN you used and the specific error message you encountered?

It's important to note that the BudouX JavaScript module is exported in two ways: CommonJS and ES Modules. While CommonJS is the default, only ES Modules function correctly within a web browser.

For instance, loading the script from https://unpkg.com/budoux/ redirects to dist/index.js, which is a CommonJS module. To use ES Modules and ensure compatibility, load the script from https://unpkg.com/budoux/module/index.js instead.

anupuxdesigner commented 4 weeks ago

Hi, I tried both modules, the problem is importing and parsing of element is not working. But I tried another way, I applied javascript which dynamically put my element in and it worked! Thanks for your reply. Anup Singh

On Thu, Sep 26, 2024 at 5:00 PM Shuhei Iitsuka @.***> wrote:

Hi there, thanks for reporting! Webflow is new to me, and I'm not sure if I can help make BudouX work the way you want.

I applied CDN, but using the import function was giving errors, saying unable to import.

Could you please clarify which CDN you used and the specific error message you encountered?

It's important to note that the BudouX JavaScript module is exported in two ways: CommonJS and ES Modules. While CommonJS is the default, only ES Modules function correctly within a web browser.

For instance, loading the script from https://unpkg.com/budoux/ redirects to dist/index.js, which is a CommonJS module. To use ES Modules and ensure compatibility, load the script from https://unpkg.com/budoux/module/index.js instead.

— Reply to this email directly, view it on GitHub https://github.com/google/budoux/issues/726#issuecomment-2376681789, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAFBWJVAF24PP73BSOE5MNDZYPV5HAVCNFSM6AAAAABOPBATO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZWGY4DCNZYHE . You are receiving this because you authored the thread.Message ID: @.***>

tushuhei commented 4 weeks ago

Great to hear that it's resolved!