-
-
Notifications
You must be signed in to change notification settings - Fork 258
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 option to let the user check/uncheck the checkboxes #249
Conversation
I'm not sure I follow what this pull is trying to solve, can you explain? |
|
Hi @facelessuser, First of all thank you for your quick reply ! Indeed I need this functionnality in order to be able to check dynamicaly some checkboxes. For exemple, I write some documentations of installation tools and I want to let the final user to follow the procedure by checking the steps already done. If you will accept this pull request, I'll fix all the things you mentioned : |
I guess I'm okay with this, but all the mentioned things will have to be addressed first. New feature should be tested, all tests must pass, and there needs to be documentation. |
b133b02
to
c58fca2
Compare
Hi @facelessuser , i made changes on PR :
And now i'll try to understand why the tests are falling on your CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix all noted comments.
@@ -85,7 +99,7 @@ Classes | Description | |||
} | |||
``` | |||
|
|||
??? settings "Custom Tasklist CSS" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a details object, not a header. Please change the syntax back to how it was.
| `task-list-control` | This is attached to the `label` tag and represents the control object. | | ||
| `task-list-indicator` | This is attached to the `span` directly following the input and is used to style the visual indicator. | | ||
|
||
### settings "Basic Tasklist CSS" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a details object, not a header. Please change the syntax to how it was.
Option | Type | Default | Description | ||
----------------- | ---- | ------------ | ------------ | ||
`custom_checkbox` | bool | `#!py3 False` | Generate task lists in such a way as to allow for styling the check box with CSS. | ||
| Option | Type | Default | Description | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't rewrite table syntax that I am using. Please remove leading and trailing pipes (|
). I understand some may prefer to have tables flanked by those, but I do not.
pymdownx/tasklist.py
Outdated
"""Get checkbox tag.""" | ||
|
||
if custom_checkbox: | ||
return ( | ||
'<label class="task-list-control">' + | ||
'<input type="checkbox" disabled%s/>' % (' checked' if state.lower() == 'x' else '') + | ||
'<input type="checkbox"%s%s/>' % (' disabled' if clickable_checkbox == False else '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing because you added a trailing self closing /
in the input tag. This is probably better so that when people insert this into xhtml (but who is doing this these days). So I'm fine with the change, but you need to regenerate changed, failing tasklist tests.
I've noted in the review why CI is failing. Also, I've noted additional changes that need to fixed. |
813c170
to
9a07c5c
Compare
Sounds good, thank you @facelessuser. Tell me if something else is needed |
.vscode/settings.json
Outdated
@@ -0,0 +1,5 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove .vscode/settings.json file. Feel free to exclude it from the repo via .gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, i'll push changes when we wil be ok with the /
There was actually no need to remove the |
Hi @facelessuser, I don't understand about the |
I was referring to the fact that you changed to For custom tasklists it is still setting |
All right, now I get it ! I'll fix it this evenning |
9a07c5c
to
806c82e
Compare
806c82e
to
00f503d
Compare
Ok, it's done |
Thanks, I'll try this out some time soon, but so far, everything looks good. |
My pleasure |
Went ahead and downloaded it. Everything looks in order. This will be in |
No description provided.