Skip to content

Commit

Permalink
some improvements & disable cookie consent form for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Nov 29, 2023
1 parent 5d64c03 commit 220eb98
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 19 deletions.
29 changes: 19 additions & 10 deletions docs/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ Cloud is available through [Maven Central](https://search.maven.org/search?q=clo

<!-- prettier-ignore -->
=== "Maven"

```xml
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-core</artifactId>
<version>dCLOUD_BASE_VERSIONd</version>
</dependency>
```

=== "Gradle (Kotlin)"

```kotlin
implementation("cloud.commandframework:cloud-core:dCLOUD_BASE_VERSIONd")
```

=== "Gradle (Groovy)"

```groovy
implementation 'cloud.commandframework:cloud-core:dCLOUD_BASE_VERSIONd'
```
Expand Down Expand Up @@ -81,6 +86,8 @@ Cloud ships with two different command execution coordinators:
- **AsynchronousCommandExecutionCoordinator**: Uses an executor to dispatch the parsing and execution tasks.
You can change the default executor, and also force command parsing to take place on the calling thread.

You may also create your own execution coordinator by implementing `CommandExecutionCoordinator`.

### Building a command

#### Descriptions
Expand Down Expand Up @@ -152,20 +159,21 @@ The message registered for the caption will have those variables replaced with v
to be thrown.

<!-- prettier-ignore -->
!!! example
Example caption registry usage
!!! example annotate "Example caption registry usage"
```java
final CaptionRegistry<SenderType> registry = manager.captionRegistry();
if (registry instanceof FactoryDelegatingCaptionRegistry) {
final FactoryDelegatingCaptionRegistry<SenderType> factoryRegistry = (FactoryDelegatingCaptionRegistry<SenderType>)
manager.captionRegistry();
if (registry instanceof FactoryDelegatingCaptionRegistry) /* (1)! */ {
final FactoryDelegatingCaptionRegistry<SenderType> factoryRegistry =
(FactoryDelegatingCaptionRegistry<SenderType>) manager.captionRegistry();
factoryRegistry.registerMessageFactroy(
StandardCaptionKeys.ARGUMENT_PARSE_FAILURE_BOOLEAN,
(context, key) -> "'{input}' ain't a boolean >:("
);
}
```

1. Some platforms may opt to use a different caption registry implementation that does not delegate to factories.

## Parsers

### Parser Registry
Expand Down Expand Up @@ -263,8 +271,7 @@ You can chain the aliases of multiple presence flags together, such that `-a -b
The flag values are contained in `FlagContext` which can be retrieved using `CommandContext.flags()`.

<!-- prettier-ignore -->
!!! example
Example of a command with a presence flag.
!!! example "Example of a command with a presence flag"
```java
manager.commandBuilder("command")
.flag(manager.flagBuilder("flag").withAliases("f"))
Expand All @@ -283,7 +290,7 @@ You may either implement the `AggregateCommandParser` interface, or using constr
that you create by calling `AggregateCommandParser.builder()`.

<!-- prettier-ignore -->
!!! example
!!! example "Example Aggregate Parser"
```java
final AggregateCommandParser<CommandSender, Location> locationParser = AggregateCommandParser.<CommandSender>builder()
.withComponent("world", worldParser())
Expand Down Expand Up @@ -351,9 +358,9 @@ exceptionally completed future.
Returning a future is useful when the parsing needs to take place on a specific thread.

<!-- prettier-ignore -->
!!! example
!!! example annotate "Example Parser"
```java
public class UUIDParser<C> implements ArgumentParser<C, UUID> {
public class UUIDParser<C /* (1)! */> implements ArgumentParser<C, UUID> {

@Override
public ArgumentParseResult<UUID> parse(
Expand All @@ -372,6 +379,8 @@ Returning a future is useful when the parsing needs to take place on a specific
}
```

1. The command sender type.

#### Exceptions

It is recommended to make use of `ParserException` when returning a failed result.
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ Development builds of Cloud are available on the Sonatype Snapshots Repository:

<!-- prettier-ignore -->
=== "Maven"

```xml
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
```

=== "Gradle (Kotlin)"

```kotlin
maven("https://oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-snapshots"
Expand All @@ -47,7 +50,9 @@ Development builds of Cloud are available on the Sonatype Snapshots Repository:
}
}
```

=== "Gradle (Groovy)"

```groovy
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mkdocs
mkdocs-material
mkdocs-placeholder-plugin
mkdocs-placeholder-plugin
mkdocs-git-revision-date-localized-plugin
27 changes: 19 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ site_name: Cloud v2
site_url: https://cloud.incendo.org/
repo_url: https://github.com/incendo/cloud-docs
repo_name: cloud-docs
edit_uri: edit/main/docs/
nav:
- Cloud:
- Cloud: index.md
Expand Down Expand Up @@ -47,6 +48,11 @@ theme:
- search.suggest
- search.highlight
- search.share
- content.action.edit
- content.action.view
- content.code.copy
- content.code.annotate
- content.tabs.link
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
Expand All @@ -73,14 +79,19 @@ markdown_extensions:
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- attr_list
- md_in_html
plugins:
- search
- placeholder
extra:
consent:
title: Cookie consent
description: >-
We use cookies to recognize your repeated visits and preferences, as well
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better.
- git-revision-date-localized:
enable_creation_date: false
fallback_to_build_date: true
#extra:
# consent:
# title: Cookie consent
# description: >-
# We use cookies to recognize your repeated visits and preferences, as well
# as to measure the effectiveness of our documentation and whether users
# find what they're searching for. With your consent, you're helping us to
# make our documentation better.

0 comments on commit 220eb98

Please sign in to comment.