minchin.pelican.plugins.summary


Nameminchin.pelican.plugins.summary JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/MinchinWeb/minchin.pelican.plugins.summary
SummaryThis Pelican plugin allows easy, variable length summaries directly embedded into the body of your articles.
upload_time2023-08-09 19:43:56
maintainer
docs_urlNone
authorWilliam Minchin
requires_python
licenseGNU Affero General Public License v3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======
Summary
=======

``Summary`` is a plugin for `Pelican <http://docs.getpelican.com/>`_,
a static site generator written in Python.

``Summary`` allows easy, variable length summaries directly embedded into
the body of your articles.

.. image:: https://img.shields.io/pypi/v/minchin.pelican.plugins.summary.svg?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/
    :alt: PyPI version number

.. image:: https://img.shields.io/badge/-Changelog-success
   :target: https://github.com/MinchinWeb/minchin.pelican.plugins.summary/blob/master/CHANGELOG.rst
   :alt: Changelog

.. image:: https://img.shields.io/pypi/pyversions/minchin.pelican.plugins.summary?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/
    :alt: Supported Python version

.. image:: https://img.shields.io/pypi/l/minchin.pelican.plugins.summary.svg?style=flat&color=green
    :target: https://github.com/MinchinWeb/minchin.pelican.plugins.summary/blob/master/LICENSE
    :alt: License

.. image:: https://img.shields.io/pypi/dm/minchin.pelican.plugins.summary.svg?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/
    :alt: Download Count


Installation
============

The easiest way to install ``Summary`` is through the use of pip. This
will also install the required dependencies automatically.

.. code-block:: sh

  pip install minchin.pelican.plugins.summary

If you are using Pelican 4.5, it should automatically be activated (through my
AutoLoader plugin). 

If you are using an earlier version of Pelican or autoloading isn't working,
then in your ``pelicanconf.py`` file, add ``Summary`` to your list of plugins:

.. code-block:: python

  PLUGINS = [
      # others...
      'minchin.pelican.plugins.summary',
      # ...
  ]

You may also need to configure the summary start and end markers (see
Configuration below).


Requirements
============

``Summary`` depends on (and is really only useful with) Pelican; it also
depends on ``semantic-version`` and ``minchin.pelican.plugins.autoloader``.
These can be manually installed with pip (but are automatically installed if
the plugin is installed with pip):

.. code-block:: sh

   pip install pelican semantic-version minchin.pelican.plugins.autoloader


Configuration and Usage
=======================

This plugin introduces two new settings: ``SUMMARY_BEGIN_MARKER`` and
``SUMMARY_END_MARKER``: strings which can be placed directly into an
article to mark the beginning and end of a summary. When found, the
standard ``SUMMARY_MAX_LENGTH`` setting will be ignored. The markers
themselves will also be removed from your articles before they are
published. The default values are ``<!-- PELICAN_BEGIN_SUMMARY -->`` and
``<!-- PELICAN_END_SUMMARY -->``.

For example::

    Title: My super title
    Date: 2010-12-03 10:20
    Tags: thats, awesome
    Category: yeah
    Slug: my-super-post
    Author: Alexis Metaireau

    This is the content of my super blog post.
    <!-- PELICAN_END_SUMMARY -->
    and this content occurs after the summary.

Here, the summary is taken to be the first line of the post. Because no
beginning marker was found, it starts at the top of the body. It is
possible to leave out the end marker instead, in which case the summary
will start at the beginning marker and continue to the end of the body.

If no beginning or end marker is found, and if
``SUMMARY_USE_FIRST_PARAGRAPH`` is enabled in the settings, the summary
will be the first paragraph of the post.

The plugin also sets a ``has_summary`` attribute on every article. It is
True for articles with an explicitly-defined summary, and False otherwise.
(It is also False for an article truncated by ``SUMMARY_MAX_LENGTH``.)
Your templates can use this e.g. to add a link to the full text at the end
of the summary.

ReST example
~~~~~~~~~~~~

Inserting the markers into a reStructuredText document makes use of the
comment directive, because raw HTML is automatically escaped. The reST
equivalent of the above Markdown example looks like this::

    My super title
    ##############

    :date: 2010-12-03 10:20
    :tags: thats, awesome
    :category: yeah
    :slug: my-super-post
    :author: Alexis Metaireau

    This is the content of my super blog post.

    .. PELICAN_END_SUMMARY

    and this content occurs after the summary.


Pelican 3 Support
=================

The plugin also includes support for Pelican 3, however general support for
Pelican 3 is somewhat limited. In particular, Python 3.9 or earlier is needed,
and the most recent version dependencies include ``pelican==3.7.1``,
``jinja2==2.11.3``, and ``markupsafe==1.1.1``.

For extra clarity, the plugins to designed to support Pelican 4 as well.


Test Suite
==========

There is an included test suite, available at
``minchin\pelican\plugins\summary\test_summary.py``. The plugin itself doesn't
need to be installed for the suite to run, but the plugin dependencies do need
to be installed.


Credits
=======

Original plugin from the `Pelican-Plugins repo
<https://github.com/getpelican/pelican-plugins>`_.


License
=======

The plugin code is assumed to be under the AGPLv3 license (this is the
license of the Pelican-Plugins repo).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MinchinWeb/minchin.pelican.plugins.summary",
    "name": "minchin.pelican.plugins.summary",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "William Minchin",
    "author_email": "w_minchin@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/82/f2/a98defeb584ef429f1f36d9edc492603cac12c4e3506eea9bb600233357c/minchin.pelican.plugins.summary-1.2.1.tar.gz",
    "platform": "any",
    "description": "=======\r\nSummary\r\n=======\r\n\r\n``Summary`` is a plugin for `Pelican <http://docs.getpelican.com/>`_,\r\na static site generator written in Python.\r\n\r\n``Summary`` allows easy, variable length summaries directly embedded into\r\nthe body of your articles.\r\n\r\n.. image:: https://img.shields.io/pypi/v/minchin.pelican.plugins.summary.svg?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/\r\n    :alt: PyPI version number\r\n\r\n.. image:: https://img.shields.io/badge/-Changelog-success\r\n   :target: https://github.com/MinchinWeb/minchin.pelican.plugins.summary/blob/master/CHANGELOG.rst\r\n   :alt: Changelog\r\n\r\n.. image:: https://img.shields.io/pypi/pyversions/minchin.pelican.plugins.summary?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/\r\n    :alt: Supported Python version\r\n\r\n.. image:: https://img.shields.io/pypi/l/minchin.pelican.plugins.summary.svg?style=flat&color=green\r\n    :target: https://github.com/MinchinWeb/minchin.pelican.plugins.summary/blob/master/LICENSE\r\n    :alt: License\r\n\r\n.. image:: https://img.shields.io/pypi/dm/minchin.pelican.plugins.summary.svg?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.summary/\r\n    :alt: Download Count\r\n\r\n\r\nInstallation\r\n============\r\n\r\nThe easiest way to install ``Summary`` is through the use of pip. This\r\nwill also install the required dependencies automatically.\r\n\r\n.. code-block:: sh\r\n\r\n  pip install minchin.pelican.plugins.summary\r\n\r\nIf you are using Pelican 4.5, it should automatically be activated (through my\r\nAutoLoader plugin). \r\n\r\nIf you are using an earlier version of Pelican or autoloading isn't working,\r\nthen in your ``pelicanconf.py`` file, add ``Summary`` to your list of plugins:\r\n\r\n.. code-block:: python\r\n\r\n  PLUGINS = [\r\n      # others...\r\n      'minchin.pelican.plugins.summary',\r\n      # ...\r\n  ]\r\n\r\nYou may also need to configure the summary start and end markers (see\r\nConfiguration below).\r\n\r\n\r\nRequirements\r\n============\r\n\r\n``Summary`` depends on (and is really only useful with) Pelican; it also\r\ndepends on ``semantic-version`` and ``minchin.pelican.plugins.autoloader``.\r\nThese can be manually installed with pip (but are automatically installed if\r\nthe plugin is installed with pip):\r\n\r\n.. code-block:: sh\r\n\r\n   pip install pelican semantic-version minchin.pelican.plugins.autoloader\r\n\r\n\r\nConfiguration and Usage\r\n=======================\r\n\r\nThis plugin introduces two new settings: ``SUMMARY_BEGIN_MARKER`` and\r\n``SUMMARY_END_MARKER``: strings which can be placed directly into an\r\narticle to mark the beginning and end of a summary. When found, the\r\nstandard ``SUMMARY_MAX_LENGTH`` setting will be ignored. The markers\r\nthemselves will also be removed from your articles before they are\r\npublished. The default values are ``<!-- PELICAN_BEGIN_SUMMARY -->`` and\r\n``<!-- PELICAN_END_SUMMARY -->``.\r\n\r\nFor example::\r\n\r\n    Title: My super title\r\n    Date: 2010-12-03 10:20\r\n    Tags: thats, awesome\r\n    Category: yeah\r\n    Slug: my-super-post\r\n    Author: Alexis Metaireau\r\n\r\n    This is the content of my super blog post.\r\n    <!-- PELICAN_END_SUMMARY -->\r\n    and this content occurs after the summary.\r\n\r\nHere, the summary is taken to be the first line of the post. Because no\r\nbeginning marker was found, it starts at the top of the body. It is\r\npossible to leave out the end marker instead, in which case the summary\r\nwill start at the beginning marker and continue to the end of the body.\r\n\r\nIf no beginning or end marker is found, and if\r\n``SUMMARY_USE_FIRST_PARAGRAPH`` is enabled in the settings, the summary\r\nwill be the first paragraph of the post.\r\n\r\nThe plugin also sets a ``has_summary`` attribute on every article. It is\r\nTrue for articles with an explicitly-defined summary, and False otherwise.\r\n(It is also False for an article truncated by ``SUMMARY_MAX_LENGTH``.)\r\nYour templates can use this e.g. to add a link to the full text at the end\r\nof the summary.\r\n\r\nReST example\r\n~~~~~~~~~~~~\r\n\r\nInserting the markers into a reStructuredText document makes use of the\r\ncomment directive, because raw HTML is automatically escaped. The reST\r\nequivalent of the above Markdown example looks like this::\r\n\r\n    My super title\r\n    ##############\r\n\r\n    :date: 2010-12-03 10:20\r\n    :tags: thats, awesome\r\n    :category: yeah\r\n    :slug: my-super-post\r\n    :author: Alexis Metaireau\r\n\r\n    This is the content of my super blog post.\r\n\r\n    .. PELICAN_END_SUMMARY\r\n\r\n    and this content occurs after the summary.\r\n\r\n\r\nPelican 3 Support\r\n=================\r\n\r\nThe plugin also includes support for Pelican 3, however general support for\r\nPelican 3 is somewhat limited. In particular, Python 3.9 or earlier is needed,\r\nand the most recent version dependencies include ``pelican==3.7.1``,\r\n``jinja2==2.11.3``, and ``markupsafe==1.1.1``.\r\n\r\nFor extra clarity, the plugins to designed to support Pelican 4 as well.\r\n\r\n\r\nTest Suite\r\n==========\r\n\r\nThere is an included test suite, available at\r\n``minchin\\pelican\\plugins\\summary\\test_summary.py``. The plugin itself doesn't\r\nneed to be installed for the suite to run, but the plugin dependencies do need\r\nto be installed.\r\n\r\n\r\nCredits\r\n=======\r\n\r\nOriginal plugin from the `Pelican-Plugins repo\r\n<https://github.com/getpelican/pelican-plugins>`_.\r\n\r\n\r\nLicense\r\n=======\r\n\r\nThe plugin code is assumed to be under the AGPLv3 license (this is the\r\nlicense of the Pelican-Plugins repo).\r\n",
    "bugtrack_url": null,
    "license": "GNU Affero General Public License v3",
    "summary": "This Pelican plugin allows easy, variable length summaries directly embedded into the body of your articles.",
    "version": "1.2.1",
    "project_urls": {
        "Homepage": "https://github.com/MinchinWeb/minchin.pelican.plugins.summary"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2b7a77da8c302096d184243269bbb0350bf2cbffd5ff793f6b5a47b52ef22a7",
                "md5": "eb2dce737a6dfeae539cbe7dc70d2be7",
                "sha256": "b42578c8e90b3d27f89a1f109f3e5069f5e40ed366653c40a40df01074b09ddc"
            },
            "downloads": -1,
            "filename": "minchin.pelican.plugins.summary-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eb2dce737a6dfeae539cbe7dc70d2be7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20004,
            "upload_time": "2023-08-09T19:44:27",
            "upload_time_iso_8601": "2023-08-09T19:44:27.684716Z",
            "url": "https://files.pythonhosted.org/packages/f2/b7/a77da8c302096d184243269bbb0350bf2cbffd5ff793f6b5a47b52ef22a7/minchin.pelican.plugins.summary-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82f2a98defeb584ef429f1f36d9edc492603cac12c4e3506eea9bb600233357c",
                "md5": "7855d632fe919d17c227a8df724fe48d",
                "sha256": "9dbf8a298997aae98866a8a14bb5eb6dd87a3b6c612dc1ce9fcc77fa95e6c27e"
            },
            "downloads": -1,
            "filename": "minchin.pelican.plugins.summary-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7855d632fe919d17c227a8df724fe48d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22350,
            "upload_time": "2023-08-09T19:43:56",
            "upload_time_iso_8601": "2023-08-09T19:43:56.226498Z",
            "url": "https://files.pythonhosted.org/packages/82/f2/a98defeb584ef429f1f36d9edc492603cac12c4e3506eea9bb600233357c/minchin.pelican.plugins.summary-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-09 19:43:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MinchinWeb",
    "github_project": "minchin.pelican.plugins.summary",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "minchin.pelican.plugins.summary"
}
        
Elapsed time: 0.09682s