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

Make generated API reference its own top-level section #231

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xcambar
Copy link
Contributor

@xcambar xcambar commented Aug 26, 2018

Following up comments on #230
I gave a shot at working on moving API docs to their own top-level section.

This PR provides the following significant features:

  • zero-config API tab for the projects that have auto-generated API docs
  • A new API Reference section pointing to... well... the API reference
  • This link is not displayed when the project does not have API docs (useful for smaller addons)
  • The API reference is under /api instead of /docs/api
  • The navbar under /api and docs differ in their contents (I assumed it was expected, but IMO it gives much more readable structure)
  • The section of the navbar pointing to the API reference has disappeared from the navbar in /docs

⚠️ This PR does NOT provide tests, they'll be added if/once the feature set is agreed upon.

@samselikoff @pzuraq this should match your comments. Hope you'll like it. If so, this will close #230.

@xcambar
Copy link
Contributor Author

xcambar commented Aug 26, 2018

Here's the diff to be applied to ember-cli-mirage (see miragejs/ember-cli-mirage#1377) to benefit from this PR:

diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js
index 01b4a52..fc2c8c7 100644
--- a/tests/dummy/app/router.js
+++ b/tests/dummy/app/router.js
@@ -25,10 +25,6 @@ Router.map(function() {
       this.route('1-belongs-to');
       this.route('2-has-many');
     });
-
-    this.route('api', function() {
-      this.route('class', { path: '/:class_id' });
-    });
   });
 
   // this.route('contacts', { path: '/' });

So it's actually less code to be written by the developer 😄

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