diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a190b23..3d7a8cc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,13 +23,34 @@ jobs: with: dotnet-version: 5.0.202 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + - name: Build shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd docs + npm i dotnet run --configuration Release + npm run build + + - name: Archive doc generation + uses: actions/upload-artifact@v2 + with: + name: documentation-output + path: docs/output/ + retention-days: 5 ################################################### # BUILD @@ -76,7 +97,7 @@ jobs: run: | dotnet tool restore dotnet cake - + - name: Upload Verify Test Results if: failure() uses: actions/upload-artifact@v2 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8f2efd9..8ee1dd4 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -26,10 +26,25 @@ jobs: with: dotnet-version: 5.0.202 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + - name: Publish shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd docs - dotnet run --configuration Release -- deploy + npm i + dotnet run --configuration Release + npm run build + dotnet run -- deploy diff --git a/.gitignore b/.gitignore index 8c56e1c..664051d 100644 --- a/.gitignore +++ b/.gitignore @@ -88,4 +88,6 @@ packages # Windows Thumbs.db -*.received.* \ No newline at end of file +*.received.* + +node_modules \ No newline at end of file diff --git a/docs/Docs.csproj b/docs/Docs.csproj index 19c7e42..e338448 100644 --- a/docs/Docs.csproj +++ b/docs/Docs.csproj @@ -31,7 +31,7 @@ - + diff --git a/docs/Program.cs b/docs/Program.cs index 33808e4..35e6669 100644 --- a/docs/Program.cs +++ b/docs/Program.cs @@ -19,6 +19,7 @@ namespace Docs .AddShortcode("Children", typeof(ChildrenShortcode)) .AddShortcode("ColorTable", typeof(ColorTableShortcode)) .AddShortcode("EmojiTable", typeof(EmojiTableShortcode)) + .AddShortcode("Alert", typeof(AlertShortcode)) .AddPipelines() .RunAsync(); diff --git a/docs/README.md b/docs/README.md index a7cfafe..c6a3fae 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,6 +14,12 @@ After the build is complete, you can navigate to [http://localhost:5080/spectre. **Note that the site runs under a virtual directory.** +## Building the CSS + +The documentation uses tailwind for the CSS. Committed to the repository is a large 4gb file with all possible styles at `assets/style.css`. This file is generated from the root files tailwind.config.js and tailwind.css. Any changes to the overall design style (e.g. colors, markdown styling, etc) can be made in these two files. + + For production, `npm run build:tailwind` should be ran post Statiq build. This process will look at all the styles in the HTML and prune the tailwind file down to a much more manageable 30kb or so file. + ## Editing Content The documentation is written using [Markdown](https://www.markdownguide.org/basic-syntax/). diff --git a/docs/input/_viewimports.cshtml b/docs/input/_ViewImports.cshtml similarity index 100% rename from docs/input/_viewimports.cshtml rename to docs/input/_ViewImports.cshtml diff --git a/docs/input/_viewstart.cshtml b/docs/input/_ViewStart.cshtml similarity index 100% rename from docs/input/_viewstart.cshtml rename to docs/input/_ViewStart.cshtml diff --git a/docs/input/_layout.cshtml b/docs/input/_layout.cshtml index 2cb4e2f..43b665d 100644 --- a/docs/input/_layout.cshtml +++ b/docs/input/_layout.cshtml @@ -1,256 +1,148 @@ - + - - - - + + + - - - - - - - - + + + @{ string title = @Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console"; + string description = @Document.ContainsKey(Constants.Description) ? Document.GetString(Constants.Description) : "Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications"; } @title + - -
- -