Skip to content

Commit

Permalink
create ipython extension (#79)
Browse files Browse the repository at this point in the history
* create ipython extension

* update changelog

* also map markata to the instance

* update changelog
  • Loading branch information
WaylonWalker committed Sep 29, 2022
1 parent ac46fd4 commit 5cd68dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
server-side redirects fail, or the user does not have the ability to issue. #76
* create a slugify migration script #82
* DeepMerge `config_overrides` with config in post render methods #91 0.5.0.dev13
* Create ipython extension to automatically load markata #79 0.5.0.dev15

### sluggify paths

Expand Down Expand Up @@ -138,6 +139,16 @@ config_overrides:
- value: <link rel='stylesheet' href='/my-extra-styles.css' />
```

## ipython extension

Markata has an ipython extension if you want ipython to automatically load with
an instance of `Markata` mapped to `m` and `markata` you can add the following
to your `~/.ipython/profile_default/ipython_config.py`

``` python
c.InteractiveShellApp.extensions.append('markata')
```
## 0.4.1

* Issue FutureWarning for upcoming change to slugify change that will change urls
Expand Down
5 changes: 5 additions & 0 deletions markata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,3 +441,8 @@ def try_sort(a: Any) -> int:
for a in articles
if eval(filter, {**a.to_dict(), "timedelta": timedelta, "post": a}, {})
]


def load_ipython_extension(ipython):
ipython.user_ns["m"] = Markata()
ipython.user_ns["markata"] = ipython.user_ns["m"]

0 comments on commit 5cd68dd

Please sign in to comment.