Skip to content

Commit

Permalink
plain quarto for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm committed Mar 23, 2024
1 parent c1076db commit eb402b6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 24 deletions.
42 changes: 30 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,34 @@ permissions:
on: ["workflow_dispatch", "push"]
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Upload to pages branch
uses: fastai/workflows/quarto-ghp@master
with:
version: '3.11'
- name: build
run: build.sh
- name: release upload
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
steps:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
with:
path: nbs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_docs"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: build
run: build.sh
- name: release upload
uses: softprops/action-gh-release@v1
with:
files: "dist/*"
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# This is meant to be run to setup and prep for committing a release
# use nbdev_bump_version to increment the version itself then rerun this to update README.md etc
# use nbdev_bump_version to increment the version itself then rerun this to update README.md _docs etc
pip install nbdev
nbdev_install
npx npm-check-updates -u # convenient way to freshen package.json on each release
npm install
npm run build
nbdev_clean
nbdev_export
nbdev_readme
nbdev_install_hooks
version=$(awk -F' = ' '/^version/{print $2}' settings.ini)
sed -i '' "s/{{ version }}/$version/g" README.md
echo "version: $version" > nbs/_variables.yml
nbdev_readme
quarto render nbs
2 changes: 1 addition & 1 deletion nbdev_squ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def abuseipdb(self):
"""
Returns an abuseipdb client
"""
return AbuseIPDB(API_KEY=self.config.abuseipdb_api_key)
return AbuseIPDB(api_key=self.config.abuseipdb_api_key)

@cached_property
def jira(self):
Expand Down
2 changes: 1 addition & 1 deletion nbs/01_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
" \"\"\"\n",
" Returns an abuseipdb client\n",
" \"\"\"\n",
" return AbuseIPDB(API_KEY=self.config.abuseipdb_api_key)\n",
" return AbuseIPDB(api_key=self.config.abuseipdb_api_key)\n",
"\n",
" @cached_property\n",
" def jira(self):\n",
Expand Down
1 change: 1 addition & 0 deletions nbs/_variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: 1.3.2
7 changes: 2 additions & 5 deletions nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"Below is how to install in a plain python 3.11+ environment\n",
"\n",
"```sh\n",
"https://github.com/wagov/nbdev-squ/releases/download/v{{ version }}/nbdev_squ-{{ version }}-py3-none-any.whl\n",
"https://github.com/wagov/nbdev-squ/releases/download/v{{< var version >}}/nbdev_squ-{{< var version >}}-py3-none-any.whl\n",
"```\n",
"\n",
"The installation can also be run in a notebook (we tend to use [JupyterLab Desktop](https://github.com/jupyterlab/jupyterlab-desktop) for local dev). The `SQU_CONFIG` env var indicates to nbdev_squ it should load the json secret *squconfig-`my_keyvault_tenantid`* from the `my_kevault_name` keyvault.\n",
"\n",
"```python\n",
"%pip install https://github.com/wagov/nbdev-squ/releases/download/v{{ version }}/nbdev_squ-{{ version }}-py3-none-any.whl\n",
"%pip install https://github.com/wagov/nbdev-squ/releases/download/v{{< var version >}}/nbdev_squ-{{< var version >}}-py3-none-any.whl\n",
"import os; os.environ[\"SQU_CONFIG\"] = \"{{ my_keyvault_name }}/{{ my_keyvault_tenantid }}\" \n",
"\n",
"from nbdev_squ import api\n",
Expand Down Expand Up @@ -201,9 +201,6 @@
"display_name": "python3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": ""
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion nbs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ website:
contents:
- index.ipynb
- 00_core.ipynb
- 01_api.ipynb
- 01_api.ipynb

0 comments on commit eb402b6

Please sign in to comment.