<commit_before># Documentation Provider 

<a href="LICENSE"><img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License"></a>
<a href="https://swift.org"><img src="http://img.shields.io/badge/swift-3.1-brightgreen.svg" alt="Swift 3.1"></a>
<a href="https://circleci.com/gh/zarghol/documentation-provider/tree/master"><img src="https://circleci.com/gh/zarghol/documentation-provider/tree/master.svg?style=svg" alt="CircleCI"></a>

Allows you to build a documentation page for all your services served via the droplet.
The page is rendered via Leaf.

## Getting Started

1. Add the provider to your droplet.
       import DocumentationProvider
       //...
       try addProvider(DocumentationProvider.Provider.self)
   A new route is now created at **/docs**.
   By default, the documentation displays all routes of the droplet.
2. *(optional)* Provide additional informations to display.

    Implement the protocol `DocumentationInfoProvider` and pass it to the `DocumentationProvider`.

        struct SomeController: DocumentationInfoProvider {
          static var documentation: [String: RouteDocumentation.AdditionalInfos] { 
            return [
              "* POST path/:pathParameter": RouteDocumentation.AdditionalInfos(
                  description: "The Description of the service",
                  pathParameters: ["pathParameter" : "Description of the parameter"],
                  queryParameters: ["queryParameter": "Description of the parameter"]
              ),
              "* GET other": RouteDocumentation.AdditionalInfos(
                  description: "The Description of the service"
              )
            ]
          }
        }
        // ...
        // at route time or any other moment
        DocumentationProvider.Provider.current.provideInfo(SomeController.self)
    
3. That's it ! 🎉🎉

## TODO

- [ ] Add Unit Test (and maybe circleCI)
- [ ] Parameterized the route
- [ ] Parameterized the log level for warning about the infos providers
- [ ] Allow to hide some routes to not display it on the page
- [ ] Allow to use a custom css ? Or at least a custom leaf template, and document the provided context

## Contribute

Feel free to send PR, or add enhancement ideas with issues !<commit_msg>check unit test on readme<commit_after># Documentation Provider 

<a href="LICENSE"><img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License"></a>
<a href="https://swift.org"><img src="http://img.shields.io/badge/swift-3.1-brightgreen.svg" alt="Swift 3.1"></a>
<a href="https://circleci.com/gh/zarghol/documentation-provider/tree/master"><img src="https://circleci.com/gh/zarghol/documentation-provider/tree/master.svg?style=svg" alt="CircleCI"></a>

Allows you to build a documentation page for all your services served via the droplet.
The page is rendered via Leaf.

## Getting Started

1. Add the provider to your droplet.
       import DocumentationProvider
       //...
       try addProvider(DocumentationProvider.Provider.self)
   A new route is now created at **/docs**.
   By default, the documentation displays all routes of the droplet.
2. *(optional)* Provide additional informations to display.

    Implement the protocol `DocumentationInfoProvider` and pass it to the `DocumentationProvider`.

        struct SomeController: DocumentationInfoProvider {
          static var documentation: [String: RouteDocumentation.AdditionalInfos] { 
            return [
              "* POST path/:pathParameter": RouteDocumentation.AdditionalInfos(
                  description: "The Description of the service",
                  pathParameters: ["pathParameter" : "Description of the parameter"],
                  queryParameters: ["queryParameter": "Description of the parameter"]
              ),
              "* GET other": RouteDocumentation.AdditionalInfos(
                  description: "The Description of the service"
              )
            ]
          }
        }
        // ...
        // at route time or any other moment
        DocumentationProvider.Provider.current.provideInfo(SomeController.self)
    
3. That's it ! 🎉🎉

## TODO

- [x] Add Unit Test (and maybe circleCI)
- [ ] Parameterized the route
- [ ] Parameterized the log level for warning about the infos providers
- [ ] Allow to hide some routes to not display it on the page
- [ ] Allow to use a custom css ? Or at least a custom leaf template, and document the provided context

## Contribute

Feel free to send PR, or add enhancement ideas with issues !
{'fraction_non_alphanumeric': 0.10185185185185185, 'fraction_numerical': 0.0030864197530864196, 'mean_word_length': 2.9179620034542313, 'pattern_counts': {'":': 6, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4678981', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1160, 'n_words': 403}