Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-ji committed Aug 14, 2024
1 parent 935c450 commit bb9fbf1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ import mdocfile
df = mdocfile.read('my_mdoc_file.mdoc')
```

`Mdoc.from_string().as_dataframe()` will return the contents of string mdoc data as a pandas dataframe.
This is useful for mdoc data that is not stored in a file (e.g. from a database or a web request).

```python
from mdocfile.data_models import Mdoc

mdoc_data = ...

mdoc = Mdoc.from_string(mdoc_data).as_dataframe()
```

For writing valid mdoc files, please see
[writing mdoc files](https://teamtomo.org/mdocfile/writing/).



# Installation

pip:

```shell
pip install mdocfile
```

# Parsing from text

`Mdoc.from_string().as_dataframe()` will return the contents of string mdoc data as a pandas dataframe.
This is useful for mdoc data that is not stored in a file (e.g. from a database or a web request).

```python
from mdocfile.data_models import Mdoc

mdoc_data = ...

mdoc = Mdoc.from_string(mdoc_data).as_dataframe()
```
26 changes: 14 additions & 12 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ import mdocfile
df = mdocfile.read('my_mdoc_file.mdoc')
```

`Mdoc.from_string().as_dataframe()` will return the contents of string mdoc data as a pandas dataframe.
This is useful for mdoc data that is not stored in a file (e.g. from a database or a web request).

```python
from mdocfile.data_models import Mdoc

mdoc_data = ...

mdoc = Mdoc.from_string(mdoc_data).as_dataframe()
```

---

For writing valid mdoc files, please see [writing mdoc files](./writing.md).
Expand All @@ -50,4 +39,17 @@ pip:

```shell
pip install mdocfile
```
```

# Parsing from text

`Mdoc.from_string().as_dataframe()` will return the contents of string mdoc data as a pandas dataframe.
This is useful for mdoc data that is not stored in a file (e.g. from a database or a web request).

```python
from mdocfile.data_models import Mdoc

mdoc_data = ...

mdoc = Mdoc.from_string(mdoc_data).as_dataframe()
```

0 comments on commit bb9fbf1

Please sign in to comment.