diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c0a1d0e..9f99bef 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,8 +5,7 @@ on: branches: [master, develop] paths: - 'docs/**' - - 'src/**/*.cs' - - 'src/**/*.csproj' + - 'mkdocs.yml' - '.github/workflows/docs.yml' workflow_dispatch: @@ -28,21 +27,21 @@ jobs: with: fetch-depth: 0 - - name: Setup .NET - uses: actions/setup-dotnet@v4 + - name: Setup Python + uses: actions/setup-python@v5 with: - dotnet-version: 8.x + python-version: '3.x' - - name: Install DocFX - run: dotnet tool install -g docfx + - name: Install MkDocs Material + run: pip install mkdocs-material - name: Build docs - run: docfx docs/docfx.json + run: mkdocs build --strict - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: docs/_site + path: site deploy: environment: diff --git a/.gitignore b/.gitignore index a1a4498..5b39ba7 100644 --- a/.gitignore +++ b/.gitignore @@ -290,3 +290,4 @@ __pycache__/ settings.local.json examples/**/output +site/ diff --git a/docs/.gitignore b/docs/.gitignore index 0a8ff9f..8b13789 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,6 +1 @@ -_site/ -api/.manifest -api/*.yml -api/*.md -!api/index.md -obj/ + diff --git a/docs/articles/advanced-features.md b/docs/advanced-features.md similarity index 90% rename from docs/articles/advanced-features.md rename to docs/advanced-features.md index c535aff..0848fa8 100644 --- a/docs/articles/advanced-features.md +++ b/docs/advanced-features.md @@ -1,6 +1,9 @@ # Advanced Features -> **Examples:** [Webhook](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/Webhook), [UrlsToMergedPdf](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/UrlsToMergedPdf), [DIExample](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/DIExample) +!!! example "Working Examples" + [Webhook](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/Webhook) | + [UrlsToMergedPdf](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/UrlsToMergedPdf) | + [DIExample](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/DIExample) ## Webhooks diff --git a/docs/api/index.md b/docs/api/index.md deleted file mode 100644 index d8f8c7b..0000000 --- a/docs/api/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# API Reference - -This section contains auto-generated API documentation from the source code XML comments. - -Browse the namespace tree on the left to explore all public types, methods, and properties. diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml deleted file mode 100644 index 4c03ceb..0000000 --- a/docs/articles/toc.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: Getting Started - href: getting-started.md -- name: HTML & URL to PDF - href: html-and-url-to-pdf.md -- name: Screenshots - href: screenshots.md -- name: Office Document Conversion - href: office-conversion.md -- name: PDF Manipulation - href: pdf-manipulation.md -- name: Advanced Features - href: advanced-features.md diff --git a/docs/docfx.json b/docs/docfx.json deleted file mode 100644 index d2d3769..0000000 --- a/docs/docfx.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "metadata": [ - { - "src": [ - { - "files": ["**/*.csproj"], - "src": "../src" - } - ], - "dest": "api", - "properties": { - "TargetFramework": "net8.0" - } - } - ], - "build": { - "content": [ - { - "files": ["api/**/*.yml", "api/index.md"] - }, - { - "files": [ - "articles/**/*.md", - "articles/**/toc.yml", - "toc.yml", - "*.md" - ] - } - ], - "resource": [ - { - "files": ["images/**"] - } - ], - "output": "_site", - "template": ["default", "modern"], - "globalMetadata": { - "_appTitle": "GotenbergSharpApiClient", - "_appName": "GotenbergSharpApiClient", - "_appFooter": "GotenbergSharpApiClient - C# Client for Gotenberg API", - "_enableSearch": true, - "_disableContribution": false, - "_gitContribute": { - "repo": "https://github.com/ChangemakerStudios/GotenbergSharpApiClient", - "branch": "develop" - } - } - } -} diff --git a/docs/articles/getting-started.md b/docs/getting-started.md similarity index 94% rename from docs/articles/getting-started.md rename to docs/getting-started.md index dbee05f..0c23c19 100644 --- a/docs/articles/getting-started.md +++ b/docs/getting-started.md @@ -1,6 +1,7 @@ # Getting Started -> **Example:** [DIExample](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/DIExample) — Full DI setup with logging and Polly retry +!!! example "Working Example" + [DIExample](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/DIExample) — Full DI setup with logging and Polly retry ## Prerequisites diff --git a/docs/articles/html-and-url-to-pdf.md b/docs/html-and-url-to-pdf.md similarity index 87% rename from docs/articles/html-and-url-to-pdf.md rename to docs/html-and-url-to-pdf.md index 554392a..8adfe8f 100644 --- a/docs/articles/html-and-url-to-pdf.md +++ b/docs/html-and-url-to-pdf.md @@ -1,6 +1,10 @@ # HTML & URL to PDF -> **Examples:** [HtmlConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/HtmlConvert), [UrlConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/UrlConvert), [HtmlWithMarkdown](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/HtmlWithMarkdown), [ChromiumFeatures](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/ChromiumFeatures) +!!! example "Working Examples" + [HtmlConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/HtmlConvert) | + [UrlConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/UrlConvert) | + [HtmlWithMarkdown](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/HtmlWithMarkdown) | + [ChromiumFeatures](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/ChromiumFeatures) ## HTML to PDF diff --git a/docs/index.md b/docs/index.md index 96876dd..3344fa6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,11 +1,11 @@ ---- -_layout: landing ---- - # GotenbergSharpApiClient .NET C# client for [Gotenberg](https://gotenberg.dev/) — a Docker-powered stateless API for converting & merging HTML, Markdown, and Office documents to PDF. +[![NuGet version](https://badge.fury.io/nu/Gotenberg.Sharp.Api.Client.svg)](https://badge.fury.io/nu/Gotenberg.Sharp.Api.Client) +[![Downloads](https://img.shields.io/nuget/dt/Gotenberg.Sharp.API.Client.svg?logo=nuget&color=purple)](https://www.nuget.org/packages/Gotenberg.Sharp.API.Client) +![Build status](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/actions/workflows/deploy.yml/badge.svg) + ## Features - **HTML/URL to PDF** — Convert HTML content or URLs to PDF using Chromium @@ -19,16 +19,22 @@ _layout: landing ## Quick Start +### Install + ```bash dotnet add package Gotenberg.Sharp.Api.Client ``` +### Configure + ```csharp services.AddOptions() .Bind(Configuration.GetSection("GotenbergSharpClient")); services.AddGotenbergSharpClient(); ``` +### Use + ```csharp var builder = new HtmlRequestBuilder() .AddDocument(doc => doc.SetBody("

Hello PDF!

")) @@ -37,12 +43,4 @@ var builder = new HtmlRequestBuilder() var result = await sharpClient.HtmlToPdfAsync(builder); ``` -## Documentation - -- [Getting Started](articles/getting-started.md) -- [HTML & URL to PDF](articles/html-and-url-to-pdf.md) -- [Screenshots](articles/screenshots.md) -- [Office Document Conversion](articles/office-conversion.md) -- [PDF Manipulation](articles/pdf-manipulation.md) -- [Advanced Features](articles/advanced-features.md) -- [API Reference](api/index.md) +!!! tip "See the [Getting Started](getting-started.md) guide for full setup instructions." diff --git a/docs/articles/office-conversion.md b/docs/office-conversion.md similarity index 92% rename from docs/articles/office-conversion.md rename to docs/office-conversion.md index 6759a2f..489eb12 100644 --- a/docs/articles/office-conversion.md +++ b/docs/office-conversion.md @@ -1,6 +1,8 @@ # Office Document Conversion -> **Examples:** [OfficeMerge](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/OfficeMerge), [LibreOfficeOptions](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/LibreOfficeOptions) +!!! example "Working Examples" + [OfficeMerge](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/OfficeMerge) | + [LibreOfficeOptions](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/LibreOfficeOptions) Convert and merge Office documents (Word, Excel, PowerPoint, and 100+ formats) to PDF using LibreOffice. diff --git a/docs/articles/pdf-manipulation.md b/docs/pdf-manipulation.md similarity index 86% rename from docs/articles/pdf-manipulation.md rename to docs/pdf-manipulation.md index f62db77..f9ecd8d 100644 --- a/docs/articles/pdf-manipulation.md +++ b/docs/pdf-manipulation.md @@ -1,6 +1,11 @@ # PDF Manipulation -> **Examples:** [PdfEngineOperations](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfEngineOperations), [WatermarkAndRotate](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/WatermarkAndRotate), [EncryptPdf](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/EncryptPdf), [PdfMerge](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfMerge), [PdfConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfConvert) +!!! example "Working Examples" + [PdfEngineOperations](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfEngineOperations) | + [WatermarkAndRotate](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/WatermarkAndRotate) | + [EncryptPdf](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/EncryptPdf) | + [PdfMerge](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfMerge) | + [PdfConvert](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/PdfConvert) Standalone operations on existing PDF files using Gotenberg's PDF engine routes. diff --git a/docs/articles/screenshots.md b/docs/screenshots.md similarity index 93% rename from docs/articles/screenshots.md rename to docs/screenshots.md index a80577f..a29e1a4 100644 --- a/docs/articles/screenshots.md +++ b/docs/screenshots.md @@ -1,6 +1,7 @@ # Screenshots -> **Example:** [Screenshot](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/Screenshot) +!!! example "Working Example" + [Screenshot](https://github.com/ChangemakerStudios/GotenbergSharpApiClient/tree/develop/examples/Screenshot) Capture screenshots of HTML content or URLs using Chromium. Returns PNG, JPEG, or WebP images. diff --git a/docs/toc.yml b/docs/toc.yml deleted file mode 100644 index 965b409..0000000 --- a/docs/toc.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: Articles - href: articles/ -- name: API Reference - href: api/ diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..9f96dde --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,70 @@ +site_name: GotenbergSharpApiClient +site_url: https://changemakerstudios.github.io/GotenbergSharpApiClient/ +site_description: .NET C# client for the Gotenberg API +repo_url: https://github.com/ChangemakerStudios/GotenbergSharpApiClient +repo_name: ChangemakerStudios/GotenbergSharpApiClient +edit_uri: edit/develop/docs/ + +theme: + name: material + logo: images/logo.png + favicon: images/logo.png + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: deep purple + accent: purple + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: deep purple + accent: purple + toggle: + icon: material/brightness-4 + name: Switch to light mode + features: + - navigation.instant + - navigation.tracking + - navigation.sections + - navigation.top + - search.highlight + - search.suggest + - content.code.copy + - content.tabs.link + icon: + repo: fontawesome/brands/github + +nav: + - Home: index.md + - Getting Started: getting-started.md + - Guides: + - HTML & URL to PDF: html-and-url-to-pdf.md + - Screenshots: screenshots.md + - Office Conversion: office-conversion.md + - PDF Manipulation: pdf-manipulation.md + - Advanced Features: advanced-features.md + +markdown_extensions: + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.tabbed: + alternate_style: true + - tables + - attr_list + - md_in_html + +plugins: + - search + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/ChangemakerStudios/GotenbergSharpApiClient + - icon: fontawesome/solid/cube + link: https://www.nuget.org/packages/Gotenberg.Sharp.API.Client