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

Added mention of HTML5 fields in the docs #326

Merged
merged 1 commit into from
Jun 12, 2018
Merged

Conversation

Deathnerd
Copy link
Contributor

Per request of #275, adding the HTML5 fields to the Fields documentation

@davidism
Copy link
Member

davidism commented Mar 6, 2017

Looks like you used a different email than the one associated with your GitHub account. If you want to change that, you can use git commit --author "Name <email>" --amend then git push -f.

@Deathnerd
Copy link
Contributor Author

Thanks for that!

Copy link

@benasocj benasocj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you could please use the proper backtick notation in your change.

------------

In addition to basic HTML fields, WTForms also supplies fields for the HTML5
standard. These fields can be accessed under the `wtforms.fields.html5` namespace.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decorate `wtforms.fields.html5` as :mod:`wtforms.fields.html5` .

In addition to basic HTML fields, WTForms also supplies fields for the HTML5
standard. These fields can be accessed under the `wtforms.fields.html5` namespace.
In reality, these fields are just convenience fields that extend basic fields
and implement HTML5 specific widgets. These widgets are located in the `wtforms.widgets.html5`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use :mod: here as well.

namespace and can be overridden or modified just like any other widget.

.. autoclass:: SearchField(default field arguments)
Represents an `<input type="search">` field
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use `` instead of ` to decorate all HTML code.

Represents an `<input type="datetime-local">` field

.. autoclass:: IntegerField(default field arguments)
Represents an `<input type="number">` field with the `step="1"` attribute
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use `` instead of ` here and below for the HTML step attribute.

@Deathnerd
Copy link
Contributor Author

Thanks for the suggestions. I'll clean these up tomorrow and push them up

Copy link
Member

@davidism davidism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the classes already have docstrings, they shouldn't be copied into the docs, autoclass will take care of that.

@Deathnerd
Copy link
Contributor Author

Cool. I'm still learning how Sphinx works. Thanks for the heads up!

@Deathnerd
Copy link
Contributor Author

I'm having some issues with building. Sphinx doesn't seem to like the fact that these classes are in the html5 module. I would really like to continue using autoclass without messing up the module scope for the rest of the document. Thoughts?

@ftm
Copy link
Contributor

ftm commented Jun 12, 2018

@davidism, what are the changes that still need to be done to get this sorted? This seems like something that really should be in the docs so I'm happy to make the changes myself.

@ftm ftm added the enhancement New feature, or existing feature improvement label Jun 12, 2018
@davidism
Copy link
Member

Does it build? Looks fine otherwise.

@ftm ftm merged commit f85c9e2 into wtforms:master Jun 12, 2018
@ftm
Copy link
Contributor

ftm commented Jun 12, 2018

It didn't build, it needed a few changes so I made those and merged it in a separate PR #409 but it should also realise this has been merged too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, or existing feature improvement
Development

Successfully merging this pull request may close these issues.

4 participants