diff --git a/doc-md/.gitignore b/doc-md/.gitignore new file mode 100644 index 0000000000000..e35d8850c9688 --- /dev/null +++ b/doc-md/.gitignore @@ -0,0 +1 @@ +_build diff --git a/doc-md/_config.yml b/doc-md/_config.yml new file mode 100644 index 0000000000000..9845db5d7e69f --- /dev/null +++ b/doc-md/_config.yml @@ -0,0 +1,28 @@ +# Book settings +# Learn more at https://jupyterbook.org/customize/config.html + +title: "Nixpkgs Manual" +author: "Nixpkgs contributors" +logo: logo.svg + +# Force re-execution of notebooks on each build. +# See https://jupyterbook.org/content/execute.html +execute: + execute_notebooks: "off" + +# Define the name of the latex output file for PDF builds +latex: + latex_documents: + targetname: book.tex + +# Information about where the book exists on the web +repository: + url: https://github.com/NixOS/nixpkgs # Online location of your book + path_to_book: doc-md # Optional path to your book, relative to the repository root + branch: master # Which branch of the repository should be used when creating links (optional) + +# Add GitHub buttons to your book +# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository +html: + use_issues_button: true + use_repository_button: true diff --git a/doc-md/default.nix b/doc-md/default.nix new file mode 100644 index 0000000000000..43feacda670e6 --- /dev/null +++ b/doc-md/default.nix @@ -0,0 +1,94 @@ +{ pkgs ? (import ./.. { }) +}: + +with pkgs; + +let + toc = import ./toc.nix; + + # Some files get included in the build directory, but are + # only needed when doing the old docbook build. + unusedFiles = [ + "doc-support/parameters.xml" + "manual.xml" + "release-notes.xml" # Not used at all, should be removed + ]; + + # Take the source tree from the old docs, convert everything to .md + # Temporary solution. + mdInput = stdenv.mkDerivation { + name = "nixpkgs-manual-md-input"; + src = ../doc; + nativeBuildInputs = [ + pandoc + ]; + + buildPhase = '' + for file in "${lib.concatStringsSep " " unusedFiles}"; do + echo "Removing $file" + rm $file + done + ''; + + installPhase = '' + mkdir -p $out + # Convert Docbook to CommonMark + for file in `find . -name "*.xml"`; do + newfile="$out/''${file%.*}.md" + echo "Converting $file to $newfile" + mkdir -p "$out/$(dirname $file)" + pandoc --from docbook --to commonmark "$file" -o "$newfile" + done + # Copy existing CommonMark files + for file in `find . -name "*.md"`; do + bname="$(basename $file)" + # Remove section/chapter parts + newfile="$out/$(dirname $file)/''${bname%%.*}.md" + echo "Moving $file to $newfile" + mkdir -p "$out/$(dirname $file)" + cp "$file" "$newfile" + done + ''; + }; + + logo = fetchurl { + url = "https://raw.githubusercontent.com/NixOS/nixos-homepage/053ef7b456d1333197b08bcb36700249d3291e55/logo/nixos-hex.svg"; + sha256 = "RIsQdOGgtgX3EngW4g6r/yEcYaNd9j9PFYJNxK3B1R8="; + }; + + # Build the manual + manual = let + tocForManual = builtins.toFile "toc.json" (builtins.toJSON toc); + in callPackage ( + { stdenv + , python3 + }: + + stdenv.mkDerivation { + name = "nixpkgs-manual"; + + src = ./.; + + nativeBuildInputs = [ + python3.pkgs.jupyter-book + ]; + + buildPhase = '' + ln -s ${mdInput} doc + cp ${tocForManual} _toc.yml + cp ${logo} logo.svg + jupyter-book build -n --keep-going . + ''; + + installPhase = '' + mkdir -p $out/share/doc/nixpkgs-manual + mv -T _build/html $out/share/doc/nixpkgs-manual + ''; + + passthru = { + inherit logo mdInput toc; + }; + } + ) { }; + +in manual diff --git a/doc-md/toc.nix b/doc-md/toc.nix new file mode 100644 index 0000000000000..8b4ffd39bf15a --- /dev/null +++ b/doc-md/toc.nix @@ -0,0 +1,279 @@ +# Table of contents +# +# This file is `_toc.yml` but in Nix. +# https://jupyterbook.org/customize/toc.html +# +[ + { + file = "doc/preface.md"; + } + { + part = "Using Nixpkgs"; + chapters = [ + { + file = "doc/using/configuration.md"; + } + { + file = "doc/using/overlays.md"; + } + { + file = "doc/using/overrides.md"; + } + { + file = "doc/functions.md"; + sections = [ + { + file = "doc/functions/debug"; + } + { + file = "doc/functions/generators"; + } + { + file = "doc/functions/library"; + sections = [ + { + file = "doc/functions/library/asserts"; + } + { + file = "doc/functions/library/attrsets"; + } + ]; + } + { + file = "doc/functions/nix-gitignore"; + } + { + file = "doc/functions/prefer-remote-fetch"; + } + ]; + } + ]; + } + { + part = "Standard environment"; + chapters = [ + { + file = "doc/stdenv/stdenv.md"; + } + { + file = "doc/stdenv/meta.md"; + } + { + file = "doc/stdenv/multiple-output.md"; + } + { + file = "doc/stdenv/cross-compilation.md"; + } + { + file = "doc/stdenv/platform-notes.md"; + } + ]; + } + { + part = "Builders"; + chapters = [ + { + file = "doc/builders/fetchers.md"; + } + { + file = "doc/builders/trivial-builders.md"; + } + { + file = "doc/builders/special.md"; + sections = [ + { + file = "doc/builders/special/fhs-environments"; + } + { + file = "doc/builders/special/mkshell"; + } + ]; + } + { + file = "doc/builders/images.md"; + sections = [ + { + file = "doc/builders/images/appimagetools"; + } + { + file = "doc/builders/images/dockertools"; + } + { + file = "doc/builders/images/ocitools"; + } + { + file = "doc/builders/images/snaptools"; + } + ]; + } + { + file = "doc/languages-frameworks/index.md"; + sections = [ + { + file = "doc/languages-frameworks/agda"; + } + { + file = "doc/languages-frameworks/android"; + } + { + file = "doc/languages-frameworks/beam"; + } + { + file = "doc/languages-frameworks/bower"; + } + { + file = "doc/languages-frameworks/coq"; + } + { + file = "doc/languages-frameworks/crystal"; + } + { + file = "doc/languages-frameworks/dotnet"; + } + { + file = "doc/languages-frameworks/emscripten"; + } + { + file = "doc/languages-frameworks/gnome"; + } + { + file = "doc/languages-frameworks/go"; + } + { + file = "doc/languages-frameworks/haskell"; + } + { + file = "doc/languages-frameworks/idris"; + } + { + file = "doc/languages-frameworks/ios"; + } + { + file = "doc/languages-frameworks/java"; + } + { + file = "doc/languages-frameworks/lua"; + } + { + file = "doc/languages-frameworks/maven"; + } + { + file = "doc/languages-frameworks/node"; + } + { + file = "doc/languages-frameworks/ocaml"; + } + { + file = "doc/languages-frameworks/perl"; + } + { + file = "doc/languages-frameworks/php"; + } + { + file = "doc/languages-frameworks/python"; + } + { + file = "doc/languages-frameworks/qt"; + } + { + file = "doc/languages-frameworks/r"; + } + { + file = "doc/languages-frameworks/ruby"; + } + { + file = "doc/languages-frameworks/rust"; + } + { + file = "doc/languages-frameworks/texlive"; + } + { + file = "doc/languages-frameworks/titanium"; + } + { + file = "doc/languages-frameworks/vim"; + } + ]; + } + { + file = "doc/builders/packages/index.md"; + sections = [ + { + file = "doc/builders/packages/cataclysm-dda"; + } + { + file = "doc/builders/packages/citrix"; + } + { + file = "doc/builders/packages/dlib"; + } + { + file = "doc/builders/packages/eclipse"; + } + { + file = "doc/builders/packages/elm"; + } + { + file = "doc/builders/packages/emacs"; + } + { + file = "doc/builders/packages/ibus"; + } + { + file = "doc/builders/packages/kakoune"; + } + { + file = "doc/builders/packages/linux"; + } + { + file = "doc/builders/packages/locales"; + } + { + file = "doc/builders/packages/nginx"; + } + { + file = "doc/builders/packages/opengl"; + } + { + file = "doc/builders/packages/shell-helpers"; + } + { + file = "doc/builders/packages/steam"; + } + { + file = "doc/builders/packages/unfree"; + } + { + file = "doc/builders/packages/urxvt"; + } + { + file = "doc/builders/packages/weechat"; + } + { + file = "doc/builders/packages/xorg"; + } + ]; + } + ]; + } + { + part = "Contributing to Nixpkgs"; + chapters = [ + { + file = "doc/contributing/quick-start"; + } + { + file = "doc/contributing/coding-conventions"; + } + { + file = "doc/contributing/submitting-changes"; + } + { + file = "doc/contributing/reviewing-contributions"; + } + { + file = "doc/contributing/contributing-to-documentation"; + } + ]; + } +] diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index a0e9917b8ec5a..2b0e2c98da239 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -124,7 +124,7 @@ Let's present the luarocks way first and the manual one in a second time. ### Packaging a library on luarocks -[Luarocks.org](www.luarocks.org) is the main repository of lua packages. +[Luarocks.org](https://www.luarocks.org) is the main repository of lua packages. The site proposes two types of packages, the rockspec and the src.rock (equivalent of a [rockspec](https://github.com/luarocks/luarocks/wiki/Rockspec-format) but with the source). These packages can have different build types such as `cmake`, `builtin` etc . diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md index 84ad567e8c212..f5fba4a3a82c7 100644 --- a/doc/languages-frameworks/vim.section.md +++ b/doc/languages-frameworks/vim.section.md @@ -249,9 +249,9 @@ Sample output2: ## Adding new plugins to nixpkgs -Nix expressions for Vim plugins are stored in [pkgs/misc/vim-plugins](/pkgs/misc/vim-plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](/pkgs/misc/vim-plugins/update.py). This creates a [generated.nix](/pkgs/misc/vim-plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](/pkgs/misc/vim-plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`. +Nix expressions for Vim plugins are stored in `pkgs/misc/vim-plugins`. For the vast majority of plugins, Nix expressions are automatically generated by running `pkgs/misc/vim-plugins/update.py`. This creates a `generated.nix` (`pkgs/misc/vim-plugins/generated.nix`) file based on the plugins listed in `vim-plugin-names` (`pkgs/misc/vim-plugins/vim-plugin-names`). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`. -Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](/pkgs/misc/vim-plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added: +Some plugins require overrides in order to function properly. Overrides are placed in `overrides.nix` (`/pkgs/misc/vim-plugins/overrides.nix`). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added: ``` deoplete-fish = super.deoplete-fish.overrideAttrs(old: { diff --git a/doc/old/cross.txt b/doc/old/cross.txt deleted file mode 100644 index 064ca8d37b01d..0000000000000 --- a/doc/old/cross.txt +++ /dev/null @@ -1,329 +0,0 @@ -Setting up a cross compiler with Nix - -"Cross compilation" means compiling a program on one machine for another -type of machine. A typical use of cross compilation is to compile programs -for embedded devices. These devices often don't have the computing power -and memory to compile programs natively. - -For a fully working cross compiler the following are needed: - -* cross binutils: assembler, archiver, linker, etcetera that understand -the format of the target system - -* cross compiler: a compiler that can generate binary code and object files -for the target platform - -* cross C library: a library to link object files with to create fully -functional programs - -Cross compilers are difficult to set up. A lot of people report that they -cannot succeed in building a cross toolchain successfully. The answers -usually consist of "download this pre-built toolchain", which is equally -unhelpful. - -A toolchain is set up in five steps: - -1. build binutils to that can run on the host platform, but generate code -for the target platform - -2. build Linux kernel headers for the target platform - -3. build a minimal C only version of GCC, that can run on the host platform -and generate code for the target platform - -4. build a C library for the target platform. This includes the dynamic -linker, C library, etc. - -5. build a full GCC - -**** -NB: - -Keep in mind that many programs are not very well suited for cross -compilation. Either they are not intended to run on other platforms, -because the code is highly platform specific, or the configuration process -is not written with cross compilation in mind. - -Nix will not solve these problems for you! -*** - -This document describes to set up a cross compiler to generate code for -arm-linux with uClibc and runs on i686-linux. The "stdenv" used is the -default from the standard Nix packages collection. - -Step 1: build binutils for arm-linux in the stdenv for i686-linux - ---- -{stdenv, fetchurl, noSysDirs}: - -stdenv.mkDerivation { - name = "binutils-2.16.1-arm"; - builder = ./builder.sh; - src = fetchurl { - url = "http://ftp.nluug.nl/gnu/binutils/binutils-2.16.1.tar.bz2"; - sha256 = "1ian3kwh2vg6hr3ymrv48s04gijs539vzrq62xr76bxbhbwnz2np"; - }; - inherit noSysDirs; - configureFlags = [ "--target=arm-linux" ]; -} ---- - -This will compile binutils that will run on i686-linux, but knows the -format used by arm-linux. - -Step 2: build kernel headers for the target architecture - - default.nix for kernel-headers-arm: - ---- -{stdenv, fetchurl}: - -assert stdenv.buildPlatform.system == "i686-linux"; - -stdenv.mkDerivation { - name = "linux-headers-2.6.13.1-arm"; - builder = ./builder.sh; - src = fetchurl { - url = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.13.1.tar.bz2"; - sha256 = "12qxmc827fjhaz53kjy7vyrzsaqcg78amiqsb3qm20z26w705lma"; - }; -} ---- - - builder.sh for kernel-headers-arm: - ---- -source $stdenv/setup - - -buildPhase() { - make include/linux/version.h -} - -buildPhase=buildPhase - - -installPhase() { - mkdir $out - mkdir $out/include - #cd $out/include - #ln -s asm-arm asm - make include/asm ARCH=arm - cp -prvd include/linux include/asm include/asm-arm include/asm-generic $out/include - echo -n > $out/include/linux/autoconf.h -} - -installPhase=installPhase - - -genericBuild ---- - -Step 3: build a minimal GCC - -Extra/different parameters include the target platform and the kernel -headers argument (this needs a major cleanup, as well as the name, it -needs to be different!). Profiled compilers are disabled. The tarball -used here is just gcc-core. For some reason it doesn't install nicely -if the whole tarball is used (or is this some braino on my side? -- AH). - -Only C is used, because for other languages (such as C++) extra libraries -need to be compiled, for which libraries compiled for the target system -are needed. - -There is a bit of evilness going on. The cross compiled utilities need -to be either copied to or be linked from the output tree of the compiler. -(Is this really true? Back this up with arguments! -- AH) - -Symbolic links are not something we want inside the Nix store. - ---- -{ stdenv, fetchurl, noSysDirs -, langC ? true, langCC ? true, langF77 ? false -, profiledCompiler ? false -, binutilsArm -, kernelHeadersArm -}: - -assert langC; - -stdenv.mkDerivation { - name = "gcc-4.0.2-arm"; - builder = ./builder.sh; - src = fetchurl { - url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2; - sha256 = "02fxh0asflm8825w23l2jq1wvs7hbnam0jayrivg7zdv2ifnc0rc"; - }; - # !!! apply only if noSysDirs is set - patches = [./no-sys-dirs.patch ./gcc-inhibit.patch]; - inherit noSysDirs langC langCC langF77 profiledCompiler; - buildInputs = [binutilsArm]; - inherit kernelHeadersArm binutilsArm; - platform = "arm-linux"; -} ---- - -The builder.sh for a cross-compiler. Note that the binutils are prefixed -with the architecture name, so arm-linux-ld instead of ld, etc. This is -necessary because when we cross-compile a lot of programs look for these -tools with these specific names. The standard gcc-wrapper does not take this -into account yet. - ---- -source $stdenv/setup - - -export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy -mkdir $NIX_FIXINC_DUMMY - - -if test "$noSysDirs" = "1"; then - - if test "$noSysDirs" = "1"; then - # Figure out what extra flags to pass to the gcc compilers - # being generated to make sure that they use our glibc. - if test -e $NIX_CC/nix-support/orig-glibc; then - glibc=$(cat $NIX_CC/nix-support/orig-glibc) - # Ugh. Copied from gcc-wrapper/builder.sh. We can't just - # source in $NIX_CC/nix-support/add-flags, since that - # would cause *this* GCC to be linked against the - # *previous* GCC. Need some more modularity there. - extraCFlags="-B$glibc/lib -isystem $glibc/include" - extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \ - -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2" - - # Oh, what a hack. I should be shot for this. - # In stage 1, we should link against the previous GCC, but - # not afterwards. Otherwise we retain a dependency. - # However, ld-wrapper, which adds the linker flags for the - # previous GCC, is also used in stage 2/3. We can prevent - # it from adding them by NIX_GLIBC_FLAGS_SET, but then - # gcc-wrapper will also not add them, thereby causing - # stage 1 to fail. So we use a trick to only set the - # flags in gcc-wrapper. - hook=$(pwd)/ld-wrapper-hook - echo "NIX_GLIBC_FLAGS_SET=1" > $hook - export NIX_LD_WRAPPER_START_HOOK=$hook - fi - - export NIX_EXTRA_CFLAGS=$extraCFlags - export NIX_EXTRA_LDFLAGS=$extraLDFlags - export CFLAGS=$extraCFlags - export CXXFLAGS=$extraCFlags - export LDFLAGS=$extraLDFlags - fi - -else - patches="" -fi - - -preConfigure=preConfigure -preConfigure() { - - # Determine the frontends to build. - langs="c" - if test -n "$langCC"; then - langs="$langs,c++" - fi - if test -n "$langF77"; then - langs="$langs,f77" - fi - - # Cross compiler evilness - mkdir -p $out - mkdir -p $out/arm-linux - mkdir -p $out/arm-linux/bin - ln -s $binutilsArm/arm-linux/bin/as $out/arm-linux/bin/as - ln -s $binutilsArm/arm-linux/bin/ld $out/arm-linux/bin/ld - ln -s $binutilsArm/arm-linux/bin/ar $out/arm-linux/bin/ar - ln -s $binutilsArm/arm-linux/bin/ranlib $out/arm-linux/bin/ranlib - - # Perform the build in a different directory. - mkdir ../build - cd ../build - - configureScript=../$sourceRoot/configure - configureFlags="--enable-languages=$langs --target=$platform --disable-threads --disable-libmudflap --disable-shared --with-headers=$kernelHeadersArm/include --disable-multilib" -} - - -postInstall=postInstall -postInstall() { - # Remove precompiled headers for now. They are very big and - # probably not very useful yet. - find $out/include -name "*.gch" -exec rm -rf {} \; -prune - - # Remove `fixincl' to prevent a retained dependency on the - # previous gcc. - rm -rf $out/libexec/gcc/*/*/install-tools -} - - -#if test -z "$profiledCompiler"; then - #makeFlags="bootstrap" -#else - #makeFlags="profiledbootstrap" -#fi - -genericBuild ---- - -Step 4: build a C library for the target platform. - -The previous steps are enough to compile a C library. In our case we take -uClibc. It's intended to be a small sized replacement for glibc. It is widely -used in embedded environments. - -... - -Step 5: Build a compiler to link with the newly built C library. - -... - -If we restrict the compiler to just C programs it is relatively easy, -since we only need to wrap the GCC we built in the previous step with all -the right tools and the right C library. Successfully compiled programs with -this compiler and verified to be working on a HP Jornada 820 running Linux -are "patch", "make" and "wget". - -If we want to build C++ programs it gets a lot more difficult. GCC has a -three step compilation process. In the first step a simple compiler, called -xgcc, that can compile only C programs is built. With that compiler it -compiles itself two more times: one time to build a full compiler, and another -time to build a full compiler once again with the freshly built compiler from -step 2. In the second and third step support for C++ is compiled, if this -is configured. - -One of the libraries that has to be built for C++ support step is libstdc++. -This library uses xgcc, even when cross compiling, since libstdc++ has to be -compiled for arm-linux. - -One of the compiler flags that GCC uses for this compiler is called X_CFLAGS. -This is used by the Nix build process to set the dynamic linker, glibc -in the case of i686-linux using the default Nix packages collection. - -Obiously, since we need to compile libstc++ for arm-linux with uClibc linking -will not be done correctly: you can't link object files built for arm-linux -with a glibc built for i686-linux. - -Setting X_CFLAGS to use the uClibc libraries and dynamic linker will fail -too. Earlier on in the build process these flags are used to compile important -files like libgcc.a by the host system gcc, which does need to be linked -to glibc. To make this work correctly you will need to carefully juggle -with compilation flags. This is still work in progress for Nix. - - ---- - -After successfully completing the whole toolchain you can start building -packages with the newly built tools. To make everything build correctly -you will need a stdenv for your target platform. Setting up this platform -will take some effort. Right now there is a very experimental setup for -arm-linux, which needs to be cleaned up before it is production ready. - -Please note that many packages are not well suited for cross-compilation. -Even though the package itself might be very well portable often the -buildscripts are not. One thing that we have seen that causes frequent -build failures is the use of the LD variable. This is often set to 'ld' -and not $(CROSS)-ld. diff --git a/pkgs/development/python-modules/jupyter-book/default.nix b/pkgs/development/python-modules/jupyter-book/default.nix new file mode 100644 index 0000000000000..4fc20a739c04f --- /dev/null +++ b/pkgs/development/python-modules/jupyter-book/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pyyaml +, docutils +, sphinx +, myst-nb +, click +, setuptools +, nbformat +, nbconvert +, jsonschema +, sphinx-togglebutton +, sphinx-copybutton +, sphinx-comments +, sphinxcontrib-bibtex +, sphinx-book-theme +, sphinx-thebe +, sphinx-panels +, pythonOlder +}: + +buildPythonPackage rec { + pname = "jupyter-book"; + version = "0.8.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "5a09311101e0cb2712ee97748f0bead732c7f6128831f68a0751700cd8467f41"; + }; + + propagatedBuildInputs = [ + pyyaml + docutils + sphinx + myst-nb + click + setuptools + nbformat + nbconvert + jsonschema + sphinx-togglebutton + sphinx-copybutton + sphinx-comments + sphinxcontrib-bibtex + sphinx-book-theme + sphinx-thebe + sphinx-panels + ]; + + disabled = pythonOlder "3.6"; + + meta = { + description = "Create an online book with Jupyter Notebooks"; + license = lib.licenses.bsd3; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/jupyter-cache/default.nix b/pkgs/development/python-modules/jupyter-cache/default.nix new file mode 100644 index 0000000000000..7eceae59afe0c --- /dev/null +++ b/pkgs/development/python-modules/jupyter-cache/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchPypi +, attrs +, nbformat +, nbdime +, nbclient +, sqlalchemy +, pythonOlder +, click-completion +, click-log +}: + +buildPythonPackage rec { + pname = "jupyter-cache"; + version = "0.4.1"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "cbcac451af61f94703d8630a10356b0d8a169c04c794045c8b0af11777b217fe"; + }; + + propagatedBuildInputs = [ + attrs + nbformat + nbdime + nbclient + sqlalchemy + ]; + + checkInputs = [ + click-completion + click-log + ]; + + meta = with lib; { + description = "A defined interface for working with a cache of jupyter notebooks"; + homepage = https://github.com/ExecutableBookProject/jupyter-cache; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/jupyter-sphinx/default.nix b/pkgs/development/python-modules/jupyter-sphinx/default.nix index 4d2efcf00b7ae..2da21db1eb145 100644 --- a/pkgs/development/python-modules/jupyter-sphinx/default.nix +++ b/pkgs/development/python-modules/jupyter-sphinx/default.nix @@ -9,12 +9,12 @@ buildPythonPackage rec { pname = "jupyter-sphinx"; - version = "0.2.4"; + version = "0.3.2"; src = fetchPypi { inherit version; pname = "jupyter_sphinx"; - sha256 = "b5ba1efdd1488b385de0068036a665932ed93998e40ce3a342c60f0926781fd9"; + sha256 = "37fc9408385c45326ac79ca0452fbd7ae2bf0e97842d626d2844d4830e30aaf2"; }; propagatedBuildInputs = [ nbformat sphinx ipywidgets ]; diff --git a/pkgs/development/python-modules/markdown-it-py/default.nix b/pkgs/development/python-modules/markdown-it-py/default.nix new file mode 100644 index 0000000000000..af14f12e5f453 --- /dev/null +++ b/pkgs/development/python-modules/markdown-it-py/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, attrs +, pythonOlder +}: + +buildPythonPackage rec { + pname = "markdown-it-py"; + version = "0.5.6"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "6143d11221495edbf71beb7e455821ae6c8f0156710a1b11812662ed6dbd165b"; + }; + + propagatedBuildInputs = [ + attrs + ]; + + doCheck = false; + + meta = with lib; { + description = "Python port of markdown-it. Markdown parsing, done right"; + homepage = https://github.com/executablebooks/markdown-it-py; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/myst-nb/default.nix b/pkgs/development/python-modules/myst-nb/default.nix new file mode 100644 index 0000000000000..539966dcd06f4 --- /dev/null +++ b/pkgs/development/python-modules/myst-nb/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchPypi +, myst-parser +, docutils +, sphinx +, jupyter-sphinx +, jupyter-cache +, ipython +, nbformat +, nbconvert +, ipywidgets +, pyyaml +, sphinx-togglebutton +, importlib-metadata +, pythonOlder +}: + +buildPythonPackage rec { + pname = "myst-nb"; + version = "0.10.1"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "c803da2cf42bc88182ca129b3e7f3b122899fd263a70dc79be06303bc450d12b"; + }; + + propagatedBuildInputs = [ + myst-parser + docutils + sphinx + jupyter-sphinx + jupyter-cache + ipython + nbformat + nbconvert + ipywidgets + pyyaml + sphinx-togglebutton + importlib-metadata + ]; + + meta = with lib; { + description = "A Jupyter Notebook Sphinx reader built on top of the MyST markdown parser"; + homepage = https://github.com/executablebooks/myst_nb; + license = licenses.bsd3; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/myst-parser/default.nix b/pkgs/development/python-modules/myst-parser/default.nix new file mode 100644 index 0000000000000..82c4142578771 --- /dev/null +++ b/pkgs/development/python-modules/myst-parser/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchPypi +, markdown-it-py +, pyyaml +, docutils +, sphinx +, pythonOlder +}: + +buildPythonPackage rec { + pname = "myst-parser"; + version = "0.12.10"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "4612c46196e0344bb7e49dbc3deb288f9b9a88fcf6e9f210f7f3ea5bc9899bfc"; + }; + + propagatedBuildInputs = [ + markdown-it-py + pyyaml + docutils + sphinx + ]; + + meta = with lib; { + description = "An extended commonmark compliant parser, with bridges to docutils & sphinx"; + homepage = https://github.com/executablebooks/MyST-Parser; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/pydata-sphinx-theme/default.nix b/pkgs/development/python-modules/pydata-sphinx-theme/default.nix new file mode 100644 index 0000000000000..7836846f885a1 --- /dev/null +++ b/pkgs/development/python-modules/pydata-sphinx-theme/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildPythonPackage +, fetchPypi +, sphinx +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pydata-sphinx-theme"; + version = "0.4.1"; + + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "4e95d0dca0a64ba9471a89cdb6197cf8bb81b31f75ad0b7b6f0e85196fb7fe39"; + }; + + propagatedBuildInputs = [ + sphinx + ]; + + meta = with lib; { + description = "Bootstrap-based Sphinx theme from the PyData community"; + homepage = https://github.com/pandas-dev/pydata-sphinx-theme; + license = licenses.bsd3; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-book-theme/default.nix b/pkgs/development/python-modules/sphinx-book-theme/default.nix new file mode 100644 index 0000000000000..3f2bdbfb4999d --- /dev/null +++ b/pkgs/development/python-modules/sphinx-book-theme/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pyyaml +, docutils +, sphinx +, click +, pydata-sphinx-theme +, beautifulsoup4 +, importlib-resources +, pythonOlder +}: + +buildPythonPackage rec { + pname = "sphinx-book-theme"; + version = "0.0.39"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "07f9651233cb8ad4f5bde2b88205597622c6ef57c4d9f8799e93999e7ac4f070"; + }; + + propagatedBuildInputs = [ + pyyaml + docutils + sphinx + click + pydata-sphinx-theme + beautifulsoup4 + importlib-resources + ]; + + meta = with lib; { + description = "Jupyter Book: Create an online book with Jupyter Notebooks"; + homepage = https://jupyterbook.org/; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-comments/default.nix b/pkgs/development/python-modules/sphinx-comments/default.nix new file mode 100644 index 0000000000000..d6ab5d2ef21ca --- /dev/null +++ b/pkgs/development/python-modules/sphinx-comments/default.nix @@ -0,0 +1,25 @@ +{ lib +, buildPythonPackage +, fetchPypi +, sphinx +}: + +buildPythonPackage rec { + pname = "sphinx-comments"; + version = "0.0.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "00170afff27019fad08e421da1ae49c681831fb2759786f07c826e89ac94cf21"; + }; + + propagatedBuildInputs = [ + sphinx + ]; + + meta = with lib; { + description = "Add comments and annotation to your documentation"; + homepage = https://github.com/executablebooks/sphinx-comments; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-copybutton/default.nix b/pkgs/development/python-modules/sphinx-copybutton/default.nix new file mode 100644 index 0000000000000..0286adfeeb938 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-copybutton/default.nix @@ -0,0 +1,25 @@ +{ lib +, buildPythonPackage +, fetchPypi +, sphinx +}: + +buildPythonPackage rec { + pname = "sphinx-copybutton"; + version = "0.3.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0e0461df394515284e3907e3f418a0c60ef6ab6c9a27a800c8552772d0a402a2"; + }; + + propagatedBuildInputs = [ + sphinx + ]; + + meta = with lib; { + description = "Add a copy button to each of your code cells"; + homepage = https://github.com/ExecutableBookProject/sphinx-copybutton; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-panels/default.nix b/pkgs/development/python-modules/sphinx-panels/default.nix new file mode 100644 index 0000000000000..cda6233ca0427 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-panels/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchPypi +, docutils +, sphinx +, importlib-resources +}: + +buildPythonPackage rec { + pname = "sphinx-panels"; + version = "0.5.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "b7b3faa05f37b7318fd14cd85c4effa1ab905dfc8bed236a63978565ea461ae4"; + }; + + # # Package conditions to handle + # # might have to sed setup.py and egg.info in patchPhase + # # sed -i "s/...//" + # sphinx>=2,<4 + # importlib-resources~=3.0.0; python_version < "3.7" + # # Extra packages (may not be necessary) + # sphinx-rtd-theme # themes + # pydata-sphinx-theme~=0.4.0 # themes + # sphinx-book-theme~=0.0.36 # themes + # myst-parser~=0.12.9 # themes + # pre-commit~=2.7.0 # code_style + # pytest~=6.0.1 # testing + # pytest-regressions~=2.0.1 # testing + # sphinx-autobuild # live-dev + # web-compile~=0.2.0 # live-dev + propagatedBuildInputs = [ + docutils + sphinx + importlib-resources + ]; + + meta = with lib; { + description = "A sphinx extension for creating panels in a grid layout"; + homepage = https://github.com/executablebooks/sphinx-panels; + license = licenses.mit; + # maintainers = [ maintainers. ]; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-thebe/default.nix b/pkgs/development/python-modules/sphinx-thebe/default.nix new file mode 100644 index 0000000000000..4811d74e2dff8 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-thebe/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, sphinx +}: + +buildPythonPackage rec { + pname = "sphinx-thebe"; + version = "0.0.8"; + + src = fetchPypi { + inherit pname version; + sha256 = "6229caa99e996776ffdc5c658d9dcce09e0c749727e5aa3d280a2bbf3a72068a"; + }; + + # # Package conditions to handle + # # might have to sed setup.py and egg.info in patchPhase + # # sed -i "s/...//" + # sphinx (>=1.8) + # # Extra packages (may not be necessary) + # myst-parser[sphinx] ; extra == 'sphinx' + # sphinx-book-theme ; extra == 'sphinx' + # jupyter-sphinx ; extra == 'sphinx' + # sphinx-panels ; extra == 'sphinx' + # pytest ; extra == 'testing' + # pytest-regressions ; extra == 'testing' + # beautifulsoup4 ; extra == 'testing' + propagatedBuildInputs = [ + sphinx + ]; + + meta = with lib; { + description = "Integrate interactive code blocks into your documentation with Thebe and Binder"; + homepage = https://github.com/executablebooks/sphinx-thebe; + license = licenses.mit; + # maintainers = [ maintainers. ]; + }; +} \ No newline at end of file diff --git a/pkgs/development/python-modules/sphinx-togglebutton/default.nix b/pkgs/development/python-modules/sphinx-togglebutton/default.nix new file mode 100644 index 0000000000000..222637340979b --- /dev/null +++ b/pkgs/development/python-modules/sphinx-togglebutton/default.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, wheel +, sphinx +, docutils +}: + +buildPythonPackage rec { + pname = "sphinx-togglebutton"; + version = "0.2.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "41cbe2f87459eade8dc5718bb56146e8e113a05fb97459b90472470f0d357b55"; + }; + + propagatedBuildInputs = [ + setuptools + wheel + sphinx + docutils + ]; + + meta = with lib; { + description = "Toggle page content and collapse admonitions in Sphinx"; + homepage = https://github.com/executablebooks/sphinx-togglebutton; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8c30200648b55..2a02385338604 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3198,6 +3198,10 @@ in { jupyter = callPackage ../development/python-modules/jupyter { }; + jupyter-book = callPackage ../development/python-modules/jupyter-book { }; + + jupyter-cache = callPackage ../development/python-modules/jupyter-cache { }; + jupyter-c-kernel = callPackage ../development/python-modules/jupyter-c-kernel { }; jupyter_client = if isPy3k then @@ -3676,6 +3680,8 @@ in { else callPackage ../development/python-modules/markdown/3_1.nix { }; + markdown-it-py = callPackage ../development/python-modules/markdown-it-py { }; + markdown-macros = callPackage ../development/python-modules/markdown-macros { }; markdownsuperscript = callPackage ../development/python-modules/markdownsuperscript { }; @@ -3994,6 +4000,10 @@ in { mysql-connector = callPackage ../development/python-modules/mysql-connector { }; + myst-nb = callPackage ../development/python-modules/myst-nb { }; + + myst-parser = callPackage ../development/python-modules/myst-parser { }; + nagiosplugin = callPackage ../development/python-modules/nagiosplugin { }; namebench = callPackage ../development/python-modules/namebench { }; @@ -4611,6 +4621,8 @@ in { pkuseg = callPackage ../development/python-modules/pkuseg { }; + pydata-sphinx-theme = callPackage ../development/python-modules/pydata-sphinx-theme { }; + python-csxcad = callPackage ../development/python-modules/python-csxcad { }; python-openems = callPackage ../development/python-modules/python-openems { }; @@ -6850,6 +6862,18 @@ in { sphfile = callPackage ../development/python-modules/sphfile { }; + sphinx-book-theme = callPackage ../development/python-modules/sphinx-book-theme { }; + + sphinx-comments = callPackage ../development/python-modules/sphinx-comments { }; + + sphinx-copybutton = callPackage ../development/python-modules/sphinx-copybutton { }; + + sphinx-panels = callPackage ../development/python-modules/sphinx-panels { }; + + sphinx-thebe = callPackage ../development/python-modules/sphinx-thebe { }; + + sphinx-togglebutton = callPackage ../development/python-modules/sphinx-togglebutton { }; + sphinxcontrib-applehelp = callPackage ../development/python-modules/sphinxcontrib-applehelp { }; sphinxcontrib-autoapi = callPackage ../development/python-modules/sphinxcontrib-autoapi { };