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

Used by and Uses information should be parsed #79

Closed
smckeown opened this issue Mar 19, 2014 · 6 comments
Closed

Used by and Uses information should be parsed #79

smckeown opened this issue Mar 19, 2014 · 6 comments

Comments

@smckeown
Copy link
Contributor

On the code reference we want to displayed used by and uses information. Example here: http://developer.rarst.net/reference/functions/

This information will need to be parsed so that we can display it in the theme.

@JDGrimes
Copy link
Contributor

All docblock information is already parsed and imported. The docblock tags for a post can be retrieved like this:

$doc_tags = get_post_meta( get_the_ID(), '_wpapi_tags', true );
$uses = wp_list_filter( $doc_tags, array( 'name' => 'uses' ) );
$used_by = wp_list_filter( $doc_tags, array( 'name' => 'used-by' ) );

Or, were you thinking that we would supplement this with data extracted from the source code, not just what is noted in the docblocks?

@Rarst
Copy link
Contributor

Rarst commented Mar 19, 2014

Yes, the previous talk was about making this more (much more) thorough with information from source. Not much on technical side had been suggested/decided so far though.

For example this seems suited to be post relationships, but we hadn't had them before and not decided on maybe using plugin as dependency yet.

@JDGrimes
Copy link
Contributor

Parsing and exporting this data is relatively trivial, it sounds like the main issue is how it should be imported.

For example this seems suited to be post relationships, but we hadn't had them before and not decided on maybe using plugin as dependency yet.

That would limit it to only other structures defined by the parsed source, correct? That is probably not a problem for the devhub project (which is the main concern here at present), but there is also the possibility that we want to show "uses" links to functions outside the main source (PHP core functions, or WP core functions from plugin docs). I suppose they could be stored separately if needed though.

If we decide against post relationships, I guess the alternative would be post meta? We could save each of the functions used as separate entries, but with the same key. That would make it possible to query for both the used and used-by functions easily (though likely not as efficiently as with post relationships).

@Rarst
Copy link
Contributor

Rarst commented Oct 28, 2014

@atimmer can you please confirm that your pull covers and resolves the scope of this issue?

@atimmer
Copy link
Member

atimmer commented Oct 28, 2014

All usage is captured in post relations right now, there are still some improvements possible with method calling but these are edge cases.

@Rarst
Copy link
Contributor

Rarst commented Oct 28, 2014

Thank you closing this big item, refining via new issues as necessary. :)

@Rarst Rarst closed this as completed Oct 28, 2014
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

4 participants