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

Prepping searching code doc #955

Merged
merged 2 commits into from
Nov 3, 2015
Merged

Conversation

hahmed
Copy link
Contributor

@hahmed hahmed commented Oct 31, 2015

Searching tha code docs.

In = new[] { CodeInQualifier.File },

// or we can search the file and the path too
In = new[] { CodeInQualifier.File, CodeInQualifier.Path },

Choose a reason for hiding this comment

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

I would prefer code that would compile. This one will fail to compile because there is duplication of In

Copy link
Member

Choose a reason for hiding this comment

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

👍 I think we should keep this second line around instead of both

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@naveensrinivasan
Copy link

var request = new SearchCodeRequest("auth")
{
    // maybe we want to restrict the search to the file only
    In = new[] { CodeInQualifier.File },


    // how about we find a file based on a certain language
    Language = Language.JavaScript,

    // do we want to search forks too?
    Forks = true,

    // find files that are above 1000 bytes
    Size = Range.GreaterThan(1000),

    // we may want to restrict the search to the path of a file
    Path = "app/assets",

    // we may want to restrict the file based on file extension
    Extension = "json",

    // restrict search to a specific file name
    FileName = "app.json",

    // search within a users or orgs repo
    User = "dhh"
};

The above sample does not produce a result. My two cents we should have a sample that produces some result.

@hahmed
Copy link
Contributor Author

hahmed commented Nov 1, 2015

Granted it does not compile, however documentation is generally letting the user know how to use the api in a more digestible way. I see the docs as complementing the code and tests.

There have been too many times where I do not have a clue about a library, I simply want to pick up an example that just works. I do agree that maybe after each feature we have a working example? Or simply a few working examples in it's own tab?

cc/ @shiftkey

@shiftkey
Copy link
Member

shiftkey commented Nov 2, 2015

My two cents we should have a sample that produces some result.

I think this is a nice goal, but perhaps we can address this elsewhere - with more interactive or detailed examples? For these sections, we should be focusing on understanding the API options available.

@shiftkey
Copy link
Member

shiftkey commented Nov 3, 2015

Thanks!

shiftkey added a commit that referenced this pull request Nov 3, 2015
@shiftkey shiftkey merged commit 5c5f759 into octokit:documentation Nov 3, 2015
@hahmed hahmed deleted the docs-search-code branch November 4, 2015 09:29
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.

3 participants