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

Refactor the field docs #193

Merged
merged 13 commits into from
Jan 23, 2024
Merged

Refactor the field docs #193

merged 13 commits into from
Jan 23, 2024

Conversation

Gallaecio
Copy link
Member

No description provided.

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Merging #193 (be4313e) into master (d783365) will increase coverage by 0.02%.
Report is 9 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   98.44%   98.46%   +0.02%     
==========================================
  Files          30       31       +1     
  Lines        1414     1437      +23     
==========================================
+ Hits         1392     1415      +23     
  Misses         22       22              

see 3 files with indirect coverage changes

@Gallaecio Gallaecio marked this pull request as ready for review December 19, 2023 08:38
@Gallaecio Gallaecio requested review from kmike, wRAR and BurnzZ December 19, 2023 08:38
docs/page-objects/items.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@BurnzZ BurnzZ left a comment

Choose a reason for hiding this comment

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

Looking much more organized! ✨

docs/page-objects/fields.rst Outdated Show resolved Hide resolved
docs/page-objects/fields.rst Outdated Show resolved Hide resolved
docs/page-objects/fields.rst Show resolved Hide resolved
docs/page-objects/items.rst Outdated Show resolved Hide resolved
@@ -24,11 +25,60 @@ class. For example:
Because itemadapter_ allows implementing support for arbitrary classes,
any kind of Python object can potentially work as an item.

Defining the item class of a page object class
==============================================
Copy link
Member

Choose a reason for hiding this comment

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

👍 for moving/adding these docs here

A field is a read-only property in a :ref:`page object class <page-objects>`
that is decorated with :meth:`@field <web_poet.fields.field>`, is named after a
key of the :ref:`item <items>` that the page object class returns, and returns
the value for that item key based on :ref:`inputs <inputs>`.
Copy link
Member

Choose a reason for hiding this comment

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

I found this paragraph a bit hard to read. I guess it starts with "..a read-only property in a page-objects
that is decorated with..", where it's not immediately clear if a property is decorated, or a page object is decorated, or if you should use Python's @property (which must be read-only), and decorate it with @field.

Would it be possible to re-phrase it? Using bullet points instead of many commas may also help.

Copy link
Member Author

Choose a reason for hiding this comment

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

What about 1b81268?

docs/page-objects/fields.rst Outdated Show resolved Hide resolved
@kmike
Copy link
Member

kmike commented Jan 18, 2024

Looks good overall!

@BurnzZ BurnzZ mentioned this pull request Jan 19, 2024
@kmike kmike merged commit 6c3c3b5 into scrapinghub:master Jan 23, 2024
16 checks passed
@kmike
Copy link
Member

kmike commented Jan 23, 2024

Thanks @Gallaecio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants