Browse Source

Rename md and blade templates

shalvah 4 years ago
parent
commit
624f8ecef5

+ 0 - 0
resources/views/markdown/authentication.blade.php → resources/views/markdown/auth.blade.php


+ 2 - 2
resources/views/themes/default/index.blade.php

@@ -70,9 +70,9 @@
 <div class="page-wrapper">
     <div class="dark-box"></div>
     <div class="content">
-        {!! $index !!}
+        {!! $intro !!}
 
-        {!! $authentication !!}
+        {!! $auth !!}
 
         @include("scribe::themes.default.groups")
 

+ 9 - 9
src/Extracting/ApiDetails.php

@@ -44,7 +44,7 @@ class ApiDetails
 
         $this->fetchFileHashesFromTrackingFile();
 
-        $this->writeIndexMarkdownFile();
+        $this->writeIntroMarkdownFile();
         $this->writeAuthMarkdownFile();
 
         $this->writeContentsTrackingFile();
@@ -53,28 +53,28 @@ class ApiDetails
     }
 
 
-    public function writeIndexMarkdownFile(): void
+    public function writeIntroMarkdownFile(): void
     {
-        $indexMarkdownFile = $this->markdownOutputPath . '/index.md';
-        if ($this->hasFileBeenModified($indexMarkdownFile)) {
+        $introMarkdownFile = $this->markdownOutputPath . '/intro.md';
+        if ($this->hasFileBeenModified($introMarkdownFile)) {
             if ($this->preserveUserChanges) {
-                ConsoleOutputUtils::warn("Skipping modified file $indexMarkdownFile");
+                ConsoleOutputUtils::warn("Skipping modified file $introMarkdownFile");
                 return;
             }
 
-            ConsoleOutputUtils::warn("Discarding manual changes for file $indexMarkdownFile because you specified --force");
+            ConsoleOutputUtils::warn("Discarding manual changes for file $introMarkdownFile because you specified --force");
         }
 
         $introMarkdown = view('scribe::markdown.intro')
             ->with('description', $this->config->get('description', ''))
             ->with('introText', $this->config->get('intro_text', ''))
             ->with('baseUrl', $this->baseUrl)->render();
-        $this->writeMarkdownFileAndRecordHash($indexMarkdownFile, $introMarkdown);
+        $this->writeMarkdownFileAndRecordHash($introMarkdownFile, $introMarkdown);
     }
 
     public function writeAuthMarkdownFile(): void
     {
-        $authMarkdownFile = $this->markdownOutputPath . '/authentication.md';
+        $authMarkdownFile = $this->markdownOutputPath . '/auth.md';
         if ($this->hasFileBeenModified($authMarkdownFile)) {
             if ($this->preserveUserChanges) {
                 ConsoleOutputUtils::warn("Skipping modified file $authMarkdownFile");
@@ -120,7 +120,7 @@ class ApiDetails
             $extraInfo = $this->config->get('auth.extra_info', '');
         }
 
-        $authMarkdown = view('scribe::markdown.authentication', [
+        $authMarkdown = view('scribe::markdown.auth', [
             'isAuthed' => $isAuthed,
             'authDescription' => $authDescription,
             'extraAuthInfo' => $extraInfo,

+ 4 - 4
src/Writing/HtmlWriter.php

@@ -27,8 +27,8 @@ class HtmlWriter
 
     public function generate(array $groupedEndpoints, string $sourceFolder, string $destinationFolder)
     {
-        $index = $this->transformMarkdownFileToHTML($sourceFolder . '/index.md');
-        $authentication = $this->transformMarkdownFileToHTML($sourceFolder . '/authentication.md');
+        $intro = $this->transformMarkdownFileToHTML($sourceFolder . '/intro.md');
+        $auth = $this->transformMarkdownFileToHTML($sourceFolder . '/auth.md');
 
         $appendFile = rtrim($sourceFolder, '/') . '/' . 'append.md';
         $append = file_exists($appendFile) ? $this->transformMarkdownFileToHTML($appendFile) : '';
@@ -38,8 +38,8 @@ class HtmlWriter
             'metadata' => $this->getMetadata(),
             'baseUrl' => $this->baseUrl,
             'tryItOut' => $this->config->get('try_it_out'),
-            'index' => $index,
-            'authentication' => $authentication,
+            'intro' => $intro,
+            'auth' => $auth,
             'groupedEndpoints' => $groupedEndpoints,
             'append' => $append,
         ])->render();

+ 1 - 1
tests/GenerateDocumentationTest.php

@@ -338,7 +338,7 @@ class GenerateDocumentationTest extends BaseLaravelTest
 
         $this->artisan('scribe:generate');
 
-        $authFilePath = '.scribe/authentication.md';
+        $authFilePath = '.scribe/auth.md';
         $group1FilePath = '.scribe/endpoints/0.yaml';
 
         $group = Yaml::parseFile($group1FilePath);