在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mypebble/rest-framework-latex开源软件地址(OpenSource Url):https://github.com/mypebble/rest-framework-latex开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):REST Framework LaTeX PluginA simple plug-n-play LaTeX renderer for Django REST Framework. InstallingREST Framework LaTeX can be downloaded from PyPI: pip install rest-framework-latex DependenciesCurrently the LaTeX plugin requires sudo aptitude install texlive-latex-extra texlive-xetex This will probably take some time due to the size of LaTeX (around 1GB) Using the RendererYou can then configure the renderer in your settings or on each view: REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework_latex.renderers.LatexRenderer',
]
}
|
Tag | Tag/Filter | Purpose |
---|---|---|
latex_safe |
Filter | Escape all user-entered content for LaTeX rules |
latex_resources |
Tag | Print the value of settings.LATEX_RESOURCES |
The renderer works by creating a new temporary directory, and then copying
over the LATEX_RESOURCES
directory into the new temporary directory.
Next it renders the TeX file into the temporary directory.
Then it runs lualatex over the TeX file, and this will produce the PDF file we read into memory.
Then we delete the temporary directory and return the PDF to the client.
The REST Framework LaTeX plugin is compatible with Django 1.11 and up and Django REST Framework 3.3 and up.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论