Skip to content

Commit a4f02fb

Browse files
committed
Update Docs
1 parent 9e8ff86 commit a4f02fb

File tree

5 files changed

+78
-32
lines changed

5 files changed

+78
-32
lines changed

.github/workflows/docs.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
default: site
1414

1515
env:
16-
logo: "https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo128.png"
16+
logo: "https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg"
1717
link: ${{ github.event.repository.html_url }}
1818

1919
jobs:
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: "Checkout"
30-
uses: actions/checkout@v5
30+
uses: actions/checkout@v6
3131

3232
- name: "Debug CTX github"
3333
continue-on-error: true
@@ -53,29 +53,29 @@ jobs:
5353
python -m pip install -U pdoc
5454
python -m pip install -e .
5555
python -m pdoc -t docs -o "${{ inputs.path }}" \
56-
--favicon "${{ env.logo }}" \
5756
--logo "${{ env.logo }}" \
5857
--logo-link "${{ env.link }}" \
5958
vultr
6059
61-
- name: "Update Permissions"
60+
- name: "Fix Docs"
61+
working-directory: ${{ inputs.path }}
6262
run: |
63-
chmod -c -R +rX "${{ inputs.path }}" | while read name; do
64-
echo "::notice::Fixed invalid file permissions: ${name}"
65-
done
63+
mv -f vultr.html index.html
64+
65+
#- name: "Update Permissions"
66+
# run: |
67+
# chmod -c -R +rX "${{ inputs.path }}" | while read name; do
68+
# echo "::notice::Fixed invalid file permissions: ${name}"
69+
# done
6670

6771
- name: "List Artifacts"
68-
env:
69-
path: ${{ inputs.path }}
72+
working-directory: ${{ inputs.path }}
7073
run: |
71-
echo "::group::ls"
72-
ls -lAhR "${path}"
73-
echo "::endgroup::"
74-
echo "::group::tree"
75-
tree "${path}"
74+
results="$(tree . || ls -lAhR .)"
75+
echo "::group::results"
76+
echo "${results}"
7677
echo "::endgroup::"
77-
results="$(tree "${path}")"
78-
markdown='Artifacts:\n```text\n'"${results}"'\n```'
78+
markdown='Artifacts: `${{ inputs.path }}`\n```text\n'"${results}"'\n```'
7979
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
8080
8181
- name: "Upload Pages Artifact"

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: "Checkout"
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030

3131
- name: "Debug event.json"
3232
continue-on-error: true

docs.ps1

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@ if ($c) {
2222
}
2323
}
2424

25-
python -m pdoc -t .\docs\ -p 8008 `
26-
--favicon "https://df.cssnr.com/raw/logo128.png" `
27-
--logo "https://df.cssnr.com/raw/logo128.png" `
25+
if ($b) {
26+
Write-Host -ForegroundColor Yellow "Building Docs..."
27+
python -m pdoc -t .\docs\ -o site `
28+
--logo "https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg" `
2829
--logo-link "https://github.com/cssnr/vultr-python" `
2930
vultr
31+
} else {
32+
Write-Host -ForegroundColor Green "Serving Docs..."
33+
python -m pdoc -t .\docs\ -p 8000 -h 0.0.0.0 `
34+
--logo "https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg" `
35+
--logo-link "https://github.com/cssnr/vultr-python" `
36+
vultr
37+
}
3038

39+
#--favicon "https://df.cssnr.com/raw/logo128.png" `
3140
#-e "vultr=https://github.com/cssnr/vultr-python/blob/updates/src/vultr/" `
32-
33-
#if ($b) {
34-
# Write-Host -ForegroundColor Green "Building Docs..."
35-
# zensical build
36-
#} else {
37-
# zensical serve
38-
#}

docs/index.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ python -m pip install vultr-python
3939

4040
## Usage
4141

42-
You will need to create an api key and whitelist your IP address. Most functions do not work without an API Key.
42+
You will need to create an api key and whitelist your IP address for most functions.
4343

4444
- [https://my.vultr.com/settings/#settingsapi](https://my.vultr.com/settings/#settingsapi)
4545

46-
Initialize the class with your API Key or with the `VULTR_API_KEY` environment variable.
46+
Initialize the `Vultr` class with your API Key or use the `VULTR_API_KEY` environment variable.
4747

4848
```python
4949
from vultr import Vultr
@@ -88,16 +88,22 @@ instance = vultr.create_instance(available[0], plan, **data)
8888
Arbitrary Methods `get`, `post`, `patch`, `delete`
8989

9090
```python
91-
# vultr.get('url', params)
9291
instances = vultr.get('instances', {'type': 'vc2'})
93-
# vultr.post('url', **kwargs)
9492
sshkey = vultr.post('ssh-keys', name='key-name', ssh_key='ssh-rsa AAAA...')
95-
# vultr.delete('url')
9693
vultr.delete(f"instances/019ad1a8-2aa3-7650-83d1-8520d65ed6af")
9794
```
9895

9996
Error Handling
10097

98+
```python
99+
>>> instance = vultr.create_instance("atl", "vc2-1c-0.5gb-v6", **data)
100+
Traceback (most recent call last):
101+
...
102+
vultr.vultr.VultrException: Error 400: Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.
103+
```
104+
105+
Using the `VultrException` class
106+
101107
```python
102108
from vultr import VultrException
103109

docs/module.html.jinja2

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
{% extends "default/module.html.jinja2" %}
22
{% block title %}Vultr Python{% endblock %}
3+
{% block head %}
4+
5+
<link rel="icon" sizes="any" href="https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg"/>
6+
<link rel="apple-touch-icon" href="https://raw.githubusercontent.com/cssnr/vultr-python/refs/heads/master/.github/assets/logo.svg"/>
7+
8+
<meta name="author" content="Shane"/>
9+
<meta name="title" content="Vultr Python"/>
10+
<meta name="description" content="Python 3 wrapper for the Vultr API v2."/>
11+
12+
<meta property="og:type" content="website">
13+
<meta property="og:site_name" content="Vultr Python API v2">
14+
<meta property="og:title" content="Vultr Python">
15+
<meta property="og:description" content="Python 3 wrapper for the Vultr API v2.">
16+
<meta property="og:image" content="https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo256.png">
17+
<meta property="og:image:alt" content="Vultr Python">
18+
<meta property="twitter:card" content="summary">
19+
<meta property="twitter:site" content="Vultr Python API v2">
20+
<meta property="twitter:title" content="Vultr Python">
21+
<meta property="twitter:description" content="Python 3 wrapper for the Vultr API v2.">
22+
<meta property="twitter:image" content="https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/vultr-python/logo256.png">
23+
<meta property="twitter:image:alt" content="Vultr Python">
24+
25+
<meta name="darkreader-lock">
26+
27+
<script type="text/javascript">
28+
document.addEventListener('DOMContentLoaded', () => {
29+
console.log('processing:', globalThis.location)
30+
for (const el of document.querySelectorAll('a')) {
31+
if (el.host && el.host !== globalThis.location.host) {
32+
console.log('el:', el)
33+
el.target = '_blank'
34+
el.rel = 'noopener'
35+
}
36+
}
37+
})
38+
</script>
39+
40+
{% endblock %}

0 commit comments

Comments
 (0)