Skip to content

Commit

Permalink
Merge pull request #2 from airtai/1-project-setup
Browse files Browse the repository at this point in the history
Set up nbdev
  • Loading branch information
harishmohanraj authored Aug 8, 2023
2 parents 8851513 + b0f102d commit 11d659e
Show file tree
Hide file tree
Showing 30 changed files with 697 additions and 31 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Deploy nbdev-mkdocs generated documentation to GitHub Pages

on:
push:
branches: [ "main", "master" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: airtai/workflows/nbdev-mkdocs-ghp@main
7 changes: 7 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: CI
on: [workflow_dispatch, pull_request, push]

jobs:
test:
runs-on: ubuntu-latest
steps: [uses: fastai/workflows/nbdev-ci@master]
77 changes: 46 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -49,7 +50,6 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -72,7 +72,6 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -83,9 +82,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,22 +91,7 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -138,6 +120,24 @@ venv.bak/
# mkdocs documentation
/site

# docusaurus documentation
docusaurus/node_modules
docusaurus/docs
docusaurus/build

docusaurus/.docusaurus
docusaurus/.cache-loader

docusaurus/.DS_Store
docusaurus/.env.local
docusaurus/.env.development.local
docusaurus/.env.test.local
docusaurus/.env.production.local

docusaurus/npm-debug.log*
docusaurus/yarn-debug.log*
docusaurus/yarn-error.log*

# mypy
.mypy_cache/
.dmypy.json
Expand All @@ -146,15 +146,30 @@ dmypy.json
# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
# PyCharm
.idea

# nbdev related stuff
.gitattributes
.gitconfig
_proc
_docs

# Cython debug symbols
cython_debug/
nbs/asyncapi
nbs/guides/asyncapi
nbs/.last_checked
nbs/_*.ipynb
token
*.bak

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# nbdev_mkdocs
mkdocs/docs/
mkdocs/site/

# Ignore trashbins
.Trash*


# nbdev_mkdocs
mkdocs/docs/
mkdocs/site/
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include settings.ini
include LICENSE
include CONTRIBUTING.md
include README.md
recursive-exclude * __pycache__
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fastkafka-gen

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

This file will become your README and also the index of your
documentation.

## Install

``` sh
pip install fastkafka_gen
```

## How to use

Fill me in please! Don’t forget code examples:

``` python
1+1
```

2
2 changes: 2 additions & 0 deletions docker/.semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dev.yml

22 changes: 22 additions & 0 deletions docker/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3"
services:
fastkafka-gen-devel: #nosemgrep
image: ghcr.io/airtai/nbdev-mkdocs
hostname: $DOCKER_COMPOSE_PROJECT-devel
container_name: $DOCKER_COMPOSE_PROJECT-devel
ports:
- "${PORT_PREFIX}8888:8888"
- "${PORT_PREFIX}4000:4000"
- "${PORT_PREFIX}6006:6006"
volumes:
- $AIRT_PROJECT:/work/fastkafka-gen
- /etc/passwd:/etc/passwd
- /etc/group:/etc/group
- /etc/shadow:/etc/shadow
- $HOME/.ssh:$HOME/.ssh
- $HOME/.gitconfig:/root/.gitconfig
environment:
USER: $USER
USERNAME: $USERNAME
PRESERVE_ENVS: $PRESERVE_ENVS
OPENAI_API_KEY: $OPENAI_API_KEY
1 change: 1 addition & 0 deletions fastkafka_gen/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1"
8 changes: 8 additions & 0 deletions fastkafka_gen/_modidx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Autogenerated by nbdev

d = { 'settings': { 'branch': 'main',
'doc_baseurl': '/fastkafka-gen',
'doc_host': 'https://airtai.github.io',
'git_url': 'https://github.com/airtai/fastkafka-gen',
'lib_path': 'fastkafka_gen'},
'syms': {'fastkafka_gen.core': {'fastkafka_gen.core.foo': ('core.html#foo', 'fastkafka_gen/core.py')}}}
7 changes: 7 additions & 0 deletions fastkafka_gen/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb.

# %% auto 0
__all__ = ['foo']

# %% ../nbs/00_core.ipynb 3
def foo(): pass
29 changes: 29 additions & 0 deletions mkdocs/docs_overrides/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.md-typeset .admonition.caution,
.md-typeset details.caution {
border-color: #ff9100;
}
.md-typeset .caution > .admonition-title,
.md-typeset .caution > summary {
background-color: #ff91001a;
}
.md-typeset .caution > .admonition-title::before,
.md-typeset .caution > summary::before {
background-color: #ff9100;
-webkit-mask-image: var(--md-admonition-icon--warning);
mask-image: var(--md-admonition-icon--warning);
}

.md-typeset .admonition.important,
.md-typeset details.important {
border-color: #ff1744;
}
.md-typeset .important > .admonition-title,
.md-typeset .important > summary {
background-color: #ff17441a;
}
.md-typeset .important > .admonition-title::before,
.md-typeset .important > summary::before {
background-color: #ff1744;
-webkit-mask-image: var(--md-admonition-icon--danger);
mask-image: var(--md-admonition-icon--danger);
}
Binary file added mkdocs/docs_overrides/images/compass-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
18 changes: 18 additions & 0 deletions mkdocs/docs_overrides/js/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.typesetPromise()
})


106 changes: 106 additions & 0 deletions mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Site
site_name: fastkafka-gen
site_url: https://airtai.github.io/fastkafka-gen
site_author: airt
site_description: The FastKafka-gen library uses advanced AI to generate FastKafka
code from user descriptions, speeding up FastKafka app development.

# Repository
repo_name: fastkafka-gen
repo_url: https://github.com/airtai/fastkafka-gen
edit_uri: ""

copyright: 2023 onwards, airt

docs_dir: docs
site_dir: site

plugins:
- literate-nav:
nav_file: SUMMARY.md
- search
- mkdocstrings:
handlers:
python:
import:
- https://docs.python.org/3/objects.inv
options:
heading_level: 2
show_category_heading: true
show_root_heading: true
show_root_toc_entry: true
show_signature_annotations: true
show_if_no_docstring: true

markdown_extensions:
- md_in_html
- pymdownx.arithmatex:
generic: true
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.emoji
- pymdownx.magiclink
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tasklist
- pymdownx.highlight:
linenums: false
- pymdownx.snippets:
check_paths: true
- pymdownx.tabbed:
alternate_style: true
- admonition
- toc:
permalink: "¤"
# - callouts
theme:
name: material
custom_dir: site_overrides
features:
- navigation.instant
# - navigation.tabs
# - navigation.tabs.sticky
# - navigation.sections
# - navigation.expand
- navigation.indexes
- navigation.top
# - toc.integrates
- search.suggest
- search.highlight
- search.share
palette:
- scheme: slate
primary: black
accent: yellow
toggle:
icon: material/toggle-switch
name: Switch to light mode
- scheme: default
primary: black # deep orange
accent: red
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
icon:
repo: fontawesome/brands/github
# repo: fontawesome/brands/gitlab
logo: material/compass-outline
# admonition:
# <type>: <icon>
favicon: overrides/images/compass-outline.png

extra_css:
- overrides/css/extra.css

extra_javascript:
- overrides/js/extra.js
- overrides/js/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
extra:
version:
provider: mike
social_image: "https://opengraph.githubassets.com/1691483169.608266/airtai/fastkafka-gen"
Loading

0 comments on commit 11d659e

Please sign in to comment.