Giter VIP home page Giter VIP logo

markdown-pdf's Issues

Tables support

Markdown:

#header1

|TableHeader1|TableHeader2|
|--|--|
|Text1|Details 1|
|ListCell|<ul><li>FirstBullet</li><li>SecondBullet</li></ul>|

Render as:

image

Must be:

image

Problems with python3.12

Hi! I recently upgraded to python3.12 and tried to install markdown-pdf the usual way with pip (I'm on MacOS by the way).

Unfortunately the installation is stuck for quite some time on this step:

user@device ~ % pip3 install markdown-pdf
Collecting markdown-pdf
  Using cached markdown_pdf-1.1-py3-none-any.whl.metadata (3.3 kB)
Collecting PyMuPDF==1.23.3 (from markdown-pdf)
  Using cached PyMuPDF-1.23.3.tar.gz (60.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... \

after 5min or so the installation fails with a huge error log that exceeds my console. The last few files look like this:

                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/pipcl.py", line 580, in build_wheel
          items = self._call_fn_build(config_settings)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/pipcl.py", line 732, in _call_fn_build
          ret = self.fn_build()
                ^^^^^^^^^^^^^^^
        File "/private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/setup.py", line 692, in build
          mupdf_build_dir = build_mupdf_unix( mupdf_local, env_extra, build_type)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/setup.py", line 928, in build_mupdf_unix
          subprocess.run( command, shell=True, check=True)
        File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'cd /private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/mupdf-1.23.2-source && XCFLAGS=-DTOFU_CJK_EXT /opt/homebrew/Cellar/[email protected]/3.12.3/bin/python3.12 ./scripts/mupdfwrap.py -d build/PyMuPDF-arm64-shared-tesseract-release -b all && echo /private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/mupdf-1.23.2-source/build/PyMuPDF-arm64-shared-tesseract-release: && ls -l /private/var/folders/3k/4k2883bs10n32h6f0ybvcmt80000gp/T/pip-install-jrpjs54o/pymupdf_b8db2ebb1db84de899638ee47b15d7ee/mupdf-1.23.2-source/build/PyMuPDF-arm64-shared-tesseract-release' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

The problem does not occur when using other pip packages. I'm happy to provide more logs if needed :)

Custom CSS

Hi, sorry if I'm missing the obvious here. How would I feed in custom CSS (I really just want to centre img's)? Cheers for any help.

TypeError: '>' not supported between instances of 'str' and 'int'

Version: markdown_pdf 1.2 (pip install markdown-pdf, with Python 3.12.3 on AMD64)

Error while trying to save a PDF:

Traceback (most recent call last):
  File "app.py", line 64, in <module>
    pdf.save("result.pdf")
  File "/home/user/app/.venv/lib/python3.12/site-packages/markdown_pdf/__init__.py", line 82, in save
    if self.toc_level > 0:
       ^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'

Steps to reproduce:

app.py:

from markdown_pdf import MarkdownPdf

[OTHER CODE]

pdf = MarkdownPdf(result)
pdf.meta["title"] = "Title"
pdf.meta["author"] = "Author"
pdf.save("result.pdf")

$ python app.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.