Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25256 closed enhancement (fixed)

Docs standards for Bundled Themes

Reported by: drewapicture's profile DrewAPicture Owned by: lancewillett's profile lancewillett
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description (last modified by DrewAPicture)

With the inline docs standards now in place, we need to bring the bundled themes up to standard. I've attached patches for Twenties Twelve and Thirteen. Do we need to do Twenties Ten and Eleven?

Twenty Fourteen will get its own docs review (#25257) when it's closer to release in 3.8.

Attachments (15)

twentytwelve.diff (23.7 KB) - added by DrewAPicture 11 years ago.
twentythirteen.diff (30.7 KB) - added by DrewAPicture 11 years ago.
twentytwelve.2.diff (24.0 KB) - added by DrewAPicture 11 years ago.
twentythirteen.2.diff (30.3 KB) - added by DrewAPicture 11 years ago.
twentyeleven.diff (48.1 KB) - added by DrewAPicture 11 years ago.
twentyten.diff (29.4 KB) - added by DrewAPicture 11 years ago.
twentyten.2.diff (13.9 KB) - added by ericlewis 11 years ago.
twentyeleven.2.diff (12.9 KB) - added by ericlewis 11 years ago.
twentytwelve.3.diff (6.0 KB) - added by ericlewis 11 years ago.
twentythirteen.3.diff (5.7 KB) - added by ericlewis 11 years ago.
twentyfourteen.diff (1.2 KB) - added by ericlewis 11 years ago.
twentytwelve.4.diff (4.9 KB) - added by DrewAPicture 11 years ago.
twentythirteen.4.diff (4.4 KB) - added by DrewAPicture 11 years ago.
twentyten.3.diff (11.7 KB) - added by ericlewis 11 years ago.
twentyeleven.3.diff (10.2 KB) - added by ericlewis 11 years ago.

Download all attachments as: .zip

Change History (44)

#1 @DrewAPicture
11 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
11 years ago

  • Component changed from Inline Docs to Bundled Theme

#3 follow-up: @obenland
11 years ago

Hey Drew, thanks for that. A couple of notes:

The short description of functions should always end with a period.

In twentytwelve.diff:

  • Can we update the docs, so that //duplicate_hook gets a space between the slashes and the word? Or would that break parsing? Looks ugly.
  • In content-status.php: Filter says int, but passes a (legacy) string, we should change that to an int.
  • In image.php: Would it satisfy the filter doc guidelines to not have the array passed as an argument to the filter, but still document the specific values? I understand that this is how the example in the guidelines work, but we should just omit the variable name in the documentation, IMO. (Same for Twenty Thirteen)

In twentythirteen.diff:

  • In functions.php: Is it the Customizer or the Theme Customizer?

#4 in reply to: ↑ 3 @DrewAPicture
11 years ago

Replying to obenland:

Hey Drew, thanks for that. A couple of notes:

The short description of functions should always end with a period.

Yeah, I think that may have still been up in the air when I did the patch. I'll fix it.

In twentytwelve.diff:

  • Can we update the docs, so that //duplicate_hook gets a space between the slashes and the word? Or would that break parsing? Looks ugly.

Needs to stay that way to as @nacin put it, make it "grep-able", besides, the parser, etc.

  • In content-status.php: Filter says int, but passes a (legacy) string, we should change that to an int.

Will do.

  • In image.php: Would it satisfy the filter doc guidelines to not have the array passed as an argument to the filter, but still document the specific values? I understand that this is how the example in the guidelines work, but we should just omit the variable name in the documentation, IMO. (Same for Twenty Thirteen)

I'll take a look.

In twentythirteen.diff:

  • In functions.php: Is it the Customizer or the Theme Customizer?

We should probably pick one. Is there an "official" name for it? Theme Customizer?

#5 @DrewAPicture
11 years ago

twentytwelve.2.diff incorporates fixes from comment:3

  • Converted string value to int in the filter in content-status.php
  • Passed the array of height/width values to the filter instead of a named variable
  • Standardized "Theme Customizer" to just "Customizer"

twentythirteen.2.diff incorporates fixes from comment:3

  • Passed the array of height/width values to the filter instead of a named variable
  • Standardized "Theme Customizer" to just "Customizer"

#6 @lancewillett
11 years ago

  • Cc lancewillett added

#7 follow-up: @obenland
11 years ago

Thanks for the update Drew. I think the only things missing are the periods that should not be removed.

#8 in reply to: ↑ 7 ; follow-up: @DrewAPicture
11 years ago

Replying to obenland:

Thanks for the update Drew. I think the only things missing are the periods that should not be removed.

Good call. I must've generated these in limbo between making that decision for the standards. I'll regenerate the patches.

#9 in reply to: ↑ 8 ; follow-up: @DrewAPicture
11 years ago

Replying to DrewAPicture:

Replying to obenland:

Thanks for the update Drew. I think the only things missing are the periods that should not be removed.

Good call. I must've generated these in limbo between making that decision for the standards. I'll regenerate the patches.

Actually, I take that back. File header short descriptions don't get periods. I thought you were referring to function descriptions.

#10 in reply to: ↑ 9 ; follow-up: @obenland
11 years ago

Replying to DrewAPicture:

File header short descriptions don't get periods. I thought you were referring to function descriptions.

I'm sorry, but where is the logic in that? File headers don't but, function descriptions do?

#11 in reply to: ↑ 10 @nacin
11 years ago

Replying to obenland:

Replying to DrewAPicture:

File header short descriptions don't get periods. I thought you were referring to function descriptions.

I'm sorry, but where is the logic in that? File headers don't but, function descriptions do?

WordPress uses file descriptions as a headline or title, like "Bookmark Administration Functions". Function descriptions should be a complete sentence.

#12 @DrewAPicture
11 years ago

  • Keywords commit added

#13 @lancewillett
11 years ago

In 25521:

Twenty Twelve: update code comments to reflect WP inline docs standards. Props DrewAPicture, see #25256.

#14 @lancewillett
11 years ago

Looks like in the second Thirteen patch an extra closing parenthesis was added accidentally, see twentythirteen_the_attached_image:

$attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) ) );

#15 @lancewillett
11 years ago

In 25522:

Twenty Thirteen: update code comments to reflect WP inline docs standards. Props DrewAPicture, see #25256.

#16 in reply to: ↑ description ; follow-ups: @lancewillett
11 years ago

Replying to DrewAPicture:

Do we need to do Twenties Ten and Eleven?

Sure, let's do back to Twenty Ten.

#17 in reply to: ↑ 16 @DrewAPicture
11 years ago

Replying to lancewillett:

Replying to DrewAPicture:

Do we need to do Twenties Ten and Eleven?

Sure, let's do back to Twenty Ten.

OK. I'll work on those this weekend.

#18 in reply to: ↑ 16 @DrewAPicture
11 years ago

  • Keywords commit removed

Replying to lancewillett:

Replying to DrewAPicture:

Do we need to do Twenties Ten and Eleven?

Sure, let's do back to Twenty Ten.

See twentyten.diff and twentyeleven.diff.

#19 @lancewillett
11 years ago

In 25625:

Twenty Eleven: update code comments to reflect WP inline docs standards. Props DrewAPicture, see #25256.

#20 @lancewillett
11 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 25627:

Twenty Ten: update code comments to reflect WP inline docs standards. Props DrewAPicture, closes #25256.

#22 @ericlewis
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#23 follow-ups: @johnbillion
11 years ago

Why is the standard for a multiline comment different from the standard for a file header or a function docblock?

#24 @johnbillion
11 years ago

  • Type changed from defect (bug) to enhancement

#25 in reply to: ↑ 23 @DrewAPicture
11 years ago

Replying to johnbillion:

Why is the standard for a multiline comment different from the standard for a file header or a function docblock?

Blocks starting with /* won't be parsed as a docblock.

#26 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 25746:

Default themes: Don't use / docblocks for simple multiline comments.

props DrewAPicture, ericlewis.
fixes #25256.

#27 in reply to: ↑ 23 @GaryJ
11 years ago

Replying to johnbillion:

Why is the standard for a multiline comment different from the standard for a file header or a function docblock?

See https://gist.github.com/GaryJones/1ed130dcc0cdb025af0f#inline-comments for a little more explanation.

#28 @nacin
11 years ago

In 25908:

Translator comments are special, make sure they are parsed properly. see #25256.

#29 @nacin
11 years ago

In 25909:

Translator comments are special, make sure they are parsed properly. see #25256, for the 3.7 branch.

Note: See TracTickets for help on using tickets.