From 775aff730e12e260b411d7c7642ca500b12efaf7 Mon Sep 17 00:00:00 2001 From: architeuthidae Date: Mon, 5 Aug 2024 15:51:40 +0800 Subject: [PATCH] flake/sphinx: add tikz for diagrams --- doc/manual/conf.py | 8 +++++++- flake.nix | 17 +++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/manual/conf.py b/doc/manual/conf.py index 2636c52f3..02e5d9085 100644 --- a/doc/manual/conf.py +++ b/doc/manual/conf.py @@ -70,7 +70,8 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinxarg.ext', 'sphinxcontrib.wavedrom', # see also below for config - "sphinxcontrib.jquery", + 'sphinxcontrib.jquery', + 'sphinxcontrib.tikz' # see also below for config ] mathjax_path = "https://m-labs.hk/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js" @@ -326,3 +327,8 @@ texinfo_documents = [ offline_skin_js_path = '_static/default.js' offline_wavedrom_js_path = '_static/WaveDrom.js' render_using_wavedrompy = True + +# -- Options for sphinxcontrib-tikz --------------------------------------- +# tikz_proc_suite = pdf2svg +# tikz_transparent = True +# these are the defaults \ No newline at end of file diff --git a/flake.nix b/flake.nix index 87d37f31f..0ca155479 100644 --- a/flake.nix +++ b/flake.nix @@ -309,7 +309,7 @@ inherit (pkgs.texlive) scheme-basic latexmk cmap collection-fontsrecommended fncychap titlesec tabulary varwidth framed fancyvrb float wrapfig parskip - upquote capt-of needspace etoolbox booktabs; + upquote capt-of needspace etoolbox booktabs pgf pgfplots; }; artiq-frontend-dev-wrappers = pkgs.runCommandNoCC "artiq-frontend-dev-wrappers" {} @@ -344,9 +344,11 @@ version = artiqVersion; src = self; buildInputs = with pkgs.python3Packages; [ - sphinx sphinx_rtd_theme + sphinx sphinx_rtd_theme sphinxcontrib-tikz sphinx-argparse sphinxcontrib-wavedrom - ] ++ [ artiq-comtools.packages.x86_64-linux.artiq-comtools ]; + ] ++ [ latex-artiq-manual artiq-comtools.packages.x86_64-linux.artiq-comtools + pkgs.pdf2svg + ]; buildPhase = '' export VERSIONEER_OVERRIDE=${artiqVersion} export SOURCE_DATE_EPOCH=${builtins.toString self.sourceInfo.lastModified} @@ -364,9 +366,11 @@ version = artiqVersion; src = self; buildInputs = with pkgs.python3Packages; [ - sphinx sphinx_rtd_theme + sphinx sphinx_rtd_theme sphinxcontrib-tikz sphinx-argparse sphinxcontrib-wavedrom - ] ++ [ latex-artiq-manual artiq-comtools.packages.x86_64-linux.artiq-comtools ]; + ] ++ [ latex-artiq-manual artiq-comtools.packages.x86_64-linux.artiq-comtools + pkgs.pdf2svg + ]; buildPhase = '' export VERSIONEER_OVERRIDE=${artiq.version} export SOURCE_DATE_EPOCH=${builtins.toString self.sourceInfo.lastModified} @@ -408,8 +412,9 @@ packages.x86_64-linux.vivadoEnv packages.x86_64-linux.vivado packages.x86_64-linux.openocd-bscanspi - pkgs.python3Packages.sphinx pkgs.python3Packages.sphinx_rtd_theme + pkgs.python3Packages.sphinx pkgs.python3Packages.sphinx_rtd_theme pkgs.pdf2svg pkgs.python3Packages.sphinx-argparse pkgs.python3Packages.sphinxcontrib-wavedrom latex-artiq-manual + pkgs.python3Packages.sphinxcontrib-tikz ]; shellHook = '' export LIBARTIQ_SUPPORT=`libartiq-support`