Skip to main content

static photo story generator

Project description

Lenscap

Lenscap is a static site generator for creating beautiful photo narratives

Write your stories in markdown and insert small snippets of code to add small groups of images.

Demo

Example

Given a directory structure of

kitten.md
photos/
    1.jpg
    2.jpg
    3.jpg

And a markdown file of

# Kittens

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pretium
elit sit amet posuere congue. Nam felis augue, pretium ac auctor quis,
facilisis non nunc. Nullam in erat magna. Duis rhoncus felis id erat
maximus, ac condimentum felis efficitur. Nunc ac mattis ante. Etiam sed
orci tortor. Ut gravida orci eu dictum vulputate. Vestibulum dui augue,
condimentum ac tempus ac, mollis non ante. Pellentesque aliquam, est vitae
sollicitudin tristique, tortor massa tincidunt nibh, eu tempus sem dolor
vitae diam. Proin sodales velit nec nisi euismod, id facilisis elit
consequat. Nam eros magna, vulputate ac turpis quis, rhoncus euismod justo.

```yaml
rows: 1, 2
items:
    - 1.jpg
    - 2.jpg
    - 3.jpg
```

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pretium
elit sit amet posuere congue. Nam felis augue, pretium ac auctor quis,
facilisis non nunc. Nullam in erat magna. Duis rhoncus felis id erat
maximus, ac condimentum felis efficitur.

Nunc ac mattis ante. Etiam sed orci tortor. Ut gravida orci eu dictum
vulputate. Vestibulum dui augue, condimentum ac tempus ac, mollis non ante.
Pellentesque aliquam, est vitae sollicitudin tristique, tortor massa
tincidunt nibh, eu tempus sem dolor vitae diam. Proin sodales velit nec
nisi euismod, id facilisis elit consequat. Nam eros magna, vulputate ac
turpis quis, rhoncus euismod justo.

You can produce content like the demo page by running lenscap kitten.md.

Installation

$ pip install lenscap

Usage

Throw some high resolution photos into a photos/ directory and then write your essay in a markdown file. You can use regular markdown and specify your photo layouts using fenced blocks.

The fenced in block uses simple yaml syntax to specify your meta data. All you really need to do is tell it how many rows of photos you want and how many photos are in each row. Then you list the files and lenscap does the rest.

So, if you want to have a 2 photos over 3, you'd say rows: 2, 3. If you want a single image, you can skip the rows directive.

Lenscap will check that your photos are big enough in terms of resolution and will refuse to continue if the photos are too small. You can also tell lenscap to resize your high resolution photos to just the right size.

You invoke the lenscap command on your file:

$ lenscap kitten.md

And this will create a file called kitten.html in the same directory.

Usage: lenscap [options] files

Options:
  -h, --help                   show this help message and exit
  -o FILE, --output=FILE       Output filename, defaults to same but with .html
  -p DIR, --photos=DIR         Directory with photos (default: photos/)
  -t DIR, --templates=DIR      Directory with templates (default: None)
  -s FILE, --stylesheet=FILE   Stylesheet file
  -m THEME, --theme=THEME      Theme (default, narrow)
  -r, --resize                 Resize images (default: False)

Themes

Currently, there are only two themes: default and narrow. The default theme uses a width of 16 skeleton columns and the narrow one uses a narrower 8 column width for text and expands to 16 for images.

Adding a new theme is just a matter of copying the lenscap/templates/default directory and editing the base.html and rows.html files.

Contributing

Contributions are most welcome. If you have any cool ideas, open a ticket. Especially design-related tweaks and new themes are welcome.

License

BSD, short and sweet

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lenscap-0.3.0.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file lenscap-0.3.0.tar.gz.

File metadata

  • Download URL: lenscap-0.3.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.5

File hashes

Hashes for lenscap-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5525f2b9e20c0c45607c431a8298906952d373ff7f0638b53dd160dfc36516ca
MD5 899bd0ec563988836559930bac7cfe55
BLAKE2b-256 ef63da9410ddf12bb641508ca6b230db83350fccf5a3686cbfa32d83bf1ed524

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page