Giter VIP home page Giter VIP logo

md2pdf's Introduction

md2pdf logo

Convert Markdown files to PDF with styles.

GitHub Actions Workflow Status GitHub Actions Workflow Status

Installation

The easiest way to go is to use pip:

$ pip install md2pdf

Nota bene: ensure, Weasyprint is fully functional before using md2pdf. You will find installation instructions in the project documentation: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation

Usage

As a CLI

Usage: md2pdf [OPTIONS] MD PDF

  md2pdf command line tool.

Options:
  --css PATH
  -e, --extras TEXT
  --version          Show the version and exit.
  --help             Show this message and exit.

For example, try to generate the project documentation with:

$ md2pdf README.md README.pdf

Optionally, you may load an external style:

$ md2pdf --css tests/assets/input.css README.md README.pdf

And/or activate markdown extras:

$ md2pdf --css pygments.css -e fenced-code-blocks README.md README.pdf

As a library

You can use md2pdf in your python code, like:

from md2pdf.core import md2pdf

md2pdf(pdf,
       md=None,
       raw=None,
       css=None,
       base_url=None,
       extras=[],
)

Function arguments:

  • pdf: output PDF file path
  • raw: input markdown raw string content
  • md: input markdown file path
  • css: input styles path (CSS)
  • base_url: absolute base path for markdown linked content (as images)
  • extras: markdown extras that should be activated

With Docker

Install Docker

Pull the image:

$ docker pull jmaupetit/md2pdf

Now run your image:

$ docker run --rm \
    -v $PWD:/app \
    -u "$(id -u):$(id -g)" \
    jmaupetit/md2pdf --css styles.css INPUT.MD OUTPUT.PDF

Contributing

Hacking

Clone this project first:

$ git clone [email protected]:jmaupetit/md2pdf.git

Install md2pdf along with its dependencies (using Poetry):

$ cd md2pdf
$ poetry install

Running the test suite

To run the test suite with your active python version (virtual environment):

$ poetry run pytest

Lint the code via:

$ poetry run ruff md2pdf

Release a new version

Upload a new release to PyPI:

$ poetry build
$ poetry publish

Ease your life

If you are familiar with GNU Make, we also automate daily tasks using this lovely tool:

$ make help

License

md2pdf is released under the MIT License. See the bundled LICENSE file for details.

md2pdf's People

Contributors

dependabot[bot] avatar gabrielbdornas avatar jmaupetit avatar krichprollsch avatar lunika avatar theeko74 avatar trots avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

md2pdf's Issues

ModuleNotFoundError: No module named '_ctypes' on Python 3.10.4

I installed via pip on my new machine (Fedora 36) but whenever I tried to run the command it did not work

Traceback (most recent call last):
  File "/home//.local/bin/md2pdf", line 15, in <module>
    from md2pdf import md2pdf, __version__
  File "/home//.local/lib/python3.8/site-packages/md2pdf/__init__.py", line 8, in <module>
    from md2pdf.core import md2pdf  # noqa
  File "/home//.local/lib/python3.8/site-packages/md2pdf/core.py", line 5, in <module>
    from weasyprint import HTML, CSS
  File "/home//.local/lib/python3.8/site-packages/weasyprint/__init__.py", line 315, in <module>
    from .css import preprocess_stylesheet  # noqa isort:skip
  File "/home//.local/lib/python3.8/site-packages/weasyprint/css/__init__.py", line 25, in <module>
    from . import computed_values, counters, media_queries
  File "/home//.local/lib/python3.8/site-packages/weasyprint/css/computed_values.py", line 9, in <module>
    from ..text.ffi import ffi, pango, units_to_double
  File "/home//.local/lib/python3.8/site-packages/weasyprint/text/ffi.py", line 398, in <module>
    gobject = _dlopen(
  File "/home//.local/lib/python3.8/site-packages/weasyprint/text/ffi.py", line 381, in _dlopen
    return ffi.dlopen(name)
  File "/home//.local/lib/python3.8/site-packages/cffi/api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "/home//.local/lib/python3.8/site-packages/cffi/api.py", line 832, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "/home//.local/lib/python3.8/site-packages/cffi/api.py", line 817, in _load_backend_lib
    import ctypes.util
  File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

I've tried running

sudo dnf install libffi-devel

but the error persists.

Pango/Cairo minimal versions

Debian Jessie packaged dependencies are too old for Weasyprint, see warning below:

/usr/local/lib/python3.6/site-packages/weasyprint/text.py:29: UserWarning: There are known rendering problems with Cairo <= 1.14.0
  warnings.warn('There are known rendering problems with Cairo <= 1.14.0')
/usr/local/lib/python3.6/site-packages/weasyprint/fonts.py:46: UserWarning: @font-face support needs Pango >= 1.38
  warnings.warn('@font-face support needs Pango >= 1.38')

We should install recent versions of these dependencies.

Enable HTML header and footer

I made a PR ( #34 ) to enable the addition of a html header and footer to all pages, taking most code from Weasyprint documentation.

I made the code work on my machine, did it for my own needs, but decided to share it in case it is helpful.

But now, there is a dependency error on the CI...
https://travis-ci.org/github/jmaupetit/md2pdf/jobs/706486615

I wanted to make a valid PR before asking for review, and I still didn't ask if that functionality is worthy or not, as I already wrote the code I preferred to share it directly. So :

Would you merge that PR? If yes, do you know what makes the CI fail (I don't know tox...)? Otherwise I can still try to fix it, but I'd prefer to do it after you tell me if you would accept the PR or keep your repo as simple as possible.

Dependencies not automatically installed.

When I try pip install md2pdf the requirements are not automatically installed for some reason.

This might be because the requirements file is not directly accessible to setup.py on machines other than yours. I think a quickfix would just be to add the list of requirements to setup.py.

can i use a local string instead of a file path?

i have a markdown formatted string in memory. How can convert it?

from md2pdf.core import md2pdf

md2pdf(pdf_file_path,
md_content=None,
md_file_path=None,
css_file_path=None,
base_url=None)

Are Markdown Tables supported?

Are Extended syntax tables supported? https://www.markdownguide.org/extended-syntax/#tables

Code

if __name__ == "__main__":
   table = """
| Syntax      | Description |
| ----------- | ----------- |
| Header      | Title       |
| Paragraph   | Text        |
"""

    output_path = Path("out.pdf")
    md2pdf(
        output_path,
        md_content=f"This is a **test**\n\n{table}",
        css_file_path=None,
        base_url=None
    )

Output

Expecting to see a table here:

Screen Shot 2021-01-20 at 12 56 29 PM

Version

Python 3.9.1

$ pip list
Package      Version
------------ -------
cairocffi    1.2.0
CairoSVG     2.5.1
cffi         1.14.4
cssselect2   0.4.1
defusedxml   0.6.0
docopt       0.6.2
html5lib     1.1
markdown2    2.3.10
md2pdf       0.4
Pillow       8.1.0
pip          20.3.3
prettytable  2.0.0
pycparser    2.20
Pyphen       0.10.0
setuptools   49.6.0
six          1.15.0
tinycss2     1.1.0
wcwidth      0.2.5
WeasyPrint   52.2
webencodings 0.5.1
wheel        0.35.1

Error when including an image from local storage

When I wanted to insert an image into the pdf, I ran into problems. I get the follwing error message:

Relative URI reference without a base URI: <a href="./images/Target-tracking-block-diagram.png"> at line None"

I have a markdownfile file.md in a folder, and in a subfolder called images I have the png.

I have run:

docker run -i -t -v $PWD:/srv jmaupetit/md2pdf file.md OUTPUT.PDF

CLI usage error: No module named md2pdf.__main__

I've trying to run md2pdf from CLI

python -m md2pdf README.md README.pdf

but getting this error

No module named md2pdf.__main__; 'md2pdf' is a package and cannot be directly executed

Could you help me, what I do wrong?

Question: Is there a CSS option to keep new lines in code snippets?

Hello. I am using m2pdf to create a PDF document from Markdown.

Original markdown document has a shell code snippet like:

$ operator-sdk run bundle --timeout 3m quay.io/sec-eng-special/tang-operator-bundle:v1.0.9
INFO[0008] Successfully created registry pod: quay-io-sec-eng-special-tang-operator-bundle-v1.0.9
...
INFO[0031] OLM has successfully installed "tang-operator.v1.0.9"

However, generated pdf does not keep newlines ... and the information is rendered like:
image

Is there any CSS option for PDF output to keep new lines in code snippets?

Thanks !

Error module morkdown2

Linux:

Error when i try to excute "$ python setup.py install" :
from markdown2 import markdown, markdown_path
ImportError: No module named markdown2

Resize images

I have a markdown file with an image embedded. The image is quite large.
The output file embeds the image at original size. This means the image is outside of the visible area.

It would be great if md2pdf would resize the image to fit into the print area

Installation of v0.6 fails on Ubuntu

I'm seeing a problem with the v0.6 package from pypi when I try to install it on Ubuntu.

Here is the output:

(.venv) ubuntu@nano:~/MD2PDF/Test$ pip install md2pdf
Collecting md2pdf
  Using cached md2pdf-0.6.tar.gz (6.2 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-tg3p4glh/md2pdf_53aa8b8666c04ce0abe6fcc93717a830/setup.py", line 7, in <module>
          import md2pdf
        File "/tmp/pip-install-tg3p4glh/md2pdf_53aa8b8666c04ce0abe6fcc93717a830/md2pdf/__init__.py", line 8, in <module>
          from md2pdf.core import md2pdf  # noqa
        File "/tmp/pip-install-tg3p4glh/md2pdf_53aa8b8666c04ce0abe6fcc93717a830/md2pdf/core.py", line 4, in <module>
          from markdown2 import markdown, markdown_path
      ModuleNotFoundError: No module named 'markdown2'
      [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.

Here is some info about the environment:

(.venv) ubuntu@nano:~/MD2PDF/Test$ grep VERSION  /etc/os-release 
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
(.venv) ubuntu@nano:~/MD2PDF/Test$ python --version
Python 3.10.6
(.venv) ubuntu@nano:~/MD2PDF/Test$ pip list
Package    Version
---------- -------
pip        22.0.2
setuptools 59.6.0

I see the same error after upgrading to pip 23.0.1 and setuptools 67.6.1, which are the latest available.

OSError: cannot load library 'pango-1.0-0'

Usage

I am using this repository as a package after installing with pip3 install md2pdf
I am importing the package as suggested in the Readme with from md2pdf.core import md2pdf

OS

I am running Windows Subsystem for Linux

Traceback

Traceback (most recent call last):                                                     
  File "<stdin>", line 1, in <module>                                                  
  File "/mnt/c/Users/augus/noteworthy/backend.py", line 7, in <module>                 
    from md2pdf.core import md2pdf                                                     
  File "/home/awth/.local/lib/python3.10/site-packages/md2pdf/__init__.py", line 7, in 
<module>                                                                               
    from .core import md2pdf  # noqa                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/md2pdf/core.py", line 5, in <module>                                                                                   
    from weasyprint import HTML, CSS                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/__init__.py", line 419, in <module>                                                                         
    from .css import preprocess_stylesheet  # noqa isort:skip                          
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/css/__init__.py", line 27, in <module>                                                                      
    from .computed_values import COMPUTER_FUNCTIONS                                    
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/css/computed_values.py", line 9, in <module>                                                                
    from ..text.ffi import ffi, pango, units_to_double                                 
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 431, in <module>                                                                         
    pango = _dlopen(                                                                   
  File "/home/awth/.local/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 417, in _dlopen                                                                          
    return ffi.dlopen(names[0])  # pragma: no cover                                    
  File "/home/awth/.local/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen                                                                                      
    lib, function_cache = _make_ffi_library(self, name, flags)                         
  File "/home/awth/.local/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library                                                                           
    backendlib = _load_backend_lib(backend, libname, flags)                            
  File "/home/awth/.local/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib                                                                           
    raise OSError(msg)                                                                 
OSError: cannot load library 'pango-1.0-0': pango-1.0-0: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'

Add custom style

Hi. For example, in document i have construction " [someText]{.someStyle} "

How to update .css file for print "someText" in red.

Text copied from generated PDF is reversed.

Original text from the markdown file:

This token must be used as the password portion of the HTTP basic authentication header.

Pasted text after copying it from the generated PDF:

.redaeh noitacitnehtua cisab PTTH eht fo noitrop drowssap eht sa desu eb tsum nekot sihT

md2pdf: 2.6.2
Platform: macOS 10.14.4
Python version: 2.7.15

Release new version to PYPI

Hello,
When I install the package through PYPI using PIP I don't get the newest version. I tried to release the newest code myself, but I don't have permission. Would it be possible to publish the newest version to PYPI please?
Thanks

Fix setup.py test

(env) ❯ python setup.py test
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'pytest'

line break and font problem

when converting multiline txt file wrapping to the next line doesn't work. How to try on:
A
B
C
on pdf file look like :ABC
and also for some reason in a сss file with the following text:
font-family: 'Liberation Sans';
the file is converted with a different font

This package cannot be safely installed by EasyInstall

$ pip install md2pdf
Collecting md2pdf
  Using cached https://files.pythonhosted.org/packages/a4/f4/94df8506f6164f0704eb71713f5db1f6017d987f9339d3a9a4f04ed47094/md2pdf-0.4-py2.py3-none-any.whl
Collecting WeasyPrint
  Using cached https://files.pythonhosted.org/packages/ca/1a/1925cf1e39e5526d9c686a31f798523e06ea45f20c958a429317a1110ee4/WeasyPrint-50-py3-none-any.whl
Collecting markdown2
  Using cached https://files.pythonhosted.org/packages/89/d2/6aef45472f7956646fdc4cc5284e6f9d00476497a8d167c30b0f78bb75a5/markdown2-2.3.8-py2.py3-none-any.whl
Collecting docopt
  Using cached https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz
Collecting Pyphen>=0.8
  Using cached https://files.pythonhosted.org/packages/15/82/08a3629dce8d1f3d91db843bb36d4d7db6b6269d5067259613a0d5c8a9db/Pyphen-0.9.5-py2.py3-none-any.whl
Collecting cssselect2>=0.1
  Using cached https://files.pythonhosted.org/packages/c4/a1/1a37602bbcfa2f7c079758f31555776a00a947e43457a3e0110b2165c7d9/cssselect2-0.2.2-py2.py3-none-any.whl
Collecting html5lib>=0.999999999
  Using cached https://files.pythonhosted.org/packages/a5/62/bbd2be0e7943ec8504b517e62bab011b4946e1258842bc159e5dfde15b96/html5lib-1.0.1-py2.py3-none-any.whl
Collecting CairoSVG>=2.4.0
  Using cached https://files.pythonhosted.org/packages/8e/3a/762f9272c20db092f4d537aaf364dd0770ecf8f7101b58c4e933e99ee2f6/CairoSVG-2.4.2-py3-none-any.whl
Collecting cairocffi>=0.9.0
  Using cached https://files.pythonhosted.org/packages/f7/99/b3a2c6393563ccbe081ffcceb359ec27a6227792c5169604c1bd8128031a/cairocffi-1.1.0.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\c.nienhaus\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\c.nienhaus\\AppData\\Local\\Temp\\pip-install-y_ia_0kh\\cairocffi\\setup.py'"'"'; __file__='"'"'C:\\Users\\c.nienhaus\\AppData\\Local\\Temp\\pip-install-y_ia_0kh\\cairocffi\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\c.nienhaus\AppData\Local\Temp\pip-install-y_ia_0kh\cairocffi\pip-egg-info'
         cwd: C:\Users\c.nienhaus\AppData\Local\Temp\pip-install-y_ia_0kh\cairocffi\
    Complete output (106 lines):
    Traceback (most recent call last):
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\C8BFB~1.NIE\AppData\Local\Temp\easy_install-fc1h5pfy\cffi-1.13.2\setup.py", line 127, in <module>
      File "C:\Users\C8BFB~1.NIE\AppData\Local\Temp\easy_install-fc1h5pfy\cffi-1.13.2\setup.py", line 105, in uses_msvc
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 127, in _compile
        src = self._gen_temp_sourcefile(body, headers, lang)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 109, in _gen_temp_sourcefile
        with open(filename, "w") as file:
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 418, in _open
        self._violation("open", path, mode, *args, **kw)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 407, in _violation
        raise SandboxViolation(operation, args, kw)
    setuptools.sandbox.SandboxViolation: SandboxViolation: open('_configtest.c', 'w') {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\c.nienhaus\AppData\Local\Temp\pip-install-y_ia_0kh\cairocffi\setup.py", line 10, in <module>
        setup(
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\C8BFB~1.NIE\AppData\Local\Temp\easy_install-fc1h5pfy\cffi-1.13.2\setup.py", line 127, in <module>
      File "C:\Users\C8BFB~1.NIE\AppData\Local\Temp\easy_install-fc1h5pfy\cffi-1.13.2\setup.py", line 105, in uses_msvc
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 127, in _compile
        src = self._gen_temp_sourcefile(body, headers, lang)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 109, in _gen_temp_sourcefile
        with open(filename, "w") as file:
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 418, in _open
        self._violation("open", path, mode, *args, **kw)
      File "c:\users\c.nienhaus\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 407, in _violation
        raise SandboxViolation(operation, args, kw)
    setuptools.sandbox.SandboxViolation: SandboxViolation: open('_configtest.c', 'w') {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Update doc

Documentation is not up-to-date regarding library usage.

Change fonts?

What is the expected way to change fonts?
I tried unsuccessfully to use @import and @font-face with a google fonts URL, and from a local ttf file. I'm not sure why the later two break but @import is css3 and makes sense.

Is this a limitation of whatever implements the rendering in python? Do you know how I should approach this?

@font-face {
  font-family: 'Roboto';
  src: url(Roboto-Light.ttf) format('truetype');
}

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.