From 6ed8715a2d876ccaad2b554befc0df022027c296 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:23:20 +0200 Subject: [PATCH 01/12] lib/maintainers.nix: add aldoborrero --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b6c988c9573..9b2cec759e4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -632,6 +632,12 @@ githubId = 43479487; name = "Titouan Biteau"; }; + aldoborrero = { + email = "aldoborrero+nixos@pm.me"; + github = "aldoborrero"; + githubId = 82811; + name = "Aldo Borrero"; + }; aleksana = { email = "me@aleksana.moe"; github = "Aleksanaa"; From 41d56a0624ce3471c34025b35af050fb23854366 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:25:59 +0200 Subject: [PATCH 02/12] mdformat: support plugins --- .../python-modules/mdformat/default.nix | 117 ++++++++++++------ 1 file changed, 77 insertions(+), 40 deletions(-) diff --git a/pkgs/development/python-modules/mdformat/default.nix b/pkgs/development/python-modules/mdformat/default.nix index ed6fdfa95f7..2891cd43080 100644 --- a/pkgs/development/python-modules/mdformat/default.nix +++ b/pkgs/development/python-modules/mdformat/default.nix @@ -1,63 +1,100 @@ { lib +, buildPythonApplication , buildPythonPackage , fetchFromGitHub , importlib-metadata +, makeWrapper , markdown-it-py , poetry-core , pytestCheckHook +, python3 , pythonOlder , setuptools , tomli , typing-extensions }: -buildPythonPackage rec { - pname = "mdformat"; - version = "0.7.16"; - format = "pyproject"; +let + withPlugins = plugins: buildPythonApplication { + pname = "${package.pname}"; + inherit (package) version; + format = "other"; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.7"; - src = fetchFromGitHub { - owner = "executablebooks"; - repo = pname; - rev = version; - hash = "sha256-6MWUkvZp5CYUWsbMGXM2gudjn5075j5FIuaNnCrgRNs="; + dontUnpack = true; + dontBuild = true; + doCheck = false; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = '' + makeWrapper ${package}/bin/mdformat $out/bin/mdformat \ + --prefix PYTHONPATH : "${package}/${python3.sitePackages}:$PYTHONPATH" + ln -sfv ${package}/lib $out/lib + ''; + + propagatedBuildInputs = package.propagatedBuildInputs ++ plugins; + + passthru = package.passthru // { + withPlugins = morePlugins: withPlugins (morePlugins ++ plugins); + }; + + meta.mainProgram = "mdformat"; }; - nativeBuildInputs = [ - poetry-core - setuptools - ]; + package = buildPythonPackage rec { + pname = "mdformat"; + version = "0.7.16"; + format = "pyproject"; - propagatedBuildInputs = [ - markdown-it-py - tomli - ] ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - ] ++ lib.optionals (pythonOlder "3.7") [ - typing-extensions - ]; + disabled = pythonOlder "3.7"; - nativeCheckInputs = [ - pytestCheckHook - ]; + src = fetchFromGitHub { + owner = "executablebooks"; + repo = pname; + rev = version; + hash = "sha256-6MWUkvZp5CYUWsbMGXM2gudjn5075j5FIuaNnCrgRNs="; + }; - disabledTests = [ - # AssertionError - "test_no_codeblock_trailing_newline" - # Issue with upper/lower case - "default_style.md-options0" - ]; + nativeBuildInputs = [ + poetry-core + setuptools + ]; - pythonImportsCheck = [ - "mdformat" - ]; + propagatedBuildInputs = [ + markdown-it-py + tomli + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ] ++ lib.optionals (pythonOlder "3.7") [ + typing-extensions + ]; - meta = with lib; { - description = "CommonMark compliant Markdown formatter"; - homepage = "https://mdformat.rtfd.io/"; - license = with licenses; [ mit ]; - maintainers = with maintainers; [ fab ]; + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # AssertionError + "test_no_codeblock_trailing_newline" + # Issue with upper/lower case + "default_style.md-options0" + ]; + + pythonImportsCheck = [ + "mdformat" + ]; + + passthru = {inherit withPlugins;}; + + meta = with lib; { + description = "CommonMark compliant Markdown formatter"; + homepage = "https://mdformat.rtfd.io/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab aldoborrero ]; + }; }; -} +in package From dc1c3646a26890ebda08e116f625e11f17a295cd Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:36:05 +0200 Subject: [PATCH 03/12] mdformat-beautysh: init at 0.1.1 --- .../mdformat-beautysh/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-beautysh/default.nix diff --git a/pkgs/development/python-modules/mdformat-beautysh/default.nix b/pkgs/development/python-modules/mdformat-beautysh/default.nix new file mode 100644 index 00000000000..522494f783f --- /dev/null +++ b/pkgs/development/python-modules/mdformat-beautysh/default.nix @@ -0,0 +1,46 @@ +{ lib +, beautysh +, buildPythonPackage +, fetchFromGitHub +, mdformat +, mdformat-gfm +, mdit-py-plugins +, poetry-core +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-beautysh"; + version = "0.1.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "hukkin"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-mH9PN6QsPmnIzh/0vxa+5mYLzANUHRruXC0ql4h8myw="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ + mdformat + mdformat-gfm + mdit-py-plugins + ]; + + propagatedBuildInputs = [ + beautysh + ]; + + meta = with lib; { + description = "Mdformat plugin to beautify Bash scripts"; + homepage = "https://github.com/hukkin/mdformat-beautysh"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6997607a818..0048c143e06 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6211,6 +6211,7 @@ self: super: with self; { md2gemini = callPackage ../development/python-modules/md2gemini { }; mdformat = callPackage ../development/python-modules/mdformat { }; + mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From 9fbd8b575eb2310dee32a5733d0e40c242001e00 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:37:23 +0200 Subject: [PATCH 04/12] mdformat-footnote: init at 0.1.1 --- .../mdformat-footnote/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-footnote/default.nix diff --git a/pkgs/development/python-modules/mdformat-footnote/default.nix b/pkgs/development/python-modules/mdformat-footnote/default.nix new file mode 100644 index 00000000000..cee0e1bd5e5 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-footnote/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, linkify-it-py +, markdown-it-py +, mdformat +, mdit-py-plugins +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-footnote"; + version = "0.1.1"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "executablebooks"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-DUCBWcmB5i6/HkqxjlU3aTRO7i0n2sj+e/doKB8ffeo="; + }; + + buildInputs = [ + mdformat + mdit-py-plugins + ]; + + pythonImportsCheck = [ + "mdformat_footnote" + ]; + + meta = with lib; { + description = "Footnote format addition for mdformat"; + homepage = "https://github.com/executablebooks/mdformat-footnote"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0048c143e06..a7139f872f1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6212,6 +6212,7 @@ self: super: with self; { mdformat = callPackage ../development/python-modules/mdformat { }; mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { }; + mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From f7607d0a300779ccc20d5cb69b756d3833130838 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:38:32 +0200 Subject: [PATCH 05/12] mdformat-frontmatter: init at 2.0.1 --- .../mdformat-frontmatter/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-frontmatter/default.nix diff --git a/pkgs/development/python-modules/mdformat-frontmatter/default.nix b/pkgs/development/python-modules/mdformat-frontmatter/default.nix new file mode 100644 index 00000000000..67e0634fa1d --- /dev/null +++ b/pkgs/development/python-modules/mdformat-frontmatter/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, linkify-it-py +, markdown-it-py +, mdformat +, mdit-py-plugins +, ruamel-yaml +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-frontmatter"; + version = "2.0.1"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "butler54"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-PhT5whtvvcYSs5gHQEsIvV1evhx7jR+3DWFMHrF0uMw="; + }; + + buildInputs = [ + mdformat + mdit-py-plugins + ]; + + propagatedBuildInputs = [ + ruamel-yaml + ]; + + pythonImportsCheck = [ + "mdformat_frontmatter" + ]; + + meta = with lib; { + description = "mdformat plugin to ensure frontmatter is respected"; + homepage = "https://github.com/butler54/mdformat-frontmatter"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero polarmutex ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a7139f872f1..fc17ba79268 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6213,6 +6213,7 @@ self: super: with self; { mdformat = callPackage ../development/python-modules/mdformat { }; mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { }; mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; + mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From da7459f412d5003e77d56a676b90bae00c531e95 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:39:17 +0200 Subject: [PATCH 06/12] mdformat-gfm: init at 0.3.5 --- .../python-modules/mdformat-gfm/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-gfm/default.nix diff --git a/pkgs/development/python-modules/mdformat-gfm/default.nix b/pkgs/development/python-modules/mdformat-gfm/default.nix new file mode 100644 index 00000000000..2b48bcfa45d --- /dev/null +++ b/pkgs/development/python-modules/mdformat-gfm/default.nix @@ -0,0 +1,58 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, linkify-it-py +, markdown-it-py +, mdformat +, mdformat-gfm +, mdformat-tables +, mdit-py-plugins +, poetry-core +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-gfm"; + version = "0.3.5"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "hukkin"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-7sIa50jCN+M36Y0C05QaAL+TVwLzKxJ0gzpZI1YQFxg="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ + mdformat + markdown-it-py + mdit-py-plugins + ]; + + propagatedBuildInputs = [ + mdformat-tables + linkify-it-py + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "mdformat_gfm" + ]; + + meta = with lib; { + description = "Mdformat plugin for GitHub Flavored Markdown compatibility"; + homepage = "https://github.com/hukkin/mdformat-gfm"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero polarmutex ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fc17ba79268..6632d5ad8e6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6214,6 +6214,7 @@ self: super: with self; { mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { }; mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { }; + mdformat-gfm = callPackage ../development/python-modules/mdformat-gfm { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From 81578d2c371bfc08de5c7a4d82a13a9ac1ec6690 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:40:26 +0200 Subject: [PATCH 07/12] mdformat-mkdocs: init at 1.0.2 --- .../mdformat-mkdocs/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-mkdocs/default.nix diff --git a/pkgs/development/python-modules/mdformat-mkdocs/default.nix b/pkgs/development/python-modules/mdformat-mkdocs/default.nix new file mode 100644 index 00000000000..5df491ea857 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-mkdocs/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, mdformat-gfm +, mdit-py-plugins +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-mkdocs"; + version = "1.0.2"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "KyleKing"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-H+wqgcXNrdrZ5aQvZ7XM8YpBpVZM6pFtsANC00UZ0jM="; + }; + + buildInputs = [ + mdformat + mdformat-gfm + mdit-py-plugins + ]; + + pythonImportsCheck = [ + "mdformat_mkdocs" + ]; + + meta = with lib; { + description = "mdformat plugin for MkDocs"; + homepage = "https://github.com/KyleKing/mdformat-mkdocs"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6632d5ad8e6..50e7868fb49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6215,6 +6215,7 @@ self: super: with self; { mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { }; mdformat-gfm = callPackage ../development/python-modules/mdformat-gfm { }; + mdformat-mkdocs = callPackage ../development/python-modules/mdformat-mkdocs { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From 40c281ad7a451efba1c37184ed7188c3adfaf84e Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:41:11 +0200 Subject: [PATCH 08/12] mdformat-nix-alejandra: init at 0.1.0 --- .../mdformat-nix-alejandra/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-nix-alejandra/default.nix diff --git a/pkgs/development/python-modules/mdformat-nix-alejandra/default.nix b/pkgs/development/python-modules/mdformat-nix-alejandra/default.nix new file mode 100644 index 00000000000..6323312072f --- /dev/null +++ b/pkgs/development/python-modules/mdformat-nix-alejandra/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, poetry-core +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-nix-alejandra"; + version = "0.1.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "aldoborrero"; + repo = pname; + rev = "${version}"; + hash = "sha256-jUXApGsxCA+pRm4m4ZiHWlxmVkqCPx3A46oQdtyKz5g="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ + mdformat + ]; + + pythonImportsCheck = [ + "mdformat_nix_alejandra" + ]; + + meta = with lib; { + description = "Mdformat plugin format Nix code blocks with alejandra"; + homepage = "https://github.com/aldoborrero/mdformat-nix-alejandra"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 50e7868fb49..2c6398c9e90 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6216,6 +6216,7 @@ self: super: with self; { mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { }; mdformat-gfm = callPackage ../development/python-modules/mdformat-gfm { }; mdformat-mkdocs = callPackage ../development/python-modules/mdformat-mkdocs { }; + mdformat-nix-alejandra = callPackage ../development/python-modules/mdformat-nix-alejandra { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From ae56d8f1919fd86e84ef991d9bfbef3aced2b15b Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:41:53 +0200 Subject: [PATCH 09/12] mdformat-simple-breaks: init at 0.0.1 --- .../mdformat-simple-breaks/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-simple-breaks/default.nix diff --git a/pkgs/development/python-modules/mdformat-simple-breaks/default.nix b/pkgs/development/python-modules/mdformat-simple-breaks/default.nix new file mode 100644 index 00000000000..b4d293f6368 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-simple-breaks/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, mdit-py-plugins +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-simple-breaks"; + version = "0.0.1"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "csala"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-4lJHB4r9lI2uGJ/BmFFc92sumTRKBBwiRmGBdQkzfd0="; + }; + + buildInputs = [ + mdformat + ]; + + pythonImportsCheck = [ + "mdformat_simple_breaks" + ]; + + meta = with lib; { + description = "mdformat plugin to render thematic breaks using three dashes"; + homepage = "https://github.com/csala/mdformat-simple-breaks"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2c6398c9e90..a429cd7c819 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6217,6 +6217,7 @@ self: super: with self; { mdformat-gfm = callPackage ../development/python-modules/mdformat-gfm { }; mdformat-mkdocs = callPackage ../development/python-modules/mdformat-mkdocs { }; mdformat-nix-alejandra = callPackage ../development/python-modules/mdformat-nix-alejandra { }; + mdformat-simple-breaks = callPackage ../development/python-modules/mdformat-simple-breaks { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From d72ad7d4db0eff63ba16affbc259635b2e70f267 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:42:33 +0200 Subject: [PATCH 10/12] mdformat-tables: init at 0.4.1 --- .../mdformat-tables/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-tables/default.nix diff --git a/pkgs/development/python-modules/mdformat-tables/default.nix b/pkgs/development/python-modules/mdformat-tables/default.nix new file mode 100644 index 00000000000..747029eab27 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-tables/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, mdit-py-plugins +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-tables"; + version = "0.4.1"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "executablebooks"; + repo = pname; + rev = "v${version}"; + hash = "sha256-Q61GmaRxjxJh9GjyR8QCZOH0njFUtAWihZ9lFQJ2nQQ="; + }; + + buildInputs = [ + mdformat + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "mdformat_tables" + ]; + + meta = with lib; { + description = "An mdformat plugin for rendering tables"; + homepage = "https://github.com/executablebooks/mdformat-tables"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero polarmutex ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a429cd7c819..aac342b0302 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6218,6 +6218,7 @@ self: super: with self; { mdformat-mkdocs = callPackage ../development/python-modules/mdformat-mkdocs { }; mdformat-nix-alejandra = callPackage ../development/python-modules/mdformat-nix-alejandra { }; mdformat-simple-breaks = callPackage ../development/python-modules/mdformat-simple-breaks { }; + mdformat-tables = callPackage ../development/python-modules/mdformat-tables { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From 0ee2fe15fc272f5acc61787a305dd7cc013fcd33 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:43:10 +0200 Subject: [PATCH 11/12] mdformat-toc: init at 0.3.0 --- .../python-modules/mdformat-toc/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-toc/default.nix diff --git a/pkgs/development/python-modules/mdformat-toc/default.nix b/pkgs/development/python-modules/mdformat-toc/default.nix new file mode 100644 index 00000000000..56d7ce69a0d --- /dev/null +++ b/pkgs/development/python-modules/mdformat-toc/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, mdit-py-plugins +, poetry-core +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "mdformat-toc"; + version = "0.3.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "hukkin"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-3EX6kGez408tEYiR9VSvi3GTrb4ds+HJwpFflv77nkg="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + buildInputs = [ + mdformat + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "mdformat_toc" + ]; + + meta = with lib; { + description = "Mdformat plugin to generate a table of contents"; + homepage = "https://github.com/hukkin/mdformat-toc"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero polarmutex ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index aac342b0302..9ab92646857 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6219,6 +6219,7 @@ self: super: with self; { mdformat-nix-alejandra = callPackage ../development/python-modules/mdformat-nix-alejandra { }; mdformat-simple-breaks = callPackage ../development/python-modules/mdformat-simple-breaks { }; mdformat-tables = callPackage ../development/python-modules/mdformat-tables { }; + mdformat-toc = callPackage ../development/python-modules/mdformat-toc { }; mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { }; From e24030071b8a659d5278f316d0e7554660fe6242 Mon Sep 17 00:00:00 2001 From: Aldo Borrero <82811+aldoborrero@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:51:04 +0200 Subject: [PATCH 12/12] mdformat-admon: init at 0.4.0 --- .../python-modules/mdformat-admon/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/mdformat-admon/default.nix diff --git a/pkgs/development/python-modules/mdformat-admon/default.nix b/pkgs/development/python-modules/mdformat-admon/default.nix new file mode 100644 index 00000000000..1d285d89c70 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-admon/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mdformat +, python3 +, pythonOlder +}: + +let + python = python3.override { + packageOverrides = self: super: { + mdit-py-plugins = super.mdit-py-plugins.overridePythonAttrs (_prev: rec { + version = "0.4.0"; + doCheck = false; + src = fetchFromGitHub { + owner = "executablebooks"; + repo = "mdit-py-plugins"; + rev = "refs/tags/v${version}"; + hash = "sha256-YBJu0vIOD747DrJLcqiZMHq34+gHdXeGLCw1OxxzIJ0="; + }; + }); + }; + }; +in python.pkgs.buildPythonPackage rec { + pname = "mdformat-admon"; + version = "1.0.2"; + format = "flit"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "KyleKing"; + repo = pname; + rev = "v${version}"; + hash = "sha256-33Q3Re/axnoOHZ9XYA32mmK+efsSelJXW8sD7C1M/jU="; + }; + + buildInputs = with python.pkgs; [ + mdformat + ]; + + propagatedBuildInputs = with python.pkgs; [ + mdit-py-plugins + ]; + + meta = with lib; { + description = "mdformat plugin for admonitions"; + homepage = "https://github.com/KyleKing/mdformat-admon"; + license = licenses.mit; + maintainers = with maintainers; [ aldoborrero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9ab92646857..429a8c29fe2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6211,6 +6211,7 @@ self: super: with self; { md2gemini = callPackage ../development/python-modules/md2gemini { }; mdformat = callPackage ../development/python-modules/mdformat { }; + mdformat-admon = callPackage ../development/python-modules/mdformat-admon { }; mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { }; mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { };