idiomatic-rust icon indicating copy to clipboard operation
idiomatic-rust copied to clipboard

Add checkboxes to each item

Open kemitix opened this issue 1 year ago • 3 comments

Readers can clone the repo, then create their own branch, and check of each item as they read them.

kemitix avatar Feb 26 '24 13:02 kemitix

Hey @kemitix, thanks for the pull request.

I would assume most people use the web view to go through the entries. Wonder if people would actually know the workflow for this. Even then, wouldn't they have to edit the Markdown themselves? What about new resources that will be added in the future? Will they have to merge in changes manually? 🤔 Also, I do wonder if people get a confused by the checkboxes in the main repository without any context. Ticking them off won't work without hitting "edit". Alternatively, we could add support for checking off items on https://corrode.dev/idiomatic-rust/ by using local storage. The source code for that is here: https://github.com/corrode/corrode.github.io/blob/master/content/idiomatic-rust/table.js The library that I use for the table, DataTables, supports local storage. https://datatables.net/examples/basic_init/state_save.html Maybe I can add checkboxes there and add save their state.

mre avatar Feb 26 '24 20:02 mre

@mre I'd assume the most people learning/developing Rust would know how to create their own fork. I like your idea of adding them to https://corrode.dev/idiomatic-rust/ though. That's even less friction for the user.

kemitix avatar Feb 26 '24 21:02 kemitix

Quick update: I tried and failed to add the checkboxes to my website. The problem is, that the checkboxes don't get persisted on reload. I tried this package, which didn't work for me: https://www.gyrocode.com/projects/jquery-datatables-checkboxes/examples/

If someone wants to give it a shot, I'd be thankful for support.

mre avatar Feb 28 '24 23:02 mre

At long last, the checkboxes are now live at https://corrode.dev/blog/idiomatic-rust-resources. I also (hopefully) managed to fix the local state saving. 🎉 The repo won't have any checkboxes because progress (i.e. the checkbox state) won't be persisted on GitHub. Thanks for the inspiration and the initial PR @kemitix.

With that, I'm closing this issue as resolved.

mre avatar Jun 04 '24 17:06 mre