Skip to content

Commit

Permalink
Add API reference generation
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostWalker562 committed Sep 27, 2024
1 parent f1e13f2 commit 07af30d
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"tools": {
"strawberryshake.tools": {
"version": "13.9.11",
"commands": [
"dotnet-graphql"
],
"commands": ["dotnet-graphql"],
"rollForward": false
},
"csharpier": {
"version": "0.29.2",
"commands": [
"dotnet-csharpier"
],
"commands": ["dotnet-csharpier"],
"rollForward": false
}
}
}
}
45 changes: 45 additions & 0 deletions .github/workflows/api-reference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Generate API Reference"

on:
push:
branches:
- main

permissions:
actions: read
pages: write
id-token: write
contents: read

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish-docs:
name: Build with DocFx and publish to GitHub Pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup .NET
uses: ./.github/actions/setup-dotnet

- name: Install DocFx
run: dotnet tool update -g docfx

- name: Build API Reference using DocFx
run: docfx docfx.json

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_site"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ node_modules
artifacts

# General

# Documentation
.DS_Store
docs
_site
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public partial class MyClass : Node
}
```

## API Reference

The entire API reference can be found here: [API Reference](https://aptos-labs.github.io/aptos-dotnet-sdk/)

## Examples

Examples can be found in the [`Aptos.Examples`](https://github.com/aptos-labs/aptos-dotnet-sdk/tree/main/Aptos.Examples) project. Run the examples by using the following command:
Expand Down
Binary file added assets/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"metadata": [
{
"src": [
{
"src": "Aptos",
"files": ["**/*.csproj"]
}
],
"dest": "docs"
}
],
"build": {
"content": [
{
"files": ["**/*.{md,yml}"],
"exclude": ["_site/**"]
}
],
"resource": [
{
"files": ["assets/**"]
}
],
"output": "_site",
"template": ["default", "modern", "docs-template"],
"globalMetadata": {
"_appName": "Aptos .NET API Reference",
"_appTitle": "Aptos .NET API Reference",
"_appLogoPath": "assets/favicon.ico",
"_appFaviconPath": "assets/favicon.ico",
"_enableSearch": true,
"pdf": false
}
}
}
4 changes: 4 additions & 0 deletions docs-template/public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#logo {
max-width: 24px;
margin-right: 8px;
}
22 changes: 22 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
_layout: landing
---

# Aptos .NET SDK API Reference

This is the full API reference for the Aptos .NET SDK.

## Installation

The SDK is published onto [NuGet](https://www.nuget.org/packages/Aptos/) where you can install it using the following command:

```bash
dotnet add package Aptos
```

## Explore

- [Aptos](/docs/Aptos.html): The main namespace for interacting with the Aptos blockchain.
- [Aptos.Core](/docs/Aptos.Core.html): Core utilities for the SDK.
- [Aptos.Schemes](/docs/Aptos.Schemes.html): All authentication schemes supported in the SDK.
- [Aptos.Exceptions](/docs/Aptos.Exceptions.html): All data types for exceptions thrown by the SDK.
14 changes: 14 additions & 0 deletions toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: API Reference
href: docs/

- name: Aptos
href: docs/Aptos.html

- name: Aptos.Core
href: docs/Aptos.Core.html

- name: Aptos.Schemes
href: docs/Aptos.Schemes.html

- name: Aptos.Exceptions
href: docs/Aptos.Exceptions.html

0 comments on commit 07af30d

Please sign in to comment.