semvec/pypi-packages huggingface dataset:
markdown-embed 0.1
A Django app to embed custom contents in markdown.
License: BSD License
Requires Python: >=3.7

# README

[![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter)](https://github.com/pydanny/cookiecutter-django/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

* This is an API server for following gitbook
  * [Algorith](https://seanhwangg.gitbook.io/algorithm/)
  * [Language](https://seanhwangg.gitbook.io/language/)
  * [Theory](https://seanhwangg.gitbook.io/theory/)

## Goal

1. [Gitbook](https://seanhwangg.gitbook.io/home#gitbook) doesn't have content embedding, so [mannually done](classroom/gitbook/management/commands/deploy_repository.py)
1. Materials are everywhere -> Combine github, Google form, youtube in a Markdown
1. Student’s ability is different -> Recommend different problems for each student
1. Students shouldn't see answer directly -> Only show answers from user with his/her own solution

## Diagram

* django-admin graph_models user gitbook problem -g -o images/models.png --no-inheritance
  ![Class Diagram](images/models.png)

![Usecase Diagram](images/20210416_162126.png)

## API

> django-admin cli

* deploy_repository
* crawl_problems
* crawl_solutions
  * -s BJ

## Development

* Using docker (preferred)

```sh
# 1. Run
docker-compose -f docker/local.yml up --build

# 2. Backups
docker cp 9c5c3f055843:/backups ./backups  # List
docker cp 9c5c3f055843:/backups ./backups  # Grep
docker-compose -f local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz  # Restore
```

* Local env

```sh
# 1. ~/.rc
export DJANGO_SETTINGS_MODULE="config.settings.local"
export USE_DOCKER="false"
export DATABASE_URL="sqlite:///db.sqlite3"
export ALGORITHM_PATH="/Users/sean/algorithm"
export LANGUAGE_PATH="/Users/sean/language"
export THEORY_PATH="/Users/sean/theory"
export PRIVATE_PATH="/Users/sean/private"

# 2. Run
python3 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
python3 -m script.test (--django / --server / [--log_level 10...50])

# 3. Internalization
django-admin makemessages -l 'ko' -i venv
```

### Data

* [Backup](data/) : Example of sample data
  * django-admin dumpdata problem.problemsite > data/0_problemsite.json
  * django-admin dumpdata gitbook.repository > data/1_gitbook.json
* See and download Sample Data
  * django-admin loaddata data/*

### Test

* [pytest](https://seanhwangg.gitbook.io/language/python/intro#pytest)
* [Typing with mypy](https://seanhwangg.gitbook.io/language/python/intro#typing)
* [coverage](https://seanhwangg.gitbook.io/language/python/intro#coverage)

```sh
# 1. Test clis
mypy classroom
pytest -W error::UserWarning
coverage report -m pytest
```

### Deploy

```sh
docker-compose -f production.yml up --force-recreate -d --build
```
markdown-classroom 0.1
A Django app to manage students in a classroom.
License: BSD License
Requires Python: >=3.7

# README

[![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter)](https://github.com/pydanny/cookiecutter-django/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

* This is an API server for following gitbook
  * [Algorith](https://seanhwangg.gitbook.io/algorithm/)
  * [Language](https://seanhwangg.gitbook.io/language/)
  * [Theory](https://seanhwangg.gitbook.io/theory/)

## Goal

1. [Gitbook](https://seanhwangg.gitbook.io/home#gitbook) doesn't have content embedding, so [mannually done](classroom/gitbook/management/commands/deploy_repository.py)
1. Materials are everywhere -> Combine github, Google form, youtube in a Markdown
1. Student’s ability is different -> Recommend different problems for each student
1. Students shouldn't see answer directly -> Only show answers from user with his/her own solution

## Diagram

* django-admin graph_models user gitbook problem -g -o images/models.png --no-inheritance
  ![Class Diagram](images/models.png)

![Usecase Diagram](images/20210416_162126.png)

## API

> django-admin cli

* deploy_repository
* crawl_problems
* crawl_solutions
  * -s BJ

## Development

* Using docker (preferred)

```sh
# 1. Run
docker-compose -f docker/local.yml up --build

# 2. Backups
docker cp 9c5c3f055843:/backups ./backups  # List
docker cp 9c5c3f055843:/backups ./backups  # Grep
docker-compose -f local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz  # Restore
```

* Local env

```sh
# 1. ~/.rc
export DJANGO_SETTINGS_MODULE="config.settings.local"
export USE_DOCKER="false"
export DATABASE_URL="sqlite:///db.sqlite3"
export ALGORITHM_PATH="/Users/sean/algorithm"
export LANGUAGE_PATH="/Users/sean/language"
export THEORY_PATH="/Users/sean/theory"
export PRIVATE_PATH="/Users/sean/private"

# 2. Run
python3 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
python3 -m script.test (--django / --server / [--log_level 10...50])

# 3. Internalization
django-admin makemessages -l 'ko' -i venv
```

### Data

* [Backup](data/) : Example of sample data
  * django-admin dumpdata problem.problemsite > data/0_problemsite.json
  * django-admin dumpdata gitbook.repository > data/1_gitbook.json
* See and download Sample Data
  * django-admin loaddata data/*

### Test

* [pytest](https://seanhwangg.gitbook.io/language/python/intro#pytest)
* [Typing with mypy](https://seanhwangg.gitbook.io/language/python/intro#typing)
* [coverage](https://seanhwangg.gitbook.io/language/python/intro#coverage)

```sh
# 1. Test clis
mypy classroom
pytest -W error::UserWarning
coverage report -m pytest
```

### Deploy

```sh
docker-compose -f production.yml up --force-recreate -d --build
```