mirror of https://github.com/Nonannet/pyladoc.git
Compare commits
No commits in common. "39142a1e224c83e2353e1b173d83e3e06f16a469" and "98d40a21f6a884c28c27521c53ec00e081a8c43b" have entirely different histories.
39142a1e22
...
98d40a21f6
|
@ -1,48 +0,0 @@
|
|||
name: CI Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", 3.11, 3.12, 3.13]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install LaTeX
|
||||
run: sudo apt-get install -y texlive-latex-extra texlive-fonts-extra lmodern texlive-xetex texlive-science
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e .[dev]
|
||||
|
||||
- name: Lint code with flake8
|
||||
run: flake8
|
||||
|
||||
- name: Type checking with mypy
|
||||
run: mypy
|
||||
|
||||
- name: Run tests with pytest
|
||||
run: pytest
|
||||
|
||||
- name: Upload rendered files
|
||||
uses: actions/upload-artifact@v4
|
||||
if: strategy.job-index == 0
|
||||
with:
|
||||
name: rendering-results
|
||||
path: tests/out/test_*_render*
|
11
README.md
11
README.md
|
@ -11,7 +11,7 @@ This package focuses on the "Document in Code" approach for cases
|
|||
where a lot of calculations and data handling is done but not a lot of
|
||||
document text needs to be displayed. The multiline string capability of Python
|
||||
handles this very well. In comparison to "Code in Document"-templates
|
||||
python tools supports this approach out of the box - similar doch docstrings.
|
||||
python tools supports this approach out of the box.
|
||||
|
||||
As backend for PDF generation LaTeX is used. There are excellent engines for
|
||||
rendering HTML to PDF, but even if there is no requirement for an
|
||||
|
@ -21,7 +21,7 @@ is a hard problem where LaTeX is superior.
|
|||
|
||||
## Example outputs
|
||||
|
||||
[](https://raw.githubusercontent.com/Nonannet/pyladoc/refs/heads/main/tests/out/test_latex_render1.pdf)
|
||||

|
||||
|
||||
- HTML: [test_html_render1.html](https://html-preview.github.io/?url=https://github.com/Nonannet/pyladoc/blob/main/tests/out/test_html_render1.html) ([code](https://github.com/Nonannet/pyladoc/blob/main/tests/out/test_html_render1.html))
|
||||
- PDF: [test_latex_render1.pdf](https://raw.githubusercontent.com/Nonannet/pyladoc/refs/heads/main/tests/out/test_latex_render1.pdf) ([code](https://github.com/Nonannet/pyladoc/blob/main/tests/out/test_html_render1.tex))
|
||||
|
@ -62,13 +62,6 @@ Optional dependencies are:
|
|||
- LaTeX for exporting to PDF or exporting Matplotlib figures to LaTeX (PGF/TikZ rendering)
|
||||
- Pandas and Matplotlib for including Pandas Tables and Matplotlib figures (obviously)
|
||||
|
||||
For the included template the following LaTeX setup works on Ubuntu:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y texlive-latex-extra texlive-fonts-extra lmodern texlive-xetex texlive-science
|
||||
```
|
||||
|
||||
## Usage
|
||||
It is easy to use as the following example code shows:
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
[project]
|
||||
name = "pyladoc"
|
||||
version = "1.2.0"
|
||||
version = "1.1.0"
|
||||
authors = [
|
||||
{ name="Nicolas Kruse", email="nicolas.kruse@nonan.net" },
|
||||
]
|
||||
description = "Package for generating HTML and PDF/latex from python code"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
license = "MIT"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
dependencies = [
|
||||
|
@ -19,7 +19,7 @@ dependencies = [
|
|||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest", "flake8", "mypy",
|
||||
"lxml", "types-lxml", "types-Markdown", "pandas-stubs",
|
||||
"lxml", "types-lxml",
|
||||
"requests",
|
||||
"matplotlib>=3.1.1",
|
||||
"pandas>=2.0.0", "Jinja2",
|
||||
|
|
Loading…
Reference in New Issue