From 84a91e0b77529187f9e15b3a46e6c2a47e45e14b Mon Sep 17 00:00:00 2001
From: manandre <2341261+manandre@users.noreply.github.com>
Date: Tue, 10 Sep 2019 16:08:41 +0200
Subject: [PATCH 1/4] Create APIdoc generation project

---
 FollowingFileStream.APIdoc/.gitignore         |  9 +++
 .../FollowingFileStream.APIdoc.csproj         | 11 +++
 FollowingFileStream.APIdoc/api/.gitignore     |  5 ++
 FollowingFileStream.APIdoc/api/index.md       |  2 +
 FollowingFileStream.APIdoc/articles/intro.md  |  1 +
 FollowingFileStream.APIdoc/articles/toc.yml   |  2 +
 FollowingFileStream.APIdoc/docfx.json         | 69 +++++++++++++++++++
 FollowingFileStream.APIdoc/index.md           |  4 ++
 FollowingFileStream.APIdoc/toc.yml            |  5 ++
 9 files changed, 108 insertions(+)
 create mode 100644 FollowingFileStream.APIdoc/.gitignore
 create mode 100644 FollowingFileStream.APIdoc/FollowingFileStream.APIdoc.csproj
 create mode 100644 FollowingFileStream.APIdoc/api/.gitignore
 create mode 100644 FollowingFileStream.APIdoc/api/index.md
 create mode 100644 FollowingFileStream.APIdoc/articles/intro.md
 create mode 100644 FollowingFileStream.APIdoc/articles/toc.yml
 create mode 100644 FollowingFileStream.APIdoc/docfx.json
 create mode 100644 FollowingFileStream.APIdoc/index.md
 create mode 100644 FollowingFileStream.APIdoc/toc.yml

diff --git a/FollowingFileStream.APIdoc/.gitignore b/FollowingFileStream.APIdoc/.gitignore
new file mode 100644
index 0000000..4378419
--- /dev/null
+++ b/FollowingFileStream.APIdoc/.gitignore
@@ -0,0 +1,9 @@
+###############
+#    folder   #
+###############
+/**/DROP/
+/**/TEMP/
+/**/packages/
+/**/bin/
+/**/obj/
+_site
diff --git a/FollowingFileStream.APIdoc/FollowingFileStream.APIdoc.csproj b/FollowingFileStream.APIdoc/FollowingFileStream.APIdoc.csproj
new file mode 100644
index 0000000..6b7f108
--- /dev/null
+++ b/FollowingFileStream.APIdoc/FollowingFileStream.APIdoc.csproj
@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <PreviewOutputFolder>$(MSBuildProjectDirectory)\_site</PreviewOutputFolder>
+    <MetadataOutputFolder>$(MSBuildProjectDirectory)</MetadataOutputFolder>
+    <LogFile>$(MSBuildProjectDirectory)\bin\docfx.log.txt</LogFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="docfx.console" Version="2.45.0" PrivateAssets="All"/>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/FollowingFileStream.APIdoc/api/.gitignore b/FollowingFileStream.APIdoc/api/.gitignore
new file mode 100644
index 0000000..e8079a3
--- /dev/null
+++ b/FollowingFileStream.APIdoc/api/.gitignore
@@ -0,0 +1,5 @@
+###############
+#  temp file  #
+###############
+*.yml
+.manifest
diff --git a/FollowingFileStream.APIdoc/api/index.md b/FollowingFileStream.APIdoc/api/index.md
new file mode 100644
index 0000000..78dc9c0
--- /dev/null
+++ b/FollowingFileStream.APIdoc/api/index.md
@@ -0,0 +1,2 @@
+# PLACEHOLDER
+TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!
diff --git a/FollowingFileStream.APIdoc/articles/intro.md b/FollowingFileStream.APIdoc/articles/intro.md
new file mode 100644
index 0000000..c0478ce
--- /dev/null
+++ b/FollowingFileStream.APIdoc/articles/intro.md
@@ -0,0 +1 @@
+# Add your introductions here!
diff --git a/FollowingFileStream.APIdoc/articles/toc.yml b/FollowingFileStream.APIdoc/articles/toc.yml
new file mode 100644
index 0000000..ff89ef1
--- /dev/null
+++ b/FollowingFileStream.APIdoc/articles/toc.yml
@@ -0,0 +1,2 @@
+- name: Introduction
+  href: intro.md
diff --git a/FollowingFileStream.APIdoc/docfx.json b/FollowingFileStream.APIdoc/docfx.json
new file mode 100644
index 0000000..234562f
--- /dev/null
+++ b/FollowingFileStream.APIdoc/docfx.json
@@ -0,0 +1,69 @@
+{
+  "metadata": [
+    {
+      "src": [
+        {
+          "src": "../",
+          "files": [
+            "FollowingFileStream/**.cs"
+          ],
+          "exclude": [
+            "**/bin/**",
+            "**/obj/**"
+          ]
+        }
+      ],
+      "dest": "api",
+      "disableGitFeatures": false,
+      "disableDefaultFilter": false
+    }
+  ],
+  "build": {
+    "content": [
+      {
+        "files": [
+          "api/**.yml",
+          "api/index.md"
+        ]
+      },
+      {
+        "files": [
+          "articles/**.md",
+          "articles/**/toc.yml",
+          "toc.yml",
+          "*.md"
+        ]
+      }
+    ],
+    "resource": [
+      {
+        "files": [
+          "images/**"
+        ]
+      }
+    ],
+    "overwrite": [
+      {
+        "files": [
+          "apidoc/**.md"
+        ],
+        "exclude": [
+          "obj/**",
+          "_site/**"
+        ]
+      }
+    ],
+    "dest": "_site",
+    "globalMetadataFiles": [],
+    "fileMetadataFiles": [],
+    "template": [
+      "default"
+    ],
+    "postProcessors": [],
+    "markdownEngineName": "markdig",
+    "noLangKeyword": false,
+    "keepFileLink": false,
+    "cleanupCacheHistory": false,
+    "disableGitFeatures": false
+  }
+}
\ No newline at end of file
diff --git a/FollowingFileStream.APIdoc/index.md b/FollowingFileStream.APIdoc/index.md
new file mode 100644
index 0000000..3ae2506
--- /dev/null
+++ b/FollowingFileStream.APIdoc/index.md
@@ -0,0 +1,4 @@
+# This is the **HOMEPAGE**.
+Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
+## Quick Start Notes:
+1. Add images to the *images* folder if the file is referencing an image.
diff --git a/FollowingFileStream.APIdoc/toc.yml b/FollowingFileStream.APIdoc/toc.yml
new file mode 100644
index 0000000..59f8010
--- /dev/null
+++ b/FollowingFileStream.APIdoc/toc.yml
@@ -0,0 +1,5 @@
+- name: Articles
+  href: articles/
+- name: Api Documentation
+  href: api/
+  homepage: api/index.md

From ef72635487e268a7d6b5c6be18541ef539152d94 Mon Sep 17 00:00:00 2001
From: manandre <2341261+manandre@users.noreply.github.com>
Date: Tue, 10 Sep 2019 16:18:06 +0200
Subject: [PATCH 2/4] Update azure-pipelines.yml for apidoc website generation

---
 azure-pipelines.yml | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 112f9ec..ae522dd 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -147,3 +147,37 @@ jobs:
           PathtoPublish: '$(Build.ArtifactStagingDirectory)/sourcebrowser_website.zip'
           ArtifactName: 'sourcebrowser_website'
           publishLocation: 'Container'
+
+  - job: api-doc
+    displayName: API Documentation generation
+    pool:
+        vmImage: 'windows-latest'
+    steps:
+      - task: DotNetCoreCLI@2
+        displayName: Restore
+        inputs:
+          command: 'restore'
+          projects: '**/*.APIdoc.csproj'
+          feedsToUse: 'select'
+
+      - task: DotNetCoreCLI@2
+        displayName: Build
+        inputs:
+          command: 'build'
+          projects: '**/*.APIdoc.csproj'
+          arguments: '--configuration $(BuildConfiguration)'
+
+      - task: ArchiveFiles@2
+        displayName: Zip API documentation website
+        inputs:
+          rootFolderOrFile: '$(Build.SourcesDirectory)/FollowingFileStream.APIdoc/_site'
+          includeRootFolder: false
+          archiveType: 'zip'
+          archiveFile: '$(Build.ArtifactStagingDirectory)/apidoc_website.zip'
+          replaceExistingArchive: true
+        
+      - task: PublishBuildArtifacts@1
+        inputs:
+          PathtoPublish: '$(Build.ArtifactStagingDirectory)/apidoc_website.zip'
+          ArtifactName: 'apidoc_website'
+          publishLocation: 'Container'
\ No newline at end of file

From 7950d1be0ed4b415336e4dc8a5a5e4daa02cc0bc Mon Sep 17 00:00:00 2001
From: manandre <2341261+manandre@users.noreply.github.com>
Date: Tue, 10 Sep 2019 16:19:42 +0200
Subject: [PATCH 3/4] Update azure-pipelines.yml for apidoc job name

---
 azure-pipelines.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index ae522dd..551cbd0 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -148,7 +148,7 @@ jobs:
           ArtifactName: 'sourcebrowser_website'
           publishLocation: 'Container'
 
-  - job: api-doc
+  - job: ApiDoc
     displayName: API Documentation generation
     pool:
         vmImage: 'windows-latest'

From a3cb833def5cf4e81bb7557890b82e31590af9c5 Mon Sep 17 00:00:00 2001
From: manandre <2341261+manandre@users.noreply.github.com>
Date: Tue, 10 Sep 2019 17:32:30 +0200
Subject: [PATCH 4/4] Update README.md with API Documentation link

---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index e1cf3f3..adb2bde 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,8 @@ Any read operation will not report a zero result while the file is locked for wr
 
 It is usually compared to the "tail -f" approach.
 
+[API Documentation](https://followingfilestream.azurewebsites.net/api-doc)
+
 [Source Browser](https://followingfilestream.azurewebsites.net/#FollowingFileStream/)
 
 [![Build Status](https://dev.azure.com/manandre/manandre/_apis/build/status/manandre.FollowingFileStream?branchName=master)](https://dev.azure.com/manandre/manandre/_build/latest?definitionId=1&branchName=master)
