commit 85e947acc85d58003929537b13462ce628c95493 Author: Jonathan Sundqvist Date: Sat Jul 3 12:59:04 2021 +0200 Initial commit diff --git a/pelican/plugins/obsidian/__init__.py b/pelican/plugins/obsidian/__init__.py new file mode 100644 index 0000000..c574edf --- /dev/null +++ b/pelican/plugins/obsidian/__init__.py @@ -0,0 +1 @@ +from .obsidian import * # noqa diff --git a/pelican/plugins/obsidian/obsidian.py b/pelican/plugins/obsidian/obsidian.py new file mode 100644 index 0000000..1007c80 --- /dev/null +++ b/pelican/plugins/obsidian/obsidian.py @@ -0,0 +1,27 @@ +from pelican import signals + +def pre_taxonomy(article_generator): + """ + Modify the tags of the article + """ + pass + + +def modify_article_content(article_generator, content): + """ + Change the format of various links to the accepted case of pelican. + """ + pass + + +def modify_metadata(article_generator, context): + """ + Modify the metadata + """ + pass + + +def register(): + signals.article_generator_context.connect(modify_metadata) + signals.article_generator_pretaxonomy.connect(pre_taxonomy) + signals.article_generator_write_article.connect(modify_article_content) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..325bca7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[project] +name = "pelican-obsidian" +version = "0.1.0" +description = "Makes pelican markdown files more compatible with Obsidian" +authors = [ + "Jonathan Sundqvist " +] +license = "MIT" +readme = "README.md" +python = "^3.6" +homepage = "https://github.com/jonathan-s/pelican-obsidian" +repository = "https://github.com/jonathan-s/pelican-obsidian" +documentation = "https://github.com/jonathan-s/pelican-obsidian" + +keywords = ["pelican", "obsidian", "plugin"] + +classifiers = [ + "Topic :: Software Development" +] + +# Requirements +[dependencies] +pelican = "^4.5" + +[dev-dependencies] +black = { version = "^18.3-alpha.0", python = "^3.6" } + +[build-system] +requires = [ + "setuptools >= 35.0.2", + "setuptools_scm >= 2.0.0, <3" +] +build-backend = "setuptools.build_meta" + +[tool.black] +line-length = 88 +target_version = ['py36'] +include = '\.pyi?$' +exclude = ''' + +( + /( + \.eggs # exclude a few common directories in the + | \.git # root of the project + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + )/ + | foo.py # also separately exclude a file named foo.py in + # the root of the project +) +''' diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1fee7e0 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +# setup.py +from setuptools import setup +setup(use_scm_version=True)