Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create ipython extension #79

Merged
merged 4 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]