Package: pelican-gemini-capsule
Pelican Gemini Capsule is a Pelican plugin to generate Gemini capsules. Only
works with articles in reStructuredText formats.This project is currently work in progress.RequirementsPython >= 3.7rst2gemtextInstallationpip install pelican-gemini-capsuleUsageOnce Pelican Gemini Capsule installed, simply add it to you Pelican configuration:PLUGINS=["pelican_gemini_capsule",]ConfigurationYou can configure this plugin by adding the following variables to yourpelicanconf.py:# How many articles to display on the home pageGEMINI_DISPLAYED_ARTICLE_COUNT_ON_HOME=10# Template of the home page of the GemlogGEMINI_TEMPLATE_HOME="""\# {{ SITENAME }}

## Latest Articles
{% for i in range(articles_count_on_home) %}{% set article = articles[i] %}
=> {{ GEMSITEURL }}/{{ article.url | replace(".html", ".gmi") }} {{ article.date.strftime("%Y-%m-%d") }} {{ article.raw_title -}}
{% endfor %}
{% if articles | length > articles_count_on_home %}
=> {{ GEMSITEURL }}/all_articles.gmi ➕ All Articles
{% endif %}
"""# Template of the "All Articles" pageGEMINI_TEMPLATE_ARTICLES_INDEX_PAGE="""\# All Articles — {{ SITENAME }}
{% for article in articles %}
=> {{ GEMSITEURL }}/{{ article.url | replace(".html", ".gmi") }} {{ article.date.strftime("%Y-%m-%d") }} {{ article.raw_title -}}
{% endfor %}

--------------------------------------------------------------------------------
=> {{ GEMSITEURL }}/ 🏠 Home
"""# Template of articlesGEMINI_TEMPLATE_ARTICLE="""\# {{ article.raw_title }}
{{ article.date.strftime("%Y-%m-%d") }}

{{ article.content_gemtext }}

--------------------------------------------------------------------------------
=> {{ GEMSITEURL }}/ 🏠 Home
"""ContributingQuestionsIf you have any question, you can:Open an issueon GitHubAsk on Discord(I am not always available to chat, but I try to answer to everyone)BugsPleaseopen an issueon GitHub with as much information as possible if you found a bug:Your operating system / Linux distribution (and its version)How you installed the softwareAll the logs and message outputted by the softwareetc.If the issue is about the outputted Gemtext (wrong markup, unsupported reStructuredText feature,…), please report the bug to therst2gemtextproject.Pull requestsPlease considerfiling a bugbefore starting to work on a new feature; it will allow us to discuss the best way to do it. It is obviously unnecessary if you just want to fix a typo or small errors in the code.Please note that your code must follow the coding style defined by thepep8and pass tests.BlackandFlake8are used on this project to enforce the coding style.Check codding styleYou must installNoxfirst:pip3 install noxThen you can check for lint error:nox --session lintYou can also fix coding style errors automatically with:nox -s black_fixSupport this projectWant to support this project?☕️ Buy me a coffee💵️ Give me a tip on PayPal❤️ Sponsor me on GitHubChangelog[NEXT](changes onmaster, but not released yet):Nothing yet :)v0.3.1:Fixed missing code blocks in outputed Gemtext (@flozz)v0.3.0:Resolve internal links ({filename}../foo/bar.rst) (@flozz)v0.2.0:Pass the articles source file name to docutils to allow theincludedirective to work (@flozz)Added araw_titleattibute on article with decoded HTML entities
(@flozz)Create the output folder before trying to write articles (@flozz)Avoid having the same image linked twice in articles (@flozz)v0.1.0:Initial release.Generates home pageGenerates articles index pageGenerates articlesConfigurable templates