Unverified Commit b0b83768 authored by dotlambda's avatar dotlambda Committed by GitHub
Browse files

python3Packages.mkdocs-macros-plugin: 1.0.5 -> 1.3.9 (#439723)

parents cd98579c 5fcf0905
Loading
Loading
Loading
Loading
+72 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pytestCheckHook,
  hjson,
  jinja2,
  mkdocs,
  packaging,
  pathspec,
  python-dateutil,
  pyyaml,
  termcolor,
  super-collections,
  mkdocs-test,
  mkdocs-material,
  mkdocs-macros-test,
}:

buildPythonPackage rec {
  pname = "mkdocs-macros-plugin";
  version = "1.3.9";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "fralau";
    repo = "mkdocs-macros-plugin";
    tag = "v${version}";
    hash = "sha256-bL7oWWDoF+zH34XSwFY2H9op/97zO43HS+oO6lNFEr4=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    hjson
    jinja2
    mkdocs
    packaging
    pathspec
    python-dateutil
    pyyaml
    termcolor
    super-collections
  ];

  pythonImportsCheck = [
    "mkdocs_macros"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    mkdocs-test
    mkdocs-material
    mkdocs-macros-test
  ];

  disabledTestPaths = [
    # we do not have brew and mkdocs-d2-plugin is also not packaged in nixpkgs,
    "test/plugin_d2/test_t2.py"
  ];

  meta = {
    description = "Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code";
    homepage = "https://github.com/fralau/mkdocs-macros-plugin";
    changelog = "https://github.com/fralau/mkdocs-macros-plugin/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ tljuniper ];
  };
}
+14 −8
Original line number Diff line number Diff line
@@ -2,25 +2,31 @@
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
}:

# Is required for properly testing mkdocs-macros
buildPythonPackage rec {
  pname = "mkdocs-macros-test";
  version = "0.1.0";
  format = "setuptools";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256:1w12skm8l0r2x6z1va996lvq6z1873d0xzql9n0aja0g0v6s7ay5";
    hash = "sha256-xaujzQYPKKmATRT/Dto4KHyDNzUpqR2+6SIDiurUIvA=";
  };

  pythonImportsCheck = [ "mkdocs_macros_test" ];
  build-system = [
    setuptools
  ];

  meta = with lib; {
    homepage = "https://github.com/fralau/mkdocs-macros-test";
  pythonImportsCheck = [
    "mkdocs_macros_test"
  ];

  meta = {
    description = "Implementation of a (model) pluglet for mkdocs-macros";
    license = licenses.mit;
    maintainers = with maintainers; [ tljuniper ];
    homepage = "https://github.com/fralau/mkdocs-macros-test";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ marcel ];
  };
}
+0 −41
Original line number Diff line number Diff line
{
  lib,
  callPackage,
  buildPythonPackage,
  fetchPypi,
  mkdocs,
  jinja2,
  python-dateutil,
  termcolor,
  pyyaml,
}:

buildPythonPackage rec {
  pname = "mkdocs-macros-plugin";
  version = "1.0.5";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-/jSNdfAckR82K22ZjFez2FtQWHbd5p25JPLFEsOVwyg=";
  };

  propagatedBuildInputs = [
    jinja2
    termcolor
    python-dateutil
    pyyaml
    mkdocs
  ];

  passthru.tests.example-doc = callPackage ./tests.nix { };

  pythonImportsCheck = [ "mkdocs_macros" ];

  meta = with lib; {
    homepage = "https://github.com/fralau/mkdocs_macros_plugin";
    description = "Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code";
    license = licenses.mit;
    maintainers = with maintainers; [ tljuniper ];
  };
}
+0 −50
Original line number Diff line number Diff line
{
  setuptools,
  mkdocs,
  mkdocs-macros,
  mkdocs-material,
  runCommand,
  callPackage,
}:

let
  inherit (mkdocs-macros) pname version src;

  mkdocs-macros-test = callPackage ./mkdocs-macros-test.nix { };

  env = {
    nativeBuildInputs = [
      setuptools
      mkdocs
      mkdocs-macros
      mkdocs-macros-test
      mkdocs-material
    ];
  };
in
runCommand "mkdocs-macros-example-docs" env ''
  set -euo pipefail
  mkdir $out

  base_dir=${pname}-${version}/test
  tar --extract "--file=${src}"

  for test_dir in $base_dir/*/; do
    pushd $test_dir
    mkdocs build --site-dir=$out/$test_dir
    popd
  done

  # Do some static checks on the generated content
  pushd $out/$base_dir
  # Non-existent variables
  cat debug/index.html | grep "another one:  that"
  # File inclusion
  cat module/index.html | grep "part from an <em>included</em> file!"
  # Variable replacement
  cat module_dir/index.html | grep "total costs is 50 euros"
  # New syntax with square brackets
  cat new_syntax/index.html | grep "expensive"
  # General info on macros
  cat simple/index.html | grep "Macros Plugin Environment"
''
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
  pyyaml,
  pytestCheckHook,
  openpyxl,
  mkdocs-macros,
  mkdocs-macros-plugin,
}:

buildPythonPackage rec {
@@ -38,7 +38,7 @@ buildPythonPackage rec {
  nativeCheckInputs = [
    pytestCheckHook
    openpyxl
    mkdocs-macros
    mkdocs-macros-plugin
  ];

  pythonImportsCheck = [
Loading