-
Notifications
You must be signed in to change notification settings - Fork 383
docs(lb4): reorganize current tutorial materials #601
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
Conversation
|
Right now, the big problem I see with this tutorial is that developers will need a REST client to test it out because we don't bundle a front-end with it. However, we pulled the static file server from the MVP, so I'm alright with keeping the tutorial as a back-end only affair for now, with a view to using a front-end in the tutorial before we release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't taken a detailed look, but is there a for us to see the diff between this and the README in the package itself? Also, do we know of a way somehow keep the tutorial updated as further updates are made to the example-getting-started repo? What I'm afraid of is that we'll always forget to update this page as changes to the example-getting-started packages are made.
| import {PingController} from './controllers/ping-controller'; | ||
| import {Class, Repository, RepositoryMixin} from '@loopback/repository'; | ||
|
|
||
| export class TodoApplication extends RepositoryMixin(Application) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please refactor the tutorial to use RestApplication? Refer to the latest master branch for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the README in this PR loopbackio/loopback-next#961, so you can just copy paste the diffs
| import {db} from './datasources/db.datasource'; | ||
| import {TodoRepository} from './repositories'; | ||
|
|
||
| export class TodoApplication extends RepositoryMixin(Application) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
_data/sidebars/lb4_sidebar.yml
Outdated
| - title: 'Examples and tutorials' | ||
| url: Examples-and-tutorials.html | ||
| - title: 'More examples and tutorials' | ||
| url: More-examples-and-tutorials.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break any pages referring to the old URL /More-examples-and-tutorials.html. Can we preserve the old URL please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reason for renaming this URL is that preserving the current name makes for some confusing UX.
The navbar ends up looking like this:
+ Tutorial
+ Examples and Tutorials
If we're going to separate them to distinguish between our default introductory tutorial and our other resources, we should make sure there's no confusion about what is what.
What if we rename the route to something like "Additional Learning"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other examples and tutorials?
Or rename the Tutorial to something else? e.g. step-by-step tutorial?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the URL does not necessarily have to be the same as the page title, e.g. we can have "More examples and tutorials" at lb4/Examples-and-tutorials.html. Although I agree it's better when they match each other.
The reason why I am concerned about this change is that my upcoming blog post is referring to Examples-and-tutorials.html URL and I'd rather avoid synchronization between landing my PR adding the blog post and this PR breaking old URLs.
On the second thought, I think we should simply leverage jekyll-redirect-from plugin that's already configured for loopback.io and add redirect from Examples-and-tutorials.html to More-examples-and-tutorials.html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making Examples and Tutorials a top level item listing all examples / tutorials including the Garden Path tutorial ... and under it the first item can be the Garden Path Tutorial. We can link directly to the Tutorial page from Getting-Started?
| @@ -0,0 +1,424 @@ | |||
| ## Making A Todo App | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the files in readmes are automatically fetched from GitHub, see http://loopback.io/doc/en/contrib/Including-READMEs.html and https://github.com/strongloop/loopback.io/blob/e26a44be2e910740a4eaea2927845b46812a2fd1/update-v4-readmes.sh.
IMO, you need to make these changes in our main monorepo - https://github.com/strongloop/loopback-next/blob/a2368cee598c131a826ee42e347266c6e25ae582/packages/example-getting-started/README.md
If you don't want this content to be fetched from example-getting-started's README, then please put the content to a different file.
Unless I am missing something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not exactly sure how it's supposed to work, but I know that the current template we use for transplanting the READMEs into the documents is currently hardcoded to path towards strongloop/{repo-name}, which won't work for our use-case. It looks like we're refreshing those doc pages by committing the updates here rather than scraping them dynamically, since we have a whole folder full of READMEs for those connectors in the loopback.io repository: https://github.com/strongloop/loopback.io/tree/gh-pages/pages/en/lb3/readmes
Sidenote: It also looks like many of them haven't been updated in forever; was this script run manually by Rand or someone else on a regular basis?
Regardless, I wouldn't expect there to already be something in place that copies READMEs over from lb4, and until there is, we need to make sure that there's something in place here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick addendum: I do think that figuring out an automatic refresh of these documents falls within MVP scope, but only if everyone agrees:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember some of the READMEs in LB3 got copied over to the official documentation. Not sure how easy/difficult to do that. Perhaps @bschrammIBM can help us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already fetching some READMEs from loopback-next repository, see #588 for an example how to do that, and also Raymond's recent PR #608 that's fixing some aspects of this process.
Sidenote: It also looks like many of them haven't been updated in forever; was this script run manually by Rand or someone else on a regular basis?
I believe there is a Jenkins pipeline (see Jenkinsfile in this repo) that is supposed to update README whenever they change. I think it's based on some GitHub web hooks, but I am not sure. @rmg could you please clarify?
Regardless, I wouldn't expect there to already be something in place that copies READMEs over from lb4, and until there is, we need to make sure that there's something in place here.
Uff, I am don't understand, could you please rephrase your sentence for more clarity?
Since we already have some tooling for including READMEs from loopback-next packages, I think we should leverage it for your work too, even if this process has flaws right now. At worst, you can run update-v4-readmes.sh manually to ensure the copy of example-getting-started's README is stored in this repo.
If you disagree and think this is more work that we want to invest for MVP, then please apply the second approach I proposed:
If you don't want this content to be fetched from example-getting-started's README, then please put the content to a different file.
I really don't want to create a situation when it looks like pages/en/lb4/readmes/example-getting-started.md is something that's supposed to be automatically mirroring content of example-getting-started/README.md, while it is not a mirror but a completely different content instead.
35c20d5 to
8926125
Compare
| url: Installation.html | ||
| output: 'web, pdf' | ||
|
|
||
| - title: 'Getting started' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we removing the Getting Started? I kind of like it though.
The garden path tutorial might be able to guide people through. But the Getting Started can at least quickly show what LB can do?
Not sure what you're planning for the tutorial. If it's simple enough for people to "Get started", i'm good with removing the getting started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to keeping Getting started as the page describing the process of ensure Node 8 + TypeScript is installed (does this need to be installed?), installing the CLI, and creating an app (Just show the built-in ping controller). A bare bones, I made a thing with LB4.
Tutorial imo then should go into a more complex app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Getting Started page can / should fold in the installation page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. just realize @virkt25 has the same comment! :)
see loopbackio/loopback-next#1004
_data/sidebars/lb4_sidebar.yml
Outdated
| - title: 'Examples and tutorials' | ||
| url: Examples-and-tutorials.html | ||
| - title: 'More examples and tutorials' | ||
| url: More-examples-and-tutorials.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other examples and tutorials?
Or rename the Tutorial to something else? e.g. step-by-step tutorial?
| @@ -0,0 +1,424 @@ | |||
| ## Making A Todo App | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember some of the READMEs in LB3 got copied over to the official documentation. Not sure how easy/difficult to do that. Perhaps @bschrammIBM can help us?
|
|
||
| Before we can begin, you'll need to make sure you have some things installed: | ||
|
|
||
| * [Node.js](https://nodejs.org/en/) at v6.x or greater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're dropping Node 6, it would be v8 or higher?
| Tutorial on building a simple application with LoopBack 4 key concepts. | ||
|
|
||
| - **[log-extension](https://github.com/strongloop/loopback-next/tree/master/packages/example-log-extension)**: | ||
| * **[log-extension](https://github.com/strongloop/loopback-next/tree/master/packages/example-log-extension)**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add headers for each one showing what the tutorial is for. ## Application, ## Extensions, ## Servers
This is a rework of the existing tutorial materials and layout. - Reorganize the current content under the "Examples and tutorials" section - Migrate all of the existing tutorials underneath this section - More clearly separate the "hello world" and "getting started" tutorials by renaming them and linking accordingly - Make use of the existing getting-started readme for the garden path tutorial
eedb7c5 to
bb86f04
Compare
|
The issue I have with the "Getting Started" section is that it conflicts with the IMO, we have two options:
Option B
I'm heavily leaning towards Option A in this case, even though it's a considerably larger effort because it:
Option B's obvious advantage is that we don't need to refactor code, but I think it isn't as clear as we'd like it to be and clarity should be our primary goal with any sort of tutorials or documentation! |
|
I'm for option 1 as well, reason being that the naming convention would actually reflect the repositories' purposes with that option. Additionally, I'm thinking that we rename the repo to |
|
+1 for Option A |
|
+1 to rename |
|
+1 on renaming and
Is the new todo tutorial the garden path tutorials? because i'm wondering what's so special of that tutorial that we need to make a new section instead of putting it on the same page. |
|
I don't have a strong opinion, I am happy to follow the crowd. |
|
Once loopbackio/loopback-next#1001 lands, I'll be able to refactor this PR to include the documentation from that package as individual pieces, and then wrap that content with appropriate links back and forth between them. |
| url: Hello-World.html | ||
| output: 'web, pdf' | ||
|
|
||
| - title: 'Getting Started' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually prefer Getting Started being at the top level. That's usually the first place to look when people are starting out.
|
Closing as no longer needed. |
connected to loopbackio/loopback-next#729
This is a rework of the existing tutorial materials and layout
that uses the example-getting-started materials as a starting
point for new users.
THIS IS STILL A WORK-IN-PROGRESS!
Feel free to review it anyway. :)