YAWT

YAWT (Yet Another Weblog Tool) is my blogging engine. To get it running:

Then run yawt like this:

Run the Tests

cd ~/sandbox/YawtFlask
nosetests --with-spec --spec-color

The spec plugin will generate testdox documentation, while the spec-color will colour everything red/green.

To run the system tests:

nosetests --with-spec --spec-color -w yawt/systemtest

Coverage

Test coverage is done via a package call coverage.py. Coverage.py will measure coverage of everything, even your test files. You can skip files via a .coveragerc, but the nose cover plugin provides some features that are good enough for me:

Produce a coverage report like this:

nosetests --with-coverage --cover-inclusive --cover-package=yawt --cover-package=yawtext

Note that this is how I integrate with coveralls. My travis.yml file looks like this:

language: python
python:
  - "2.7"

before_install:
  - sudo apt-get install cmake python-dev libffi-dev

# command to install dependencies
install:
  - "pip install -r requirements-test.txt" 
  - "pip install coveralls"

# command to run tests
script:  nosetests --with-coverage --cover-package=yawt --cover-package=yawtext --cover-inclusive

after_success: coveralls

Note the script entry at the end, calling nosetests, and the after_success entry, calling coveralls.

Some YAWT Archtecture Ideas

initialization

article info indexing (git hook or walk)

article info loading (would run during a search)

full article load (includes article info)

indexing

make whoosh API available

nothing to do here, this plugin is the thing that does the indexing

-

-

markdown

-

add markdown metadata to article info, plus indicator that you did so

if not indexed, read article from disk and add metadata (discarding content), if indexed, skip

same as article info loading, plus replace content with converted HTML

git

-

find (git_ctime, git_mtime, git_author) from repo, add to article info

if not indexed, do the same as the indexing hook

same as article info loading

smart attributes

-

use config to implement "fallback" attributes (like "create_time" can come from markdown metadata or the git attribute if absent or the file system if all else fails

if not indexed, do the same as the indexing hook

same as article info loading

tagging

add tagging routes to trigger searches

handled by the markdown plugin

handled by the markdown plugin

handled by the markdown plugin

archives

add archive routes to trigger searches

handled by the smart attributes plugin

handled by the smart attributes plugin

handled by the smart attributes plugin

YAWT Concepts

Some ideas (THIS CAN CHANGE):

Workflow Ideas

YAWT revolves around several core ideas:

Plugins versus Flask Extensions

Post and Templates

In terms of the relationship between posts and templates, etc., YAWT takes the following approach.

As an example, let's say you have two users:

It's conceivable that Bob would not want the default YAWT behaviour of showing all posts in a category, even the posts in the sub-category. He might just want to show the phtos in a category, and show the sub-categories somewhere else, as links. Susan, on the other hand, may treat every photo as a "post" into itself, and have no qualms about the default YATW behaviour.

The point to take home here is that there is no notion of an "album" in YAWT. What we normally call an "album" - a collection of photos displayed in a table, for example - is implemented in the template. It's all in how you choose to display your photos.

Yawt (last edited 2015-09-01 22:36:10 by DesmondRivet)