Browse Source

Include description in Introduction section.

shalvah 4 years ago
parent
commit
cb9c4a60d9
3 changed files with 9 additions and 5 deletions
  1. 5 4
      config/scribe.php
  2. 3 1
      resources/views/index.blade.php
  3. 1 0
      src/Writing/Writer.php

+ 5 - 4
config/scribe.php

@@ -8,7 +8,7 @@ return [
     'title' => null,
 
     /*
-     * A short description of your API.
+     * A short description of your API. Will be included in the docs webpage, Postman collection and OpenAPI spec.
      */
     'description' => '',
 
@@ -176,7 +176,7 @@ return [
      */
     'auth' => [
         /*
-         * Set this to true if any endpoints in your API uses authentication.
+         * Set this to true if any endpoints in your API use authentication.
          */
         'enabled' => false,
 
@@ -221,9 +221,10 @@ return [
      * Text to place in the "Introduction" section, right after the `description`. Markdown and HTML are supported.
      */
     'intro_text' => <<<INTRO
-Welcome to our API documentation!
+This documentation aims to provide all the information you need to work with our API.
 
-<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile), and you can switch the programming language of the examples with the tabs in the top right (or from the nav menu at the top left on mobile).</aside>
+<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
+You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
 INTRO
     ,
 

+ 3 - 1
resources/views/index.blade.php

@@ -4,6 +4,8 @@
 
 # Introduction
 
+{!! $description !!}
+
 {!! $introText !!}
 
 @if($isInteractive)
@@ -14,7 +16,7 @@
 <script src="js/tryitout.js"></script>
 @endif
 
-> Base URL:
+> Base URL
 
 ```yaml
 {!! $baseUrl !!}

+ 1 - 0
src/Writing/Writer.php

@@ -321,6 +321,7 @@ class Writer
         $introText = $this->config->get('intro_text', '');
         $introMarkdown = view('scribe::index')
             ->with('frontmatter', $frontmatter)
+            ->with('description', $this->config->get('description', ''))
             ->with('introText', $introText)
             ->with('baseUrl', $this->baseUrl)
             ->with('isInteractive', $this->config->get('interactive', true));