Skip to content

Commit

Permalink
feat: documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
npldevfr committed Jan 30, 2024
1 parent 8be0697 commit 97dbd8d
Show file tree
Hide file tree
Showing 9 changed files with 1,200 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
/vendor/
*.swp
*.swo
node_modules/
.idea
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<br />

<p align="center">
Expand All @@ -21,31 +19,46 @@ An unofficial PHP client for the <a href="https://liquipedia.net">Liquipedia</a>
[![Total Downloads](https://img.shields.io/packagist/dt/npldevfr/liquipedia-client.svg?style=flat-square)](https://packagist.org/packages/npldevfr/liquipedia-client)
</div>



## ✨ Features

👌&nbsp; Easy to use<br>
🔥&nbsp; Supports all Liquipedia API endpoints<br>
🔨&nbsp; Custom query builder<br>
🧩&nbsp; Extensible<br>
📚&nbsp; Well documented<br>
🧪&nbsp; Tested<br>



## 📦 Installation

Supports PHP >= 8.2

```bash
composer require npldevfr/liquipedia-client
```

## 🚀 Usage

```php
// todo
use Npldevfr\Liquipedia\ConditionsBuilder;
use Npldevfr\Liquipedia\Liquipedia;
use Npldevfr\Liquipedia\Meta\Endpoint;
use Npldevfr\Liquipedia\Meta\Wiki;

$liquipediaSdk = new Liquipedia('your-api-key');

// Get the last 10 matches of Team Liquid
$matches = $liquipediaSdk->query()
->endpoint(Endpoint::MATCHES)
->wikis(Wiki::LEAGUE_OF_LEGENDS)
->rawConditions('[[opponent::Team Liquid]]')
->limit(10)
->orderBy('date', 'desc')
->get()
);
```

## 🛠️ Development

```bash
git clone https://github.com/npldevfr/liquipedia-client
composer install
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vitepress
49 changes: 49 additions & 0 deletions docs/api-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
---

# Runtime API Examples

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:

```md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```

<script setup>
import { useData } from 'vitepress'

const { site, theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>

## More

Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
Binary file removed docs/example.png
Binary file not shown.
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "LiquipediaClient"
text: "The Liquipedia PHP Client documentation"
tagline: My great project tagline
actions:
- theme: brand
text: Markdown Examples
link: /markdown-examples
- theme: alt
text: API Examples
link: /api-examples

features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
---

85 changes: 85 additions & 0 deletions docs/markdown-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Markdown Extension Examples

This page demonstrates some of the built-in markdown extensions provided by VitePress.

## Syntax Highlighting

VitePress provides Syntax Highlighting powered by [Shikiji](https://github.com/antfu/shikiji), with additional features like line-highlighting:

**Input**

````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````

**Output**

```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```

## Custom Containers

**Input**

```md
::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::
```

**Output**

::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::

## More

Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
10 changes: 10 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"devDependencies": {
"vitepress": "1.0.0-rc.40"
},
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
}
}
Loading

0 comments on commit 97dbd8d

Please sign in to comment.