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

add zola slug strategy #1419

Merged
merged 38 commits into from
May 7, 2024
Merged

add zola slug strategy #1419

merged 38 commits into from
May 7, 2024

Conversation

float3
Copy link
Contributor

@float3 float3 commented Apr 26, 2024

@float3
Copy link
Contributor Author

float3 commented Apr 26, 2024

I need guidance with testing and let me know if you're happy with this build process as described in the scripts in package.json

@float3
Copy link
Contributor Author

float3 commented Apr 26, 2024

I guess now that I think about it, a slightly better way of doing this might be uploading the package to npm and just pulling it in, then you won't have to deal with building it, let me know what you think

@float3
Copy link
Contributor Author

float3 commented Apr 27, 2024

building works fine, but testing doesn't, the TOC annotations aren't even showing up

@float3
Copy link
Contributor Author

float3 commented Apr 27, 2024

@yzhang-gh let me know once you get to it (: thanks for your help

@yzhang-gh
Copy link
Owner

Many thanks.

I guess now that I think about it, a slightly better way of doing this might be uploading the package to npm and just pulling it in, then you won't have to deal with building it, let me know what you think

I think so and I guess then it won't break the current CI. Would you mind hosting this zola-slug npm package?

@yzhang-gh yzhang-gh added the Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). label Apr 28, 2024
@float3
Copy link
Contributor Author

float3 commented Apr 29, 2024

the broken CI is because I made a mistake, we need to build the rust project before running npm ci I guess, but a separate npm package is probably the better approach, I will host it!

@float3
Copy link
Contributor Author

float3 commented Apr 29, 2024

@yzhang-gh I realized the problem with this is that unless you wanna read the wasm you can't verify what code is in https://www.npmjs.com/package/zola-slug?activeTab=code

I compiled it with wasm-pack but you probably shouldn't just trust me

let me know how you wish to proceed

@yzhang-gh
Copy link
Owner

Thanks for the heads up. Then I think it would be better if the build process is also public (e.g. GitHub Action? GitHub Packages?), although I remember I tried it many years ago and it didn't work 😂.

@float3
Copy link
Contributor Author

float3 commented Apr 30, 2024

@yzhang-gh now the workflow should work and I tested the final vsix by using it on my website float3/float3.github.io@80b8287 the toc here was generated with the new slugify strategy

the build process here is public, we're not using the npmjs package

@float3
Copy link
Contributor Author

float3 commented Apr 30, 2024

looks like the action still doesn't work, not sure why right now, the steps described in the workflow work perfectly when I run it on my local machine

@float3 float3 marked this pull request as ready for review April 30, 2024 23:44
@float3
Copy link
Contributor Author

float3 commented Apr 30, 2024

ci is passing and the extension is working https://github.com/float3/vscode-markdown/actions

here is a demo
https://github.com/float3/float3.github.io/blob/master/content/notes/food.md?plain=1#L10-L39
you should be able to try it yourself

@float3
Copy link
Contributor Author

float3 commented Apr 30, 2024

I think it's ready for review @yzhang-gh

@yzhang-gh
Copy link
Owner

Nice work. I will try to take a look soon.

@float3
Copy link
Contributor Author

float3 commented May 1, 2024

if you're more experienced with webpack let me know if you know a better way of doing this

@float3
Copy link
Contributor Author

float3 commented May 3, 2024

it looks like I can maybe use CopyPlugin or module rules to copy the file to the right place, then we can avoid the bad CI change I made

edit: it worked, we fixed it

src/extension.ts Outdated Show resolved Hide resolved
@yzhang-gh
Copy link
Owner

Amazing!

if you're more experienced with webpack

Unfortunately no 🥲, but happy to see you did it.

@float3
Copy link
Contributor Author

float3 commented May 4, 2024

like this the first time zola slugify will always fail on my machine, and always succeed on the second try since this way it's a race condition, I'm open to suggestions

@float3
Copy link
Contributor Author

float3 commented May 6, 2024

now additionally we could do some error handling if it hasn't finished importing yet

@float3
Copy link
Contributor Author

float3 commented May 6, 2024

@yzhang-gh can you take another look over the changes

@yzhang-gh
Copy link
Owner

🍻

@yzhang-gh yzhang-gh merged commit 895dfe3 into yzhang-gh:master May 7, 2024
1 check passed
@float3
Copy link
Contributor Author

float3 commented May 7, 2024

好的! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants