-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Github-style checkboxes to nodes #2452
Comments
@jywarren am unable to get where we need to add the checkboxes. |
Hi @amitsin6h ... 1.) https://github.com/publiclab/plots2/blob/master/app/models/revision.rb 2.) https://github.com/publiclab/plots2/blob/master/config/initializers/constants.rb For Regex expression , we can test here : http://rubular.com/ . Thanks ! |
Awesome, @sagarpreet-chadha -- great; @amitsin6h we'd love your help with this! I think we could start with just converting checkboxes in Markdown into HTML checkboxes. Then we can think about how to make them "checkable". One at a time, like a checklist! :-) |
This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself! Here's a Regex expression which will find
You could use it like this: string.gsub(/[-|\*] \[( |x)\]/) do |match|
checked = " checked='true'" if match == "x"
"* <input type='checkbox' disabled='disabled' #{checked}/>"
end |
Hi, all! @amitsin6h any interest in this one, or is it up for grabs? Thank you!!! |
I want to try this.. first timer here |
Great !!!!! Thanks so much 😃 🎈 ! |
@publiclab/soc if anyone's looking for a break or wants to make a full-fledged |
I'd like to help out if it's still open, first-timer and first time with open source. @sagarpreet-chadha @jywarren |
That would be great 😄 !!! |
@sagarpreet-chadha Thanks, I'll get started :) |
@publiclab/reviewers looking for help on this issue
I think I'm confused on how you actually render the checkboxes. So far I have: constants.rb, added this line to search for checkbox
revision.rb, added this line to the #render_body and #render_body_raw methods to search for checkboxes within body
I think those edits might be okay, if I'm understanding this task, but I'm confused on where we actually add the checkboxes? @sagarpreet-chadha gave some great hints in comments on how to use the regex, but unfortunately, I'm still a bit lost..
How you translate that into the methods we need, e.g. the below method I wrote doesn't make sense to me because I'm not appending the checkboxes anywhere yet...
Also, I'm unsure of where exactly we're putting these checkboxes, and how I can test this locally? Any help/tips appreciated, thanks :) |
Hi @cheneyshreve ! Great work so far 😄 ! This looks perfect ! Okay so in this function : I hope this helps !! |
@cheneyshreve ...another way would be to make two pair of callouts . One callout for parsing Another callout for parsing What do you think ? |
@sagarpreet-chadha thank you! I will take a look at the other issues you posted and follow-up. |
@sagarpreet-chadha I have made some edits and submitted a PR. I know there are still issues, but hopefully I'm on the right track. Thank you for your kindness and support during this process! |
* initial setup commit * working on 2452 github-style checkboxes to nodes * removed quotes from regex for CHECKBOX, added tests for checkbox regex * WIP: still have questions regarding implementation and testing for markdown styles checkboxes * [WIP] updated checkbox code, revised tests * updated from fontawesome to traditional checkboxes in model and tests, adjusted number of test posts to reflect new checkboxes
This was completed by @cheneyshreve in #2452 - thanks!!! I'm thinking about how we could get checkboxes to be editable as in GitHub. Could we break out some steps for that here?
It could use this code, for wikis: plots2/app/controllers/wiki_controller.rb Lines 369 to 390 in 10dcec3
But we'd have to think about how this works for research notes too. The above code seems based on this node.rb Lines 877 to 886 in 10dcec3
What do you think? This seems like a potentially large project, but we could think about how to break it up into smaller pieces... maybe working on research notes first? |
* initial setup commit * working on 2452 github-style checkboxes to nodes * removed quotes from regex for CHECKBOX, added tests for checkbox regex * WIP: still have questions regarding implementation and testing for markdown styles checkboxes * [WIP] updated checkbox code, revised tests * updated from fontawesome to traditional checkboxes in model and tests, adjusted number of test posts to reflect new checkboxes
We are preparing to participate in Google Code-in, and have reserved this issue for participants in GCI - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.
Nodes on publiclab.org could use a means of making and checking off lists - just like her in github:
* [ ]
or* [x]
<ul>...
* [ ]
to* [x]
Lists are made in github flavor markdown like this:
Try making checklists in the comments here to see!
The text was updated successfully, but these errors were encountered: