From b75fa9b9aef101f841fa5aeef87b31fb8874a43b Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 3 Mar 2013 00:49:56 +0100 Subject: [PATCH] Improve docs and change the default thumb size. --- docs/index.rst | 15 ++++++++------- sigal/__init__.py | 4 ++-- sigal/gallery.py | 7 +++++++ sigal/image.py | 10 +++------- sigal/settings.py | 2 +- sigal/templates/sigal.conf.py | 2 +- sigal/writer.py | 4 ---- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a0a72e9..342ab9c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,9 +74,10 @@ sub-directory and run ``sigal build ``. The next time you run ``sigal build``, only the new images will be processed. Use the ``-f`` flag to force the reprocessing of all the images. -To visualize your gallery, you can either use ``sigal serve`` which runs a -basic web server, or you can use the ``index_in_url = True`` setting which -will add ``index.html`` to the urls to allow browsing without the server. +To visualize your gallery, you can use ``sigal serve`` which runs a basic web +server. This server should only be used for local browsing, not in production. +Another option is to use the ``index_in_url = True`` setting, which will add +``index.html`` to the urls to allow browsing without a server. Help of the ``sigal build`` command @@ -135,7 +136,7 @@ and is shown below. This file is copied to the current directory with the Album information ----------------- -Information on an album can be given in a file using the markdown syntax, +Information on an album can be given in a file using the `markdown`_ syntax, named ``index.md`` : :: @@ -148,6 +149,7 @@ named ``index.md`` : If this file does not exist the directory's name is used for the title, and the first image of the directory is used as thumbnail. +.. _markdown: http://daringfireball.net/projects/markdown/ Changelog --------- @@ -158,9 +160,8 @@ Version 0.3 Released on 2013-xx-xx. - Fix packaging issues. -- Add a setting to optionally add `index.html` to the URLs. -- Add a setting to specify a list of links and adapt the themes to show the - links. +- New setting ``index_in_url`` to optionally add `index.html` to the URLs. +- New setting ``links`` to specify a list of links. - Use EXIF info to fix orientation. - Replace the ``jpg_quality`` setting with a dict of options. - Manage directories with only sub-directories and add some checks. diff --git a/sigal/__init__.py b/sigal/__init__.py index 60157f1..2a5cd4f 100644 --- a/sigal/__init__.py +++ b/sigal/__init__.py @@ -50,11 +50,11 @@ _DEFAULT_CONFIG_FILE = 'sigal.conf.py' def init_logging(level=logging.INFO): - """ Logging config + """Logging config Set the level and create a more detailed formatter for debug mode. - """ + """ logger = logging.getLogger(__name__) logger.setLevel(level) diff --git a/sigal/gallery.py b/sigal/gallery.py index 67437b3..12a258e 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -41,6 +41,13 @@ DESCRIPTION_FILE = "index.md" class PathsDb(object): + """Container for all the information on the directory structure. + + All the info is stored in a dictionnary, `self.db`. This class also has + methods to build this dictionnary. + + """ + def __init__(self, path, ext_list): self.basepath = path self.ext_list = ext_list diff --git a/sigal/image.py b/sigal/image.py index 787f8b4..b7c7a4c 100644 --- a/sigal/image.py +++ b/sigal/image.py @@ -20,11 +20,6 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -""" -Prepare images: resize images, and create thumbnails with some options -(squared thumbs, ...). -""" - from __future__ import division import logging @@ -39,9 +34,10 @@ EXIF_ORIENTATION_TAG = 274 class Image(object): - """ Image container + """Image container - resize, thumbnail, ... + Prepare images: resize images, and create thumbnails with some options + (squared thumbs, ...). :param filename: path to an image diff --git a/sigal/settings.py b/sigal/settings.py index 0be69b4..7cb14fe 100644 --- a/sigal/settings.py +++ b/sigal/settings.py @@ -28,7 +28,7 @@ _DEFAULT_CONFIG = { 'make_thumbs': True, 'thumb_prefix': '', 'thumb_suffix': '', - 'thumb_size': (150, 112), + 'thumb_size': (200, 150), 'thumb_dir': 'thumbnails', 'thumb_fit': True, 'keep_orig': False, diff --git a/sigal/templates/sigal.conf.py b/sigal/templates/sigal.conf.py index 48f6ce8..1075354 100644 --- a/sigal/templates/sigal.conf.py +++ b/sigal/templates/sigal.conf.py @@ -21,7 +21,7 @@ img_size = (800, 600) # thumb_prefix = # thumb_suffix = '.tn' -# Thumbnail size (default: (150, 112)) +# Thumbnail size (default: (200, 150)) # For the galleria theme, use 280 px for the width # For the colorbox theme, use 200 px for the width thumb_size = (280, 210) diff --git a/sigal/writer.py b/sigal/writer.py index 3619303..cf3623b 100644 --- a/sigal/writer.py +++ b/sigal/writer.py @@ -20,10 +20,6 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -""" -Generate html pages for each directory of images. -""" - from __future__ import absolute_import import codecs