Skip to content

Commit

Permalink
documentation clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed Sep 26, 2024
1 parent d7c6bd4 commit 75ca6e5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,41 @@ This library is only needed on the logical server side. Users only need to insta
it in a single player environment. For anything specific, check out the mods which make use of this library and
follow their instructions.

## How to use
## Installation & Dependencies

First prepare the sheet so that it is publicly viewable.
For installation simply add the library like any other mod to your minecraft instance.

![public sheet](promo/01.png)
If you want to add this library as a dependency to your mod, add the following code to your `build.gradle` file.

```
repositories {
// ...
// Google Sheets Reader API
maven { url = "https://repo.repsy.io/mvn/fabricated-atelier/fabric-sheets-reader/" }
}
```

```
dependencies {
// ...
// google-sheets-reader-api
implementation "net.shirojr.sheetsreader:sheetsreader:${project.google_sheets_reader_version}"
}
```

Then in your `gradle.properties` file add the version number using the `google_sheets_reader_version` variable.
You can find available versions at our
[Maven repository](https://repsy.io/fabricated-atelier/maven/fabric-sheets-reader/artifacts) or in the
[Releases](https://github.com/JR1811/google-sheets-reader/releases).

For the credentials of the Google Sheets API, you need three values:
Also don't forget to add the `sheetsreader` modid to the `depends` section in your `fabric.mod.json` file.

## How to use

To access the Google Sheets API, credentials are needed to verify the usage.
For the credentials of this Google Sheets Reader Library, you need three values:

- API key
- Sheet ID
Expand All @@ -24,7 +52,7 @@ First set up a project, if you don't have one already, in the [Google Console](h
Enable the Google Sheets API and get a new API key from there. Take a closer look at the settings since there are many
options to handle the API key in a safer way.

After that you can retrieve the Sheets ID from your spreadsheet's URL:
After that you can retrieve the Sheet ID from your spreadsheet's URL:

ht<span>tps://docs.google.com/spreadsheets/d/**SpreadSheetID**/edit#gid=0

Expand All @@ -33,6 +61,10 @@ selection.

![Sheet Range](promo/02.png)

Also prepare the sheet so that it is publicly viewable.

![public sheet](promo/01.png)

Check out the [API README](src/main/java/net/shirojr/sheetsreader/api/README.md) file to see where and how the
credentials need to be stored.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.18.2+build.4
loader_version=0.15.11

# Mod Properties
mod_version=1.18.2-0.0.2
mod_version=1.18.2-0.0.1
maven_group=net.shirojr.sheetsreader
archives_base_name=sheetsreader

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/shirojr/sheetsreader/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ in place for that to keep the size of this lib to a minimum.
To update a config file at runtime, use the `loadFromFile` method of the `SheetsConfigHandler` class.
You can also overwrite the config file with the `saveToFile` method.

The api call might block the current thread so if the API call takes a long time the game could potentially freeze.
The API call might block the current thread so if the API call takes a long time the game could potentially freeze.
As a rule of thumb, don't reload the config at run-time if the incoming sheet data is huge.

### API Credentials From A Datapack
Expand All @@ -52,7 +52,7 @@ For an example check out the [example.json](../../../../../resources/data/sheets
file and where it's located at.

The api call is done async, so if you reload datapacks the current thread won't be blocked. Your console will notify
you about a successfully finished api call's data retrieval.
you about a successfully finished API call's data retrieval.

## Accessing `SheetsData`

Expand Down
5 changes: 1 addition & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "sheetsreader",
"version": "${version}",
"name": "google-sheets-reader",
"description": "A Fabric mod to read Google Sheets data using the Google Sheets API",
"description": "A Fabric library mod to read Google Sheets data using the Google Sheets API",
"authors": [
"ShiroJR1811 - Dev"
],
Expand All @@ -27,8 +27,5 @@
"minecraft": "~1.18.2",
"java": ">=17",
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
}
}

0 comments on commit 75ca6e5

Please sign in to comment.