-
Notifications
You must be signed in to change notification settings - Fork 605
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
Update overviews with more detailed code #1084
Comments
I think this sounds like https://github.com/GoogleCloudPlatform/gcloud-common/issues/33#issuecomment-164104675 -- does the structure explained in that post align with the goals of this issue? |
@jgeewax I think this came up before and we moved it to https://github.com/GoogleCloudPlatform/gcloud-common/issues/41. Is node the only one who is experiencing this problem? If so, we could probably just add more examples to the constructor documentation.. otherwise we'll need a cross library solution. @stephenplusplus the guides idea never really went anywhere (but I still think it is a great idea) and I have a feeling it would probably take a little while to actually get that implemented. |
I think to implement this idea, it would be the same solution; versioned markdown files that live with the JSON output. I don't think a static |
Per our spec, we actually have a field for an overview. Currently in node we didn't really have anything to populate it with (because we were using the static html files) but assuming we could find a way to finagle it in, this might be a fairly simple task.. |
Ah, cool. So this is how I see the navbar being re-structured:
Does this force other changes on the JSON? |
s/API/Overview/ ? API doesnt' really say "tell me about it in a non-scary
way")
|
The bullets under "API" aren't overviews, they are all API docs. Clicking the top-most "Datastore" ( |
I don't think so, since we've agreed to go to a multi file approach then, we were going to need a table of contents JSON file to map the navigation to documentation JSON files.. (shaking up the navigation would then only be a config change) There would be some change in generating the files, but I don't think it would be anything crazy. Our real problem is figuring out where to store the overview section. |
Will the JSON be able to include headings/dividers?: {
nav: [
{
title: "Datastore",
contents: "overview.md"
},
{
title: "API",
contents: [
{ title: "Datastore", contents: "datastore.json" },
{ title: "Dataset", contents: "dataset.json" },
{ title: "Query", contents: "query.json" },
{ title: "Transaction", contents: "transaction.json" }
]
}
]
} Or should we just force the hierarchy from my earlier post and just let the front end decide where to put things based on file type: {
nav: [
{ title: "Datastore", contents: "overview.md" },
{ title: "Datastore", contents: "datastore.json" }, // FE sees a JSON file, automatically considers it API docs
{ title: "Dataset", contents: "dataset.json" }, // FE sees a JSON file, automatically considers it API docs
{ title: "Query", contents: "query.json" }, // FE sees a JSON file, automatically considers it API docs
{ title: "Transaction", contents: "transaction.json" } // FE sees a JSON file, automatically considers it API docs
]
} |
I was actually thinking somewhere in the middle {
nav: [
{
title: 'Datastore',
overview: 'datastore.md',
contents: [
{
title: 'Query',
contents: 'query.json'
}
]
}
]
} |
Oops, forgot to nest an extra level. Just so we have an even comparison, here's my updated proposal: {
nav: [
{
title: "Datastore",
contents: "overview.md",
nav: [
{
title: "API",
nav: [
{ title: "Datastore", contents: "datastore.json" },
{ title: "Dataset", contents: "dataset.json" },
{ title: "Query", contents: "query.json" },
{ title: "Transaction", contents: "transaction.json" }
]
}
]
}
]
} The reason I like this approach is the ability to expand if we want extra overview files (like ones for Dataset, Query, etc): {
nav: [
{
title: "Datastore",
contents: "overview.md",
nav: [
{ title: "Dataset", contents: "dataset.md" },
{ title: "Query", contents: "query.md" },
{ title: "Transaction", contents: "transaction.md" },
{
title: "API",
nav: [
{ title: "Datastore", contents: "datastore.json" },
{ title: "Dataset", contents: "dataset.json" },
{ title: "Query", contents: "query.json" },
{ title: "Transaction", contents: "transaction.json" }
]
}
]
}
]
} |
Got it, I totally dig that schema. I actually really like the separation between overviews and API docs as well.. reminds me of something we'd see upstream. I really only see a few issues with this approach
|
Yeah, but I think anything is better than nothing. And if it's so simple that having a dedicated page just for it doesn't make sense, it can also go on the parent overview page.
Definitely. But using .md files lets us merge words and code in a way that is the most easy to contribute to.
Docs as close to the code as possible is the best, but there's no way around the distance this time :\ |
I agree, I think the benefits outweigh the cons here for sure.. @jgeewax thoughts? |
👍 |
@callmehiphop is this still relevant? I'm not sure of all that has evolved with the docs since we talked about this. Is it yet just a matter of us writing up some overview sections in MD files, or will this require more changes? |
Just to clarify, the Ruby guys did a pretty nice job here:
I wonder though if we can write a single "article" (markdown) with included snippets where only the language changes... and then we'd basically have a mapping of sorts... tasks = [{
"service": "bigquery",
"language": "node",
"task": "datasets/list",
"snippet": "<some spec pointing to a snippet of code somehow>"
},
...
] |
@stephenplusplus Just bumping this back up. I went to the Datastore page on gcloud-node (https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.30.1/datastore) and was sad. I then went to the page for gcloud-ruby (http://googlecloudplatform.github.io/gcloud-ruby/#/docs/v0.7.2/gcloud/datastore), and was really happy... Any idea when we can crank this out ? Maybe @pcostell can help us point to a bunch of "tasks" that need to be documented, and we can then start pulling together some prose (shared) with some snippets (specific to a language) ? |
I think we're just trying to figure out how the do this from a technical standpoint. The quickest resolution would be putting a bunch of HTML in the |
I believe the ruby team actually just dumps a bunch of HTML in their description tags. So we could definitely follow suit with some thing like this, or else treat all description fields as markdown, etc. |
Took a shot at this in #1231 -- ptal! |
@stephenplusplus, this has not been active since 2016. What's the current state on this? |
I'm not sure this is still relevant. If anything we may want to address any clients where we did write an overview since they did not transition to the cloud site very well, e.g. Bigtable (scroll to the examples) |
I'm going to go ahead and close this out for now. |
autoAck
demonstration)Right now, clicking on a service (ie, Datastore) in the docs brings me to a page that has a brief overview and then the stuff that happens to be at the top level (like...
int
anddouble
).Can we restructure this a smidge?
double
andint
somewhere else (at least in the docs?)On this page, I'm really not looking for such a low-level detail, I'm looking for high-level stuff. If I want to get an idea of how to store special types, I'd be looking for a like to "Types" or something along those lines.
301
in that it says "you really want thedataset
result... take a look at that". Can we make this act as a more friendly and (somewhat) comprehensive overview? Basically "here's the typical use case for [service], and how you write code to do it".For example, with Datastore:
"""
The
gcloud.datastore
object gives you some convenience methods, as well as exposes adataset
function. This will allow you to create adataset
, which is the object from which you will interact with the Google Cloud Datastore.The basic flow is:
Establish a connection to Cloud Datastore:
(Now that you have a
dataset
reference, take a look at the [link to dataset docs])Add a
TodoItem
entity (if you don't know what an entity is, click here [link to entity concept on cloud.google.com]):Retrieve your entity by it's key (if you don't know what a key is, click here [link to key concept on cloud.google.com]):
The other things you might want to do are:
"""
(And remember -- these code snippets must be tested so that if our code would break them, the tests fail. We can't have docs out there that don't work...)
The text was updated successfully, but these errors were encountered: