MkDocs plugin that enables a markdown tag like {{ read_csv('table.csv') }} to directly insert various table formats into a page

timvink, updated 🕥 2023-01-30 13:27:40

Actions Status PyPI - Python Version PyPI PyPI - Downloads codecov GitHub contributors PyPI - License

mkdocs-table-reader-plugin

MkDocs plugin that enables a markdown tag like {{ read_csv('table.csv') }} to directly insert various table formats into a page.

For a workflow with other plugins see the blogpost building reproducible reports with MkDocs

Installation

Install the plugin using pip:

bash pip install mkdocs-table-reader-plugin

Next, add the following lines to your mkdocs.yml:

yml plugins: - search - table-reader

If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set.

Usage

In your markdown documents you can now use:

html {{ read_csv('path_to_table.csv') }}

Where the path is relative to the location of your project's mkdocs.yml file (although you can change that to be relative to your docs/ directory).

  • There are readers for .csv, .fwf, .json, .xlsx, .yaml and .tsv. There is also the read_raw() reader that will allow you to insert tables (or other content) already in markdown format.
  • See the how to guides for example of various workflows

Documentation

See timvink.github.io/mkdocs-table-reader-plugin/

Issues

Can't build container

opened on 2023-03-21 15:55:06 by CrysK

I want to create a docker container with this plugin: ``` FROM squidfunk/mkdocs-material

RUN pip install --no-cache-dir \ mkdocs-table-reader-plugin

ENTRYPOINT ["mkdocs"] But when I run it, I get an error: $ docker build -t mkdocs-material-plus_23-03-21 . [+] Building 39.4s (5/5) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 247B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/squidfunk/mkdocs-material:latest 0.0s => CACHED [1/2] FROM docker.io/squidfunk/mkdocs-material 0.0s => ERROR [2/2] RUN pip install --no-cache-dir mkdocs-table-reader-plugin 39.3s


[2/2] RUN pip install --no-cache-dir mkdocs-table-reader-plugin:

0 3.040 Collecting mkdocs-table-reader-plugin

0 3.210 Downloading mkdocs_table_reader_plugin-2.0-py3-none-any.whl (9.1 kB)

0 3.241 Requirement already satisfied: mkdocs>=1.0 in /usr/local/lib/python3.11/site-packages (from mkdocs-table-reader-plugin) (1.4.2)

0 3.497 Collecting pandas>=1.1

0 3.530 Downloading pandas-1.5.3.tar.gz (5.2 MB)

0 4.261 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 7.2 MB/s eta 0:00:00

0 5.335 Installing build dependencies: started

0 38.75 Installing build dependencies: finished with status 'error'

0 38.78 error: subprocess-exited-with-error

0 38.78

0 38.78 × pip subprocess to install build dependencies did not run successfully.

0 38.78 │ exit code: 1

0 38.78 ╰─> [305 lines of output]

0 38.78 Collecting setuptools>=51.0.0

0 38.78 Downloading setuptools-67.6.0-py3-none-any.whl (1.1 MB)

0 38.78 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 4.0 MB/s eta 0:00:00

0 38.78 Collecting wheel

0 38.78 Downloading wheel-0.40.0-py3-none-any.whl (64 kB)

0 38.78 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.5/64.5 kB 18.4 MB/s eta 0:00:00

0 38.78 Collecting Cython<3,>=0.29.32

0 38.78 Downloading Cython-0.29.33-cp311-cp311-musllinux_1_1_x86_64.whl (2.0 MB)

0 38.78 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 6.8 MB/s eta 0:00:00

0 38.78 Collecting oldest-supported-numpy>=2022.8.16

0 38.78 Downloading oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)

0 38.78 Collecting numpy==1.23.2

0 38.78 Downloading numpy-1.23.2.tar.gz (10.7 MB)

0 38.78 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 11.6 MB/s eta 0:00:00

0 38.78 Installing build dependencies: started

0 38.78 Installing build dependencies: finished with status 'done'

0 38.78 Getting requirements to build wheel: started

0 38.78 Getting requirements to build wheel: finished with status 'done'

0 38.78 Preparing metadata (pyproject.toml): started

0 38.78 Preparing metadata (pyproject.toml): finished with status 'done'

0 38.78 Building wheels for collected packages: numpy

0 38.78 Building wheel for numpy (pyproject.toml): started

0 38.78 Building wheel for numpy (pyproject.toml): finished with status 'error'

0 38.78 error: subprocess-exited-with-error

0 38.78

0 38.78 × Building wheel for numpy (pyproject.toml) did not run successfully.

0 38.78 │ exit code: 1

0 38.78 ╰─> [268 lines of output]

0 38.78 setup.py:71: RuntimeWarning: NumPy 1.23.2 may not yet support Python 3.11.

0 38.78 warnings.warn(

0 38.78 Running from numpy source directory.

0 38.78 setup.py:86: DeprecationWarning:

0 38.78

0 38.78 numpy.distutils is deprecated since NumPy 1.23.0, as a result

0 38.78 of the deprecation of distutils itself. It will be removed for

0 38.78 Python >= 3.12. For older Python versions it will remain present.

0 38.78 It is recommended to use setuptools < 60.0 for those Python versions.

0 38.78 For more details, see:

0 38.78 https://numpy.org/devdocs/reference/distutils_status_migration.html

0 38.78

0 38.78

0 38.78 import numpy.distutils.command.sdist

0 38.78 Processing numpy/random/_bounded_integers.pxd.in

0 38.78 Processing numpy/random/_mt19937.pyx

0 38.78 Processing numpy/random/mtrand.pyx

0 38.78 Processing numpy/random/bit_generator.pyx

0 38.78 Processing numpy/random/_generator.pyx

0 38.78 Processing numpy/random/_pcg64.pyx

0 38.78 Processing numpy/random/_common.pyx

0 38.78 Processing numpy/random/_philox.pyx

0 38.78 Processing numpy/random/_bounded_integers.pyx.in

0 38.78 Processing numpy/random/_sfc64.pyx

0 38.78 Cythonizing sources

0 38.78 INFO: blas_opt_info:

0 38.78 INFO: blas_armpl_info:

0 38.78 INFO: customize UnixCCompiler

0 38.78 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: blas_mkl_info:

0 38.78 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: blis_info:

0 38.78 INFO: libraries blis not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: openblas_info:

0 38.78 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: accelerate_info:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_3_10_blas_threads_info:

0 38.78 INFO: Setting PTATLAS=ATLAS

0 38.78 INFO: libraries tatlas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_3_10_blas_info:

0 38.78 INFO: libraries satlas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_blas_threads_info:

0 38.78 INFO: Setting PTATLAS=ATLAS

0 38.78 INFO: libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_blas_info:

0 38.78 INFO: libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:

0 38.78 Optimized (vendor) Blas libraries are not found.

0 38.78 Falls back to netlib Blas library which has worse performance.

0 38.78 A better performance should be easily gained by switching

0 38.78 Blas library.

0 38.78 if self._calc_info(blas):

0 38.78 INFO: blas_info:

0 38.78 INFO: libraries blas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:

0 38.78 Blas (http://www.netlib.org/blas/) libraries not found.

0 38.78 Directories to search for the libraries can be specified in the

0 38.78 numpy/distutils/site.cfg file (section [blas]) or by setting

0 38.78 the BLAS environment variable.

0 38.78 if self._calc_info(blas):

0 38.78 INFO: blas_src_info:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:2077: UserWarning:

0 38.78 Blas (http://www.netlib.org/blas/) sources not found.

0 38.78 Directories to search for the sources can be specified in the

0 38.78 numpy/distutils/site.cfg file (section [blas_src]) or by setting

0 38.78 the BLAS_SRC environment variable.

0 38.78 if self._calc_info(blas):

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 non-existing path in 'numpy/distutils': 'site.cfg'

0 38.78 INFO: lapack_opt_info:

0 38.78 INFO: lapack_armpl_info:

0 38.78 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: lapack_mkl_info:

0 38.78 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: openblas_lapack_info:

0 38.78 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: openblas_clapack_info:

0 38.78 INFO: libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: flame_info:

0 38.78 INFO: libraries flame not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_3_10_threads_info:

0 38.78 INFO: Setting PTATLAS=ATLAS

0 38.78 INFO: libraries tatlas,tatlas not found in /usr/local/lib

0 38.78 INFO: libraries tatlas,tatlas not found in /usr/lib

0 38.78 INFO:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_3_10_info:

0 38.78 INFO: libraries satlas,satlas not found in /usr/local/lib

0 38.78 INFO: libraries satlas,satlas not found in /usr/lib

0 38.78 INFO:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_threads_info:

0 38.78 INFO: Setting PTATLAS=ATLAS

0 38.78 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib

0 38.78 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/lib

0 38.78 INFO:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: atlas_info:

0 38.78 INFO: libraries f77blas,cblas,atlas not found in /usr/local/lib

0 38.78 INFO: libraries f77blas,cblas,atlas not found in /usr/lib

0 38.78 INFO:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: lapack_info:

0 38.78 INFO: libraries lapack not found in ['/usr/local/lib', '/usr/lib']

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:1902: UserWarning:

0 38.78 Lapack (http://www.netlib.org/lapack/) libraries not found.

0 38.78 Directories to search for the libraries can be specified in the

0 38.78 numpy/distutils/site.cfg file (section [lapack]) or by setting

0 38.78 the LAPACK environment variable.

0 38.78 return getattr(self, 'calc_info{}'.format(name))()

0 38.78 INFO: lapack_src_info:

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 /tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/system_info.py:1902: UserWarning:

0 38.78 Lapack (http://www.netlib.org/lapack/) sources not found.

0 38.78 Directories to search for the sources can be specified in the

0 38.78 numpy/distutils/site.cfg file (section [lapack_src]) or by setting

0 38.78 the LAPACK_SRC environment variable.

0 38.78 return getattr(self, 'calc_info{}'.format(name))()

0 38.78 INFO: NOT AVAILABLE

0 38.78 INFO:

0 38.78 INFO: numpy_linalg_lapack_lite:

0 38.78 INFO: FOUND:

0 38.78 INFO: language = c

0 38.78 INFO: define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]

0 38.78 INFO:

0 38.78 Warning: attempted relative import with no known parent package

0 38.78 /tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'

0 38.78 warnings.warn(msg)

0 38.78 running bdist_wheel

0 38.78 running build

0 38.78 running config_cc

0 38.78 INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options

0 38.78 running config_fc

0 38.78 INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options

0 38.78 running build_src

0 38.78 INFO: build_src

0 38.78 INFO: building py_modules sources

0 38.78 creating build

0 38.78 creating build/src.linux-x86_64-3.11

0 38.78 creating build/src.linux-x86_64-3.11/numpy

0 38.78 creating build/src.linux-x86_64-3.11/numpy/distutils

0 38.78 INFO: building library "npymath" sources

0 38.78 WARN: Could not locate executable armflang

0 38.78 WARN: Could not locate executable gfortran

0 38.78 WARN: Could not locate executable f95

0 38.78 WARN: Could not locate executable ifort

0 38.78 WARN: Could not locate executable ifc

0 38.78 WARN: Could not locate executable lf95

0 38.78 WARN: Could not locate executable pgfortran

0 38.78 WARN: Could not locate executable nvfortran

0 38.78 WARN: Could not locate executable f90

0 38.78 WARN: Could not locate executable f77

0 38.78 WARN: Could not locate executable fort

0 38.78 WARN: Could not locate executable efort

0 38.78 WARN: Could not locate executable efc

0 38.78 WARN: Could not locate executable g77

0 38.78 WARN: Could not locate executable g95

0 38.78 WARN: Could not locate executable pathf95

0 38.78 WARN: Could not locate executable nagfor

0 38.78 WARN: Could not locate executable frt

0 38.78 WARN: don't know how to compile Fortran code on platform 'posix'

0 38.78

0 38.78

0 38.78 [Errno 2] No such file or directory: 'gcc'

0 38.78

0 38.78

0 38.78 Traceback (most recent call last):

0 38.78 File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in

0 38.78 main()

0 38.78 File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main

0 38.78 json_out['return_val'] = hook(**hook_input['kwargs'])

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel

0 38.78 return _build_backend().build_wheel(wheel_directory, config_settings,

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 230, in build_wheel

0 38.78 return self._build_with_temp_dir(['bdist_wheel'], '.whl',

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir

0 38.78 self.run_setup()

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup

0 38.78 self).run_setup(setup_script=setup_script)

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup

0 38.78 exec(compile(code, file, 'exec'), locals())

0 38.78 File "setup.py", line 493, in

0 38.78 setup_package()

0 38.78 File "setup.py", line 485, in setup_package

0 38.78 setup(**metadata)

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/core.py", line 169, in setup

0 38.78 return old_setup(**new_attr)

0 38.78 ^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/init.py", line 153, in setup

0 38.78 return distutils.core.setup(**attrs)

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup

0 38.78 dist.run_commands()

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands

0 38.78 self.run_command(cmd)

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command

0 38.78 cmd_obj.run()

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 299, in run

0 38.78 self.run_command('build')

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command

0 38.78 self.distribution.run_command(command)

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command

0 38.78 cmd_obj.run()

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build.py", line 62, in run

0 38.78 old_build.run(self)

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run

0 38.78 self.run_command(cmd_name)

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command

0 38.78 self.distribution.run_command(command)

0 38.78 File "/tmp/pip-build-env-sztyhpty/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command

0 38.78 cmd_obj.run()

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 144, in run

0 38.78 self.build_sources()

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 155, in build_sources

0 38.78 self.build_library_sources(*libname_info)

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 288, in build_library_sources

0 38.78 sources = self.generate_sources(sources, (lib_name, build_info))

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/distutils/command/build_src.py", line 378, in generate_sources

0 38.78 source = func(extension, build_dir)

0 38.78 ^^^^^^^^^^^^^^^^^^^^^^^^^^

0 38.78 File "/tmp/pip-install-ezaovveg/numpy_c310a90dc71e4314bbfb352ad82a11b0/numpy/core/setup.py", line 758, in get_mathlib_info

0 38.78 raise RuntimeError(

0 38.78 RuntimeError: Broken toolchain: cannot link a simple C program.

0 38.78 [end of output]

0 38.78

0 38.78 note: This error originates from a subprocess, and is likely not a problem with pip.

0 38.78 ERROR: Failed building wheel for numpy

0 38.78 Failed to build numpy

0 38.78 ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

0 38.78

0 38.78 [notice] A new release of pip available: 22.3 -> 23.0.1

0 38.78 [notice] To update, run: pip install --upgrade pip

0 38.78 [end of output]

0 38.78

0 38.78 note: This error originates from a subprocess, and is likely not a problem with pip.

0 38.79 error: subprocess-exited-with-error

0 38.79

0 38.79 × pip subprocess to install build dependencies did not run successfully.

0 38.79 │ exit code: 1

0 38.79 ╰─> See above for output.

0 38.79

0 38.79 note: This error originates from a subprocess, and is likely not a problem with pip.

0 39.11

0 39.11 [notice] A new release of pip available: 22.3 -> 23.0.1

0 39.11 [notice] To update, run: pip install --upgrade pip


Dockerfile:6

5 | 6 | >>> RUN pip install --no-cache-dir \ 7 | >>> mkdocs-table-reader-plugin 8 |


ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir mkdocs-table-reader-plugin" did not complete successfully: exit code: 1 ``` I can add any other mkdocs plugin, only the table-reader plugin does not work

Add superfence notation

opened on 2023-03-06 09:29:29 by timvink

(inspired by this discussion)

Instead of {{ read_csv('table.csv') }} we could take inspiration from https://github.com/coddingtonbear/obsidian-csv-table and create a custom superfences notation like so:

md ```table-reader filepath: table.csv ```

We could add the following extra options:

  • reader (str) one of the pandas functions, like read_csv
  • keyword_arguments, a dictionary, with named arguments, for example encoding: 'utf-8'
  • filter (list of strings), where each is successively passed to .query()
  • sortBy (list of strings), passed to pandas's .sort_values()
  • maxRows (int), passed to pandas's .head()
  • columnVariables (list of strings), passed to pandas's.rename()`

You can already do all this by just using a mkdocs hook to preprocess tables.

So if you read this & have a use-case for this, let me know!

Add a reader for other formats supported by `pandas`

opened on 2023-01-30 13:00:35 by timvink

Currently, we are missing:

  • read_sas
  • read_feather
  • read_html
  • read_xml
  • read_hdf
  • read_orc
  • read_parquet
  • read_sas
  • read_spss
  • read_stata

We could add them, but we would need to add an option where you can specify which readers you want to enable, because each one will require a regex to run on all your markdown content (which can slow down your build times).

Releases

table-reader v2.0 2023-01-30 13:14:45

Table reader v2 is here!

Major new release! Highlights:

  • You can now specify tables paths relative to the markdown table (thanks @kdm9 for help building this)
  • New read_raw() reader that allows you to insert files directly. This is useful for example when you have markdown tables in separate markdown .md files.
  • New option allow_missing_files allows you to raise warnings instead of errors when files are missing
  • Rewrote documentation and added how to guides describing different use cases
  • Refactored code and extended unit tests
  • Fix bug where tables containing pipe characters (|) would break the markdown table (#29)
  • Fixed various deprecation warnings

Head over to the updated documentation to see the details

table-reader v1.2 2022-11-02 20:38:39

Added

  • New reader read_json() for reading tables in json format.

Full Changelog: https://github.com/timvink/mkdocs-table-reader-plugin/compare/v1.1.1...v1.2

table-reader v1.1.1 2022-10-30 19:04:49

Bugfix release

  • Fix bug where pandas keyword only arguments where not parsed correctly (42909cfba9a92f026ad2137aca01e6dfb73c0edc)

Full Changelog: https://github.com/timvink/mkdocs-table-reader-plugin/compare/v1.1.0...v1.1.1

table-reader v1.1.0 2022-07-13 08:42:22

Added

  • New option base_path, allowing for more flexibility in specifying where your tables are located (either relative to the config_dir where your mkdocs.yml is located (default), or docs_dir (where your docs/ folder is). See documentation for more info. (#26)

Thanks @fotrimzi for input on designing this new feature.

table-reader v1.0.0 2022-01-21 21:03:26

Major release 🎉

Added

  • You can now pass keyword arguments to to_markdown() via the readers, allowing for more table customization (#24)
  • New, re-written documentation website with more examples

table-reader v0.6.2 2021-12-15 08:05:58

Changed

  • Dropped explicit support for python 3.6 because it is end of life this month (although plugin will still work on it) and added explicit support including unit testing of python 3.10. See stop using python 3.6

mkdocs mkdocs-plugin pandas tables tabulate