pelican-linkclass


Namepelican-linkclass JSON
Version 2.1.4 PyPI version JSON
download
home_pageNone
SummaryPelican plugin to set anchor tag's class attribute to differentiate between internal and external links
upload_time2024-04-14 10:01:21
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8.1
licenseAGPL-3.0
keywords pelican plugin link class
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Link Class: A Plugin for Pelican
================================

[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/linkclass/main.yml?branch=main)](https://github.com/pelican-plugins/linkclass/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pelican-linkclass)](https://pypi.org/project/pelican-linkclass/)
![License](https://img.shields.io/pypi/l/pelican-linkclass?color=blue)

This Pelican plugin allows you to set the class attribute of `<a>` elements
(generated in Markdown by `[ext](link)`) according to whether the link is
external (i.e., starts with `http://` or `https://`) or internal to the
Pelican-generated site.

For now, this plugin only works with Markdown. It has been tested with version
3.0+ of the Python-Markdown module and may not work with previous versions.

Installation
------------

This plugin [is available as a package](https://pypi.org/project/pelican-linkclass/)
at PyPI and can be installed via:

```
python -m pip install pelican-linkclass
```

Configuration
-------------

In order to avoid clashes with already-defined classes in the user CSS
style sheets, it is possible to specify the name of the classes that will
be used. They can be specified in the Pelican setting file with the
`LINKCLASS` variable, which must be defined as a list of tuples, like this:

```python
'LINKCLASS' = (('EXTERNAL_CLASS', 'name-of-the-class-for-external-links'),
               ('INTERNAL_CLASS', 'name-of-the-class-for-internal-links'))
```

The default values for `EXTERNAL_CLASS` and `INTERNAL_CLASS` are,
respectively, `'external'` and `'internal'`.

Styling Hyperlinks
------------------

One of the possible uses of this plugins is for styling. Suppose that we
have the following Markdown content in your article:

```markdown
This is an [internal](internal) link and this is an
[external](http://external.com) link.
```

If the default configuration variable values are used, then one possible
CSS setting could be:

```css
a.external:before {
    content: url('../images/external-link.png');
    margin-right: 0.2em;
}
```

(The file `external-link.png` is also distributed with this plugin. To use it,
copy it to the appropriate place in your web site source tree, for instance
in `theme/static/images/`.)

Then, the result will look like the following:

![figure](https://github.com/pelican-plugins/linkclass/raw/main/linkclass-example.png)

Note that this plugin also works with reference-style links, as in the
following example:

```markdown
This is an [internal][internal] link and this is an
[external][external] link.

 [internal]: internal
 [external]: http://external.com
```

Contributing
------------

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].

To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.

[existing issues]: https://github.com/pelican-plugins/linkclass/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

Acknowledgments
---------------

Many thanks to [Yuliya Bagriy][] for setting up the package for [PyPI][], to [Lucas Cimon][] for fixing the issues with [pytest][], and to [Justin Mayer][] for helping with migration of this plugin under the Pelican Plugins organization.

[Yuliya Bagriy]: https://github.com/aviskase
[PyPI]: https://pypi.org/
[Lucas Cimon]: https://github.com/Lucas-C
[pytest]: https://pytest.org/
[Justin Mayer]: https://github.com/justinmayer

Author
------

Copyright © 2015, 2017, 2019, 2021-2023 Rafael Laboissière (<rafael@laboissiere.net>)

License
-------

This project is released under the terms of the GNU Affero Public License, version 3 or later.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pelican-linkclass",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "pelican, plugin, link class",
    "author": null,
    "author_email": "=?utf-8?q?Rafael_Laboissi=C3=A8re?= <rafael@laboissiere.net>",
    "download_url": "https://files.pythonhosted.org/packages/1b/2b/03424d7ea46fb93f5d78745a4dc33154255fd6d7eb52fbc0d0d1396d0721/pelican_linkclass-2.1.4.tar.gz",
    "platform": null,
    "description": "Link Class: A Plugin for Pelican\n================================\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/linkclass/main.yml?branch=main)](https://github.com/pelican-plugins/linkclass/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-linkclass)](https://pypi.org/project/pelican-linkclass/)\n![License](https://img.shields.io/pypi/l/pelican-linkclass?color=blue)\n\nThis Pelican plugin allows you to set the class attribute of `<a>` elements\n(generated in Markdown by `[ext](link)`) according to whether the link is\nexternal (i.e., starts with `http://` or `https://`) or internal to the\nPelican-generated site.\n\nFor now, this plugin only works with Markdown. It has been tested with version\n3.0+ of the Python-Markdown module and may not work with previous versions.\n\nInstallation\n------------\n\nThis plugin [is available as a package](https://pypi.org/project/pelican-linkclass/)\nat PyPI and can be installed via:\n\n```\npython -m pip install pelican-linkclass\n```\n\nConfiguration\n-------------\n\nIn order to avoid clashes with already-defined classes in the user CSS\nstyle sheets, it is possible to specify the name of the classes that will\nbe used. They can be specified in the Pelican setting file with the\n`LINKCLASS` variable, which must be defined as a list of tuples, like this:\n\n```python\n'LINKCLASS' = (('EXTERNAL_CLASS', 'name-of-the-class-for-external-links'),\n               ('INTERNAL_CLASS', 'name-of-the-class-for-internal-links'))\n```\n\nThe default values for `EXTERNAL_CLASS` and `INTERNAL_CLASS` are,\nrespectively, `'external'` and `'internal'`.\n\nStyling Hyperlinks\n------------------\n\nOne of the possible uses of this plugins is for styling. Suppose that we\nhave the following Markdown content in your article:\n\n```markdown\nThis is an [internal](internal) link and this is an\n[external](http://external.com) link.\n```\n\nIf the default configuration variable values are used, then one possible\nCSS setting could be:\n\n```css\na.external:before {\n    content: url('../images/external-link.png');\n    margin-right: 0.2em;\n}\n```\n\n(The file `external-link.png` is also distributed with this plugin. To use it,\ncopy it to the appropriate place in your web site source tree, for instance\nin `theme/static/images/`.)\n\nThen, the result will look like the following:\n\n![figure](https://github.com/pelican-plugins/linkclass/raw/main/linkclass-example.png)\n\nNote that this plugin also works with reference-style links, as in the\nfollowing example:\n\n```markdown\nThis is an [internal][internal] link and this is an\n[external][external] link.\n\n [internal]: internal\n [external]: http://external.com\n```\n\nContributing\n------------\n\nContributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/pelican-plugins/linkclass/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\nAcknowledgments\n---------------\n\nMany thanks to [Yuliya Bagriy][] for setting up the package for [PyPI][], to [Lucas Cimon][] for fixing the issues with [pytest][], and to [Justin Mayer][] for helping with migration of this plugin under the Pelican Plugins organization.\n\n[Yuliya Bagriy]: https://github.com/aviskase\n[PyPI]: https://pypi.org/\n[Lucas Cimon]: https://github.com/Lucas-C\n[pytest]: https://pytest.org/\n[Justin Mayer]: https://github.com/justinmayer\n\nAuthor\n------\n\nCopyright \u00a9 2015, 2017, 2019, 2021-2023 Rafael Laboissi\u00e8re (<rafael@laboissiere.net>)\n\nLicense\n-------\n\nThis project is released under the terms of the GNU Affero Public License, version 3 or later.\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "Pelican plugin to set anchor tag's class attribute to differentiate between internal and external links",
    "version": "2.1.4",
    "project_urls": {
        "Funding": "https://donate.getpelican.com/",
        "Homepage": "https://github.com/pelican-plugins/linkclass",
        "Issue tracker": "https://github.com/pelican-plugins/linkclass/issues"
    },
    "split_keywords": [
        "pelican",
        " plugin",
        " link class"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "579bfd53a33f8249f60722a6602be93ee5fab015c7fc082be58916eb2e3b9a1f",
                "md5": "0eec793e1b73be98392a938cb8274223",
                "sha256": "e8e394a4459c0c6d53629ea8f8f274a9b4f3c759ba52e0a244bab3d5c015561c"
            },
            "downloads": -1,
            "filename": "pelican_linkclass-2.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0eec793e1b73be98392a938cb8274223",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 19882,
            "upload_time": "2024-04-14T10:01:19",
            "upload_time_iso_8601": "2024-04-14T10:01:19.352596Z",
            "url": "https://files.pythonhosted.org/packages/57/9b/fd53a33f8249f60722a6602be93ee5fab015c7fc082be58916eb2e3b9a1f/pelican_linkclass-2.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b2b03424d7ea46fb93f5d78745a4dc33154255fd6d7eb52fbc0d0d1396d0721",
                "md5": "6b4abb3dde8509418ff4b6ba930495b6",
                "sha256": "e5952c29fef562244c42018ce8b84217382d5b344c59230f4b8115af7731b66f"
            },
            "downloads": -1,
            "filename": "pelican_linkclass-2.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6b4abb3dde8509418ff4b6ba930495b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 21939,
            "upload_time": "2024-04-14T10:01:21",
            "upload_time_iso_8601": "2024-04-14T10:01:21.009836Z",
            "url": "https://files.pythonhosted.org/packages/1b/2b/03424d7ea46fb93f5d78745a4dc33154255fd6d7eb52fbc0d0d1396d0721/pelican_linkclass-2.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-14 10:01:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pelican-plugins",
    "github_project": "linkclass",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pelican-linkclass"
}
        
Elapsed time: 0.22981s