Skip to content

Commit

Permalink
Update documentation website
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriyDurov committed Jan 10, 2024
1 parent 8ffbe6e commit 2145e48
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 131 deletions.
74 changes: 35 additions & 39 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
name: Publish Documentation

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
branches:
- main
- updates
paths:
- "docs/**"
- ".github/workflows/docs.yml"

jobs:
# Build job
build:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
- uses: actions/checkout@v4
with:
source: ./docs/
destination: ./_site
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
cd docs
mdbook build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'docs/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# OCPI.Net

![Tests](https://github.com/BitzArt/OCPI.Net/actions/workflows/Tests.yml/badge.svg)

[![NuGet version](https://img.shields.io/nuget/v/Ocpi.Net.svg)](https://www.nuget.org/packages/Ocpi.Net/)
[![NuGet downloads](https://img.shields.io/nuget/dt/Ocpi.Net.svg)](https://www.nuget.org/packages/Ocpi.Net/)

[OCPI (Open Charge Point Interface)](https://github.com/ocpi/ocpi) implementation for .Net, built with C#

| OCPI Version | Support | Progress |
Expand All @@ -11,9 +12,7 @@
| 2.1.1 | Planned | (https://github.com/BitzArt/OCPI.Net/issues/16) |
| 2.1 | Planned | (https://github.com/BitzArt/OCPI.Net/issues/17) |

## Resources

[![documentation](https://img.shields.io/badge/OCPI.Net_documentation-%230072C6?style=for-the-badge)](https://bitzart.github.io/OCPI.Net/1.introduction.html)
[![documentation](https://img.shields.io/badge/documentation-%230072C6?style=for-the-badge)](https://bitzart.github.io/OCPI.Net/1.introduction.html)

## License

Expand Down
6 changes: 0 additions & 6 deletions docs/_config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[book]
title = "OCPI.Net"
10 changes: 0 additions & 10 deletions docs/1.introduction.md → docs/src/1.introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Back to the [Table of Contents](README.md)

---

## Introduction

Welcome to the documentation for the OCPI.Net package! This documentation is organized into several [sections](README.md), each covering a different aspect of the package. In this section, we'll provide an overview of the package and its benefits, as well as a guide to getting started with OCPI.Net.
Expand Down Expand Up @@ -47,9 +43,3 @@ Make sure to check out this [Sample application](https://github.com/BitzArt/OCPI
3. Enjoy the power of OCPI.Net!

You will find more info on how to use the package's functionality in the later sections of this documentation. See [Implementation](3.implementation.md) for more information on how to implement OCPI modules using OCPI.Net.


---

Next topic:
[Architecture](2.architecture.md)
14 changes: 1 addition & 13 deletions docs/2.architecture.md → docs/src/2.architecture.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[Introduction](1.introduction.md)

---

## Architecture

The OCPI.Net package is designed to be as flexible as possible, allowing you to implement OCPI modules in any way you see fit. The package uses Asp.Net Core Controllers for handling incoming OCPI requests and returning OCPI responses. The package also contains a number of services which are used to perform various tasks such as validating incoming requests, generating responses, and handling errors.
Expand All @@ -21,9 +14,4 @@ The package uses Exceptions as a way to handle errors. The exceptions can be thr

### Integration with Asp.Net Core

The OCPI.Net package is designed to be used with Asp.Net Core. The package contains a `OcpiController` base class which you can use to implement your own OCPI controllers. This class contains a number of methods which you can use to handle incoming OCPI requests and generate OCPI responses.

---

Next topic:
[Implementation](3.implementation.md)
The OCPI.Net package is designed to be used with Asp.Net Core. The package contains a `OcpiController` base class which you can use to implement your own OCPI controllers. This class contains a number of methods which you can use to handle incoming OCPI requests and generate OCPI responses.
14 changes: 1 addition & 13 deletions docs/3.implementation.md → docs/src/3.implementation.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[Architecture](2.architecture.md)

---

## Implementation

You can always refer to the [Sample application](https://github.com/BitzArt/OCPI.Net/tree/main/sample/OCPI.Net.Sample) for a working example of how to use the package.
Expand Down Expand Up @@ -50,9 +43,4 @@ The package is designed to be as flexible as possible, allowing you to implement

You are not forced to use any of these services, and you can implement your own services if you wish. The package also allows you to override some of the default services with your own custom implementations.

Refer to the [Architecture](2.architecture.md) section for more information on the package's internal architecture.

---

Next topic:
[OCPI Contracts](4.contracts.md)
Refer to the [Architecture](2.architecture.md) section for more information on the package's internal architecture.
14 changes: 1 addition & 13 deletions docs/4.contracts.md → docs/src/4.contracts.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[Implementation](3.implementation.md)

---

## OCPI Contracts

The package contains a number of classes which are used to represent OCPI objects. You can see the full list of contract models [here](https://github.com/BitzArt/OCPI.Net/tree/main/src/OCPI.Net.Contracts).
Expand Down Expand Up @@ -39,9 +32,4 @@ public class OcpiLocationsReceiverController : OcpiController
}
```

Validation functionality is built on top of [FluentValidation](https://github.com/FluentValidation/FluentValidation) nuget package.

---

Next topic:
[Error handling](5.error-handling.md)
Validation functionality is built on top of [FluentValidation](https://github.com/FluentValidation/FluentValidation) nuget package.
14 changes: 1 addition & 13 deletions docs/5.error-handling.md → docs/src/5.error-handling.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[OCPI Contracts](4.contracts.md)

---

## Error Handling

The package uses Exceptions as a way to handle errors. The exceptions can be thrown from anywhere in your code, and the package will automatically handle them and generate the appropriate OCPI response. Exception handling is done by the `OcpiExceptionFilter` attribute, which is automatically applied to all controllers that inherit from the `OcpiController` base class. Exceptions can be populated with a custom data payload, which will be included in the OCPI response.
Expand Down Expand Up @@ -54,9 +47,4 @@ public class MyCustomOcpiException : OcpiExceptionBase
{
}
}
```

---

Next topic:
[Pagination](6.pagination.md)
```
12 changes: 0 additions & 12 deletions docs/6.pagination.md → docs/src/6.pagination.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[Error Handling](5.error-handling.md)

---

## Pagination

The OCPI.Net package uses some classes from the [BitzArt.Pagination](https://github.com/BitzArt/Pagination) nuget package to handle paginated endpoints. Refer to it for guidance on how to use the pagination functionality.
Expand Down Expand Up @@ -72,8 +65,3 @@ public class OcpiLocationsSenderController : OcpiController
};
}
```

---

Next topic:
[Versioning](7.versioning.md)
7 changes: 0 additions & 7 deletions docs/7.versioning.md → docs/src/7.versioning.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Back to the [Table of Contents](README.md)

Previous topic:
[Pagination](6.pagination.md)

---

## Versioning

The OCPI.Net package supports multiple OCPI versions at the same time. The package uses the `OcpiEndpoint` attribute to determine which OCPI versions are supported by a given controller.
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Summary

# OCPI.Net

- [Introduction](1.introduction.md)
- [Architecture](2.architecture.md)
- [Implementation](3.implementation.md)
- [OCPI Contracts](4.contracts.md)
- [Error Handling](5.error-handling.md)
- [Pagination](6.pagination.md)
- [Versioning](7.versioning.md)

0 comments on commit 2145e48

Please sign in to comment.