Skip to content

Commit

Permalink
Pydantic all the things - release 0.8.0 (#157)
Browse files Browse the repository at this point in the history
* pydantic all the things (#149)

This turned into a GIANT PR, everything is working, but there seems to be an endless number of nice to haves. This needs to just be merged and let the nice to haves get their own PR.  It is currently working, but there may be some rough edges on the pre-release.

* Bump version: 0.7.4 → 0.8.0.dev0

* fix: cache issue set the date after dateparser runs

* Bump version: 0.8.0.dev0 → 0.8.0.dev1

* clean up load

* fix default plugin order

* Bump version: 0.8.0.dev1 → 0.8.0.dev2

* create sitemap for feeds

* Bump version: 0.8.0.dev2 → 0.8.0.dev3

* remove double slashes in slugs

* expose the Posts model

* Bump version: 0.8.0.dev3 → 0.8.0.dev4

* expose post to the template

* Bump version: 0.8.0.dev4 → 0.8.0.dev5

* escape html in descriptions

* Bump version: 0.8.0.dev5 → 0.8.0.dev6

* link manifest in templates not here, it's too slow

* docs

* fix CHANGELOG

* fix unused import

* update actions/checkout

* Bump version: 0.8.0.dev6 → 0.8.0.dev7

---------

Co-authored-by: autobump <[email protected]>
  • Loading branch information
WaylonWalker and autobump authored Jan 2, 2024
1 parent af5d3cf commit 8061f97
Show file tree
Hide file tree
Showing 75 changed files with 6,257 additions and 2,224 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/deploy-markata-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,12 @@ jobs:
build-deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - name: Get current date
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

# - name: Cache
# uses: actions/cache@v2
# with:
# path: .markata.cache
# key: ${{ runner.os }}-${{ hashfiles('markata.toml') }}-${{ steps.date.outputs.date }}-markata
# restore-keys: |
# ${{ runner.os }}-${{ hashfiles('markata.toml') }}-markata
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: install markata
run: pip install -e .
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release-markata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_dispatch:
push:
paths:
- 'markata/**'
- 'pyproject.toml'
- "markata/**"
- "pyproject.toml"

env:
HATCH_INDEX_USER: __token__
Expand All @@ -15,9 +15,10 @@ jobs:
release-markata:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: waylonwalker/hatch-action@v2
- uses: actions/checkout@v4
- uses: waylonwalker/hatch-action@v3
with:
before-command: "test-lint"

before-command: "lint-format"
env:
# required for gh release
GH_TOKEN: ${{ github.token }}
78 changes: 73 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Markata Changelog

## 0.8.0

- pydantic support

### Pydantic Support

Now plugins are configured through a pydantic Config object.

### breaking changes

There are a number of breaking changes going into 0.8.0. Use caution when
upgrading.

#### glob config is now under markata.glob

```diff
- [markata]
- glob_patterns = "pages/**/*.md"
+ [markata.glob]
+ glob_patterns = "pages/**/*.md"
```

#### Feeds are now a list

```toml
[markata.feeds.published]
template="pages/templates/archive_template.html"
card_template = "pages/templates/feed_card.html"
filter="date<=today and templateKey in ['blog-post', 'til'] and status.lower()=='published'"
sort="date"
```

> old
```toml
[[markata.feeds.published]]
template="pages/templates/archive_template.html"
card_template = "pages/templates/feed_card.html"
filter="date<=today and templateKey in ['blog-post', 'til'] and status.lower()=='published'"
sort="date"
```

> new
### markata.summary.filter_count is now a list

The old way was to set up a dict, where the keys were the name, now its a list
of Objects with an explicit name field.

```toml
[markata.summary.filter_count.drafts]
filter="published == 'False'"
color='red'
```

> Old
```toml
[[markata.summary.filter_count]]
name='drafts'
filter="published == 'False'"
color='red'
```

## 0.7.4

- Fix: Icon resize broken from PIL 10.0.0 release
Expand Down Expand Up @@ -41,11 +105,15 @@ markata tui

- Fix: broken `markata new` command due to pydantic v2 compatability with copier.

## 0.6.2

Update License and Security files.

## 0.6.1

- Fix: allow feeds to be used from within markdown
- Fix: allow feeds to be used from within Markdown.

### Feeds in markdown
### Feeds in Markdown

```markdown
{% for post in markata.feeds.docs.posts %}
Expand All @@ -72,7 +140,7 @@ markata tui
- Fix: properly set the pyinstrument profiler to prevent recurrsion errors
0.6.dev13 #123
- Clean: cli attributes (`runner`, `summary`, `server`, `plugins`) are now
added as Markata properties through `register_atter` rather than directly to
added as Markata properties through `register_attr` rather than directly to
the class 0.6.0.dev13 #107
- Fix: Markata tui will remain running even when the runner fails 0.6.0.dev13
#107
Expand All @@ -90,12 +158,12 @@ markata tui

wikilinks are now enabled by default ex: `[[home-page]]`. This will create a
link `<a class="wikilink" href="/home-page/">home-page</a>`. This will
automagically just work if you leave `markata.plugins.flat_slug` plugin enabled
automagically work if you leave `markata.plugins.flat_slug` plugin enabled
(which is by default).

> ProTip: this was highly inspired by the
> [marksman-lsp](https://github.com/artempyanykh/marksman) by
> [artempyanykh](https://github.com/artempyanykh/) which can autocomplete post
> [artempyanykh](https://github.com/artempyanykh/), which can autocomplete post
> links in this style for you.
[[home-page]]
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@
</em>
</p>

## Coming soon

pydantic all the things. All post objects and config will become pydantic objects. This will allow for validation to happen early, and referencing post attributes or config, it can be assumed that they exist whether they were explicitly created or cohersed to their defaults early in the build.

---

A static site generator that will give you a great site with many standard web
features like rss, sitemaps, and seo tags, out of the box. Running `markata
build` will get you a that only requires you to write Markdown. If you have
additional features that you want, don't worry, since markata is built
completely on plugins you can develop and install your own plugins to add the
features you want.

> This has been a pet project for me to learn library development, plugin
> driven design, diskcache, and more. It is the core of what builds my own site [waylonwalker.com](https://waylonwalker.com).
## Disclaimer

Make sure that you pin down what version of markata you want to use. If you
are starting a new project that's probably the latest version from
[pypi](https://pypi.org/project/markata). Things are likely to change in major
releases, I do my best to document them, and not to break patches.

## QuickStart

Markata is fully configurable through a `markata.toml` file, but the defaults
Expand All @@ -46,6 +50,9 @@ echo '# My First Post' > first-post.md
echo '# Hello World' > hello-world.md
```

> This example shows how you can build a site from only a single markdown
> file.
### Build your site

Install markata into your virtual environment and run `markata build`. It will
Expand Down
106 changes: 106 additions & 0 deletions docs/admonitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: Admonitions
description: This is what the default admonition styles look like and how to create them.
---

???+ note open by default
you can open a details tab with '+'

<!-- prettier-ignore -->
??? note closed by default
you can open a details tab with '+'

## all of the admonitions

<!-- prettier-ignore -->
!!! note
a note

<!-- prettier-ignore -->
!!! abstract
an abstract

<!-- prettier-ignore -->
!!! info

admonitions

<!-- prettier-ignore -->
!!! tip

You should think about using admonitions

<!-- prettier-ignore -->
!!! success

Run Successful!

<!-- prettier-ignore -->
!!! question

What do you think of this?

<!-- prettier-ignore -->
!!! source
Add some source code.
```python
print('hello world')

````
<!-- prettier-ignore -->
!!! warning
a warning
<!-- prettier-ignore -->
!!! failure
a failure
<!-- prettier-ignore -->
!!! danger
some danger
<!-- prettier-ignore -->
!!! bug
a bug
<!-- prettier-ignore -->
!!! example
an example
``` python
print('hello world')
```
<!-- prettier-ignore -->
!!! quote
a quote
> include a nice quote
<!-- Background #282a36 -->
<!-- Current Line #44475a -->
<!-- Foreground #f8f8f2 -->
<!-- Comment #6272a4 -->
<!-- Cyan #8be9fd -->
<!-- Green #50fa7b -->
<!-- Orange #ffb86c -->
<!-- Pink #ff79c6 -->
<!-- Purple #bd93f9 -->
<!-- Red #ff5555 -->
<!-- Yellow #f1fa8c -->
<!-- note: $drac-dark-yellow, -->
<!-- abstract: $drac-cyan, -->
<!-- info: $drac-light-blue, -->
<!-- tip: $drac-teal, -->
<!-- success: $drac-green, -->
<!-- question: $drac-light-green, -->
<!-- warning: $drac-orange, -->
<!-- failure: $drac-dark-red, -->
<!-- danger: $drac-red, -->
<!-- bug: $drac-dark-pink, -->
<!-- example: $drac-purple, -->
<!-- quote: $drac-grey -->
````
Loading

0 comments on commit 8061f97

Please sign in to comment.