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

Wrapping the_content function within a div #4

Closed
grayghostvisuals opened this issue Mar 2, 2013 · 8 comments
Closed

Wrapping the_content function within a div #4

grayghostvisuals opened this issue Mar 2, 2013 · 8 comments

Comments

@grayghostvisuals
Copy link
Owner

Wrapping the_content within a div

@chrisvanpatten says

It's a good idea to wrap content in its own element to help Pocket/Readability/Instapaper-style apps. Helps parsers pickup content easier.

Readability Article Publishing Guidelines
http://www.readability.com/developers/guidelines

hNews Examples - Work in Progress
http://microformats.org/wiki/hnews-examples

@AndyStaple
Copy link
Collaborator

I suppose it is a good idea in the sense of feed readers, but adding full hNews microformat support adds a ton of bad-semantic class tags and additional markup. In Paul's specific case via twitter I think especially when starting out having people use less code vs more is beneficial when learning first hand.

I did just test and both readability and instapaper pull the data in fine without a div around the_content, but that doesn't mean all of them will.

@grayghostvisuals
Copy link
Owner Author

I have to say I agree with what @AndyStaple describes above and I know @chrisvanpatten has his points with a div, but Microformats are solely based on semantic classes and have nothing to do with the markup itself (i.e. vCard). Maybe instead of a div we could simply use a section to group related content (which can be nested inside an article). BTW I don't really care what Instapaper or Readability does as long as there is a standard behind the method.

My Proposal

<section class="entry-content">
    <?php the_content(); ?>
</section>

The "entry-content" class denotes what part of the article is the body content.

Also via Microformats:

hNews 0.1
This document represents a draft microformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the microformats-new mailing list to stay up-to-date.

@chrisvanpatten
Copy link
Collaborator

I don't think the tag you choose matters necessarily, just the fact that there is one. Let the record show I wasn't arguing in favor of a div specifically.

(I think there are arguments to be made in favor of the div here, but that is less important. section is probably just as good... Frankly, I think section is just as meaningful (or meaningless) as div anyway, but that's a personal gripe with the HTML5 spec.)

@chrisvanpatten
Copy link
Collaborator

Also, @AndyStaple — I've noticed issues w/ Amazon's Website-to-Kindle parser when you don't have a div around the content. It's sporadic, but it's there.

@grayghostvisuals
Copy link
Owner Author

This is a great discussion guys! 🍻

@AndyStaple
Copy link
Collaborator

Good info on the Kindle issue, one of the gadgets I don't have on hand to test with.

The div may actually be the most sensical element to put around the content if it does need one for Kindle (and possibly others). I agree that the section documentation is muddy at best but I do like the write up HTML5Doctors gave. Basically, try to only use it when it has a corresponding heading. http://html5doctor.com/the-section-element/

@grayghostvisuals
Copy link
Owner Author

I too think the section tag can me very mysterious but HTML5 Doctor does explain this well. Here is the current WHATWG spec for reference. Sounds like the div is the solution as Chris stated originally.

http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-section-element

@grayghostvisuals
Copy link
Owner Author

It's fixed! thanks @AndyStaple and @chrisvanpatten you guys rawck! 🤘

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

No branches or pull requests

3 participants