# dialogify


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

[The Python Standard
Library](https://docs.python.org/3/library/index.html) documentation is
very helpful for learning Python. So is
[Solveit](https://solve.it.com/)! Solveit is jupyter notebook + AI with
superpowers. Learning programming is so much fun and productive with AI.
Therefore, I wanted to convert these html python documentation pages
into solveit dialogues, which comprise small pieces of notes and code
messages with appropriate headings, which can be extracted from the
pages’ table of contents.

How it works:

- We first get the html from the python documentation web page.
- We turn it into `(msg_type, element)` where `msg_type` is `note` or
  `code` and `element` is soup element.
- Turn `element`s into appropriate solveit messages for the dialog.

The goal is to use `#` for the title, `##` for subheading, and `###` for
each function definition from the docs.

## Installation

Install latest from the GitHub
[repository](https://github.com/galopyz/dialogify):

``` sh
$ pip install git+https://github.com/galopyz/dialogify.git
```

or from [pypi](https://pypi.org/project/dialogify/)

``` sh
$ pip install dialogify
```

## How to use

To create a solveit dialog from python documentation, we need to pass
the url to
[`mk_dialog`](https://galopyz.github.io/dialogify/core.html#mk_dialog).
Below code creates solveit messages after that message.

``` python
from dialogify.core import *

mk_dialog('https://docs.python.org/3.12/library/random.html')
```

Here is an [example
dialog](https://share.solve.it.com/d/d9937162808e0878070a922abaab3e5d)
on solveit from
[random](https://docs.python.org/3.12/library/random.html) python
libary. It also works on [Built-in
Functions](https://docs.python.org/3.12/library/functions.html).
