Skip to content

Commit

Permalink
doc(typo): fix typos and style
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Nov 5, 2024
1 parent 0f84f5f commit ddf694e
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _This section's comparisons are based on Sprig v3.2.3. If you're totally new, we
- **`toDuration` Conversion Function**: A new utility to simplify time conversions across templates. See [PR 27](https://github.com/go-sprout/sprout/pull/27).

### 📚 **Documentation**
- **Fancy and complete documentation**: Create a fancy and complete documentatio, ensuring they’re up to date and aligned with Sprout’s growth. [Documentation](https://sprout.atom.codes)
- **Fancy and complete documentation**: Create a fancy and complete documentation, ensuring they are up-to-date and aligned with Sprout’s growth. [Documentation](https://sprout.atom.codes)

---

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can track our progress towards Sprout v1.0 by following the documentation pa
- [Building Function Maps](#building-function-maps)
- [Working with Templates](#working-with-templates)
- [Usage: Quick Example (code only)](#usage-quick-example)
- [Performence Benchmarks](#performence-benchmarks)
- [Performance Benchmarks](#performance-benchmarks)
- [Sprig v3.2.3 vs Sprout v0.2](#sprig-v323-vs-sprout-v02)
- [Development Philosophy (Currently in reflexion to create our)](#development-philosophy-currently-in-reflexion-to-create-our)

Expand All @@ -57,8 +57,8 @@ Sprout provide a package `sprigin` to provide a drop-in replacement for Sprig in

> [!IMPORTANT]
> The `sprigin` package is a temporary solution to provide backward compatibility with Sprig. We recommend updating your code to use the Sprout package directly to take advantage of the new features and improvements.
>
> A complete guide are available in the [documentation](https://docs.atom.codes/sprout/migration-from-sprig).
>
> A complete guide is available in the [documentation](https://docs.atom.codes/sprout/migration-from-sprig).
```diff
import (
Expand Down Expand Up @@ -103,7 +103,7 @@ handler := sprout.New(
### Working with Registries
Registries in Sprout are groups of functions that can be added to a handler. They help organize functions and optimize template performance.

You can retrieve all built-ins registries and functions under [Registries](https://docs.atom.codes/sprout/registries/list-of-all-registries).
You can retrieve all built-in registries and functions under [Registries](https://docs.atom.codes/sprout/registries/list-of-all-registries).

```go
import (
Expand All @@ -122,7 +122,7 @@ handler.AddRegistries(
### Working with Registries Groups
In some cases, you can use a group of registries to add multiple registries at once.

You can retrieve all built-ins registries groups under [Registry Groups](https://docs.atom.codes/sprout/groups/list-of-all-registry-groups).
You can retrieve all built-in registries groups under [Registry Groups](https://docs.atom.codes/sprout/groups/list-of-all-registry-groups).

```go
import (
Expand Down Expand Up @@ -181,7 +181,7 @@ func main() {
}
```

## Performence Benchmarks
## Performance Benchmarks

To see all the benchmarks, please refer to the [benchmarks](benchmarks/README.md) directory.

Expand All @@ -204,15 +204,15 @@ So, Sprout v0.5 is approximately 45.3% faster and uses 16.5% less memory than Sp

You can see the full benchmark results [here](benchmarks/README.md).

## Development Philosophy (Currently in reflexion to create our)
## Development Philosophy (Currently in consideration to create ours)

Our approach to extending and refining Sprout was guided by several key principles:

- Build on the principles of simplicity, flexibility, and consistency.
- Empower developers to create robust templates without sacrificing performance or usability.
- Adheres strictly to Go's templating conventions, ensuring a seamless experience for those familiar with Go's native tools.
- Naming conventions across functions are standardized for predictability and ease of use.
- Emphasizes error handling, preferring safe defaults over panics.
- Emphasizes error handling, preferring to safe defaults over panics.
- Provide a clear and comprehensive documentation to help users understand the library and its features.
- Maintain a high level of code quality, ensuring that the library is well-tested, performant, and reliable.
- Continuously improve and optimize the library to meet the needs of the community.
Expand Down
4 changes: 2 additions & 2 deletions SPRIG_TO_SPROUT_CHANGES_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ migrated yet to the [Migration from Sprig](https://docs.atom.codes/sprout/migrat

## Templating Differences
### Bugs fixed
In Sprig, somes functions have bugs that have been fixed in Sprout:
In Sprig, some functions have bugs that have been fixed in Sprout:

1. `{{ "foooboooooo" | abbrevboth 4 9 }}`
- Sprig: `fooobo...`
Expand All @@ -40,5 +40,5 @@ In Sprig, somes functions have bugs that have been fixed in Sprout:
- Sprig: `foobar` | `foobar`
- Sprout: `foo` | `bar`
8. `{{ .duration | durationRound }}`
- Sprig: `0s` (only when not casted to `time.Duration` before, `{{ .duration | duration | durationRound }}` works as expected with `5s`)
- Sprig: `0s` (only when not cast to `time.Duration` before, `{{ .duration | duration | durationRound }}` works as expected with `5s`)
- Sprout: `5s`
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Our aim is to foster a dynamic and collaborative development environment, welcom
{% hint style="info" %}
For a detailed explanation of the changes between Sprig and Sprout, see [SPRIG\_TO\_SPROUT\_CHANGES\_NOTES.md](../SPRIG\_TO\_SPROUT\_CHANGES\_NOTES.md). This document will help contributors and maintainers understand the modifications made between the fork date and version 1.0.0 of the Sprout library. This file will be moved here soon with better formatting.

**Also a complete guide to migrate from sprig combability mode to a full sprout experience!** 
**Also, a complete guide to migrate from sprig compatibility mode to a full sprout experience!** 
{% endhint %}

### Big thanks
Expand All @@ -27,6 +27,6 @@ We owe a tremendous **amount of gratitude to the original authors and contributo

To every individual who has contributed to Sprig, whether through code, documentation, or community support, we extend our heartfelt thanks. Your contributions have been invaluable, and Sprout’s evolution is a testament to the solid foundation you've built. We're honored to build on this legacy and are excited about the future **we can create together**.

A **big shoutout to the original author(s) and every single contributor** for paving the way. We are committed to maintaining the spirit of open collaboration and innovation that you've instilled in this project. Here’s to continued success and to sharing the love and respect for the open-source community that drives us forward.
A **big shout-out to the original author(s) and every single contributor** for paving the way. We are committed to maintaining the spirit of open collaboration and innovation that you've instilled in this project. Here’s to continued success and to sharing the love and respect for the open-source community that drives us forward.

Thank you for inspiring us and countless others in this journey.
4 changes: 2 additions & 2 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* [Random](registries/random.md)
* [Reflect](registries/reflect.md)
* [Regexp](registries/regexp.md)
* [Semver](registries/semver.md)
* [SemVer](registries/semver.md)
* [Slices](registries/slices.md)
* [Std](registries/std.md)
* [Strings](registries/strings.md)
Expand All @@ -55,4 +55,4 @@

## Links

* [Github repository](https://github.com/go-sprout/sprout)
* [GitHub repository](https://github.com/go-sprout/sprout)
2 changes: 1 addition & 1 deletion docs/advanced/how-to-create-a-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type MyCustomHandler struct {

### Step 3: Implement the Handler Interface

Next, implement the `Handler` interface methods in your custom struct. I take logger as example
Next, implement the `Handler` interface methods in your custom struct. I take logger as example.

```go
func (h *MyCustomHandler) Logger() *slog.Logger {
Expand Down
6 changes: 3 additions & 3 deletions docs/features/function-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To configure aliases, you must use the Sprout function handler. 

## How It Works

* **Definition:** An alias acts as a secondary name for a function, referring to the original implementation in memory, the function are not duplicated at runtime.
* **Definition:** An alias behaves as a secondary name for a function, referring to the original implementation in memory, the function is not duplicated at runtime.
* **Usage:** When the deprecated (aliased) function names are used, the code behaves as if the new function names were called, ensuring compatibility.
* **Example:** Suppose `oldFunc` is deprecated in favor of `newFunc` in your template. The alias allows code calling `oldFunc` to execute `newFunc` transparently.

Expand All @@ -31,7 +31,7 @@ template.New("base").Funcs(handler.Build()).Parse("{{ newFunc }}")

This creates a mapping between an old function name (`oldFunc`) and a new one (`newFunc`). Calls to `oldFunc` within the template are redirected to execute `newFunc`. This enables the template to parse and execute using the new function name seamlessly.

### Add more than one aliases for te same function
### Add more than one aliases for the same function

To add more aliases for the same original function, simply add more parameters to the `WithAlias` function:

Expand All @@ -53,7 +53,7 @@ var myAliases = sprout.FunctionAliasMap{
handler := sprout.New(sprout.WithAliases(myAliases))
```

This creates two aliases for two methodes (4 in total). Calling `oldFunc` or `secondAlias` with execute `newFunc` and calling `hi` or `greet` will execute `hello`.
This creates two aliases for two methods (4 in total). Calling `oldFunc` or `secondAlias` with execute `newFunc` and calling `hi` or `greet` will execute `hello`.

## Best Practices

Expand Down
4 changes: 2 additions & 2 deletions docs/features/function-notices.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This feature is crucial for migrating from Sprig v3.2.3 or when upgrading betwee

The Notice Feature works by wrapping existing function calls with additional logic that triggers notices when those functions are invoked.

The notice are sent to the `slog.Logger` configured on the handler, with 2 extra attributes for helping monitoring : 
The notice are sent to the `slog.Logger` configured on the handler, with 2 extra attributes for help to monitor : 

* **function**: how contains the name of the function how trigger this notice.
* **notice:** how indicate the kind of the notice `info`, `debug` or `deprecated`.
Expand All @@ -28,7 +28,7 @@ The notice are sent to the `slog.Logger` configured on the handler, with 2 extra
First, you need to define a notice for a function that you want to monitor. For example, to mark a function as deprecated:

{% hint style="warning" %}
**Be careful**, the function name are case-sensitive
**Be careful**, the function names are case-sensitive
{% endhint %}

```go
Expand Down
2 changes: 1 addition & 1 deletion docs/features/loader-system-registry-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Using a `RegistryGroup` can help you manage multiple registries. But can lead to

## How to use a registry group

If you have creted a `RegistryGroup` or want to use a built-in group, you can add it to your handler using the `AddGroups` method:
If you have created a `RegistryGroup` or want to use a built-in group, you can add it to your handler using the `AddGroups` method:

```go
err := handler.AddGroups(group1, group2)
Expand Down
2 changes: 1 addition & 1 deletion docs/groups/list-of-all-registry-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ You can found more details about registry groups in the [loader-system-registry-
{% hint style="info" %}
You can open an issue to ask to be listed here. We are a community :seedling:

And maybe your registry will be embed on sprout directly, who know :eyes:
And maybe your registry will be embedded on sprout directly, who know :eyes:
{% endhint %}
4 changes: 2 additions & 2 deletions docs/introduction/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Sprout supports various customization options using handler options:

See more below or in dedicated page [function-aliases.md](../features/function-aliases.md "mention").
* **Notices:**\
You can specify a notice (info, deprecated, warn) on specific function, this message has writed on the logger at runtime when rendering the template:
You can specify a notice (info, deprecated, warn) on specific function, this message has written on the logger at runtime when rendering the template:

```go
handler := sprout.New(sprout.WithNotices(sprout.NewInfoNotice("foo", "You use foo")))
Expand Down Expand Up @@ -174,4 +174,4 @@ This will render the template with all functions and aliases available.

Sprout provides a structured and powerful way to manage template functions in Go, making it easier to build, maintain, and extend templating functionality. With features like custom registries, aliases, and configurable error handling, Sprout can significantly enhance your templating experience.

For more informations or questions, refer to the [Sprout GitHub repository](https://github.com/go-sprout/sprout).
For more information or questions, refer to the [Sprout GitHub repository](https://github.com/go-sprout/sprout).
8 changes: 4 additions & 4 deletions docs/introduction/templating-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ description: >-
### Go Code Formatting

* We follow the standard Go formatting conventions using `gofmt`. Ensure that your code is formatted before submitting a pull request.
* Run `go fmt ./...` before commiting to format the code
* Run `go fmt ./...` before committing to format the code.

### Naming Conventions

#### Registry

* **Packages:** Package names should be short and concise. Use singular nouns (e.g., `util` instead of `utils`). Exception on `strings`, `slices`, `maps` to match the go std package naming.
* **UID:** The UID of a repository must be in camelCase and prefixed with your name/org separated ny a dot (e.g., `42atomys.myRegistry` instead of `my-registry`)
* **UID:** The UID of a repository must be in camelCase and prefixed with your name/org separated by a dot (e.g., `42atomys.myRegistry` instead of `my-registry`)
* **Registry README/Comments:** Each package should have a comment or a README that provides a brief overview of its purpose.

#### Functions
Expand Down Expand Up @@ -51,8 +51,8 @@ description: >-
Directory Layout

```bash
├── benchmarks/ # benchmarks used to ensure performence and backward
├── docs/ # docuementation of the project hosted on sprout.atom.codes
├── benchmarks/ # benchmarks used to ensure performance and backward
├── docs/ # documentation of the project hosted on sprout.atom.codes
├── internal/helpers/ # private cross registry library code
├── pesticide/ # package to help you to test your functions on a template engine
├── registry/ # contains all officials registry of sprout
Expand Down
6 changes: 3 additions & 3 deletions docs/migration-from-sprig.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ As a library developer, you can extend Sprout by creating your [own function reg
{% endhint %}

{% hint style="success" %}
Our maintainers and collaborators can assist you if you have question, don't hesitate to [open a discussion on Github](https://github.com/orgs/go-sprout/discussions/categories/q-a) !
Our maintainers and collaborators can assist you if you have question, don't hesitate to [open a discussion on GitHub](https://github.com/orgs/go-sprout/discussions/categories/q-a) !
{% endhint %}

## <mark style="color:purple;">Migrating Common Functions</mark>
Expand Down Expand Up @@ -267,7 +267,7 @@ if err != nil {

#### Merge / MergeOverwrite

* **Sprig**: The `merge` and `mergeOverwrite` functions does dereferencing when second value are the default golang value (example: `0` for int).
* **Sprig**: The `merge` and `mergeOverwrite` functions does dereference when second value are the default golang value (example: `0` for int).
* **Sprout**: The `merge` and `mergeOverwrite` functions does not dereference and keep the second value as is (example: `0` for int).

## <mark style="color:purple;">Deprecated Features</mark>
Expand All @@ -282,7 +282,7 @@ Move critical operations outside of templates to maintain security.
{% endhint %}

{% hint style="warning" %}
Perform cryptographic operations (listed in `crypto` package) outside of templates. the [`crypto`regisry ](registries/crypto.md)will be drop in few versions.
Perform cryptographic operations (listed in `crypto` package) outside of templates. the [`crypto`registry ](registries/crypto.md)will be drop in few versions.
{% endhint %}

All deprecated features are flagged with <mark style="color:red;">`// ! DEPRECATED`</mark> in codebase.\
Expand Down
2 changes: 1 addition & 1 deletion docs/registries/checksum.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Adler32Sum calculates the Adler-32 checksum of the input string and returns it a
</code></pre></td></tr></tbody></table>

{% tabs %}
{% tab title="Tempalte Example" %}
{% tab title="Template Example" %}
```go
{{ adler32Sum "" }} // Output: 00000001
{{ adler32Sum "Hello, World!" }} // Output: 1f9e046a
Expand Down
10 changes: 5 additions & 5 deletions docs/registries/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import "github.com/go-sprout/sprout/registry/conversion"

### <mark style="color:purple;">toBool</mark>

toBool converts a value from any types reasonably be converted to a boolean. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._
toBool converts a value from any types reasonably be converted to a boolean value. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._

<table data-header-hidden><thead><tr><th width="193">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><pre class="language-go"><code class="lang-go">ToBool(v any) (bool, error)
</code></pre></td></tr></tbody></table>
Expand All @@ -36,7 +36,7 @@ toBool converts a value from any types reasonably be converted to a boolean. _Us

### <mark style="color:purple;">toInt</mark>

toInt converts a value into a int. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._
toInt converts a value into an `int`. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._

<table data-header-hidden><thead><tr><th width="193">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><pre class="language-go"><code class="lang-go">ToInt(v any) (int, error)
</code></pre></td></tr></tbody></table>
Expand All @@ -54,7 +54,7 @@ toInt converts a value into a int. _Using the_ [_cast_ ](https://github.com/spf1

### <mark style="color:purple;">toInt64</mark>

toInt64 converts a value into a int64. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._
toInt64 converts a value into an `int64`. _Using the_ [_cast_ ](https://github.com/spf13/cast)_package._

<table data-header-hidden><thead><tr><th width="193">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><pre class="language-go"><code class="lang-go">ToInt64(v any) (int64, error)
</code></pre></td></tr></tbody></table>
Expand All @@ -72,7 +72,7 @@ toInt64 converts a value into a int64. _Using the_ [_cast_ ](https://github.com/

### <mark style="color:purple;">toUint</mark>

toUint converts a value into a uint. Utilizes the [cast](https://github.com/spf13/cast) package for conversion.
toUint converts a value into a `uint`. Utilizes the [cast](https://github.com/spf13/cast) package for conversion.

<table data-header-hidden><thead><tr><th width="193">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><pre class="language-go"><code class="lang-go">ToUint(v any) (uint, error)
</code></pre></td></tr></tbody></table>
Expand All @@ -90,7 +90,7 @@ toUint converts a value into a uint. Utilizes the [cast](https://github.com/spf1

### <mark style="color:purple;">toUint64</mark>

toUint64 converts a value into a uint64. Utilizes the [cast](https://github.com/spf13/cast) package for conversion.
toUint64 converts a value into a `uint64`. Utilizes the [cast](https://github.com/spf13/cast) package for conversion.

<table data-header-hidden><thead><tr><th width="193">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><pre class="language-go"><code class="lang-go">ToUint64(v any) (uint64, error)
</code></pre></td></tr></tbody></table>
Expand Down
Loading

0 comments on commit ddf694e

Please sign in to comment.