mirror of https://github.com/Nonannet/pyladoc.git
Compare commits
5 Commits
98d40a21f6
...
39142a1e22
Author | SHA1 | Date |
---|---|---|
|
39142a1e22 | |
|
2bb4e55dd0 | |
|
d9fbe49bcf | |
|
bda9d046ee | |
|
807cb96638 |
|
@ -0,0 +1,48 @@
|
||||||
|
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
|
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
|
document text needs to be displayed. The multiline string capability of Python
|
||||||
handles this very well. In comparison to "Code in Document"-templates
|
handles this very well. In comparison to "Code in Document"-templates
|
||||||
python tools supports this approach out of the box.
|
python tools supports this approach out of the box - similar doch docstrings.
|
||||||
|
|
||||||
As backend for PDF generation LaTeX is used. There are excellent engines for
|
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
|
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
|
## 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))
|
- 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))
|
- 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,6 +62,13 @@ Optional dependencies are:
|
||||||
- LaTeX for exporting to PDF or exporting Matplotlib figures to LaTeX (PGF/TikZ rendering)
|
- 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)
|
- 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
|
## Usage
|
||||||
It is easy to use as the following example code shows:
|
It is easy to use as the following example code shows:
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
[project]
|
[project]
|
||||||
name = "pyladoc"
|
name = "pyladoc"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Nicolas Kruse", email="nicolas.kruse@nonan.net" },
|
{ name="Nicolas Kruse", email="nicolas.kruse@nonan.net" },
|
||||||
]
|
]
|
||||||
description = "Package for generating HTML and PDF/latex from python code"
|
description = "Package for generating HTML and PDF/latex from python code"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
|
license = "MIT"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
@ -19,7 +19,7 @@ dependencies = [
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
"pytest", "flake8", "mypy",
|
"pytest", "flake8", "mypy",
|
||||||
"lxml", "types-lxml",
|
"lxml", "types-lxml", "types-Markdown", "pandas-stubs",
|
||||||
"requests",
|
"requests",
|
||||||
"matplotlib>=3.1.1",
|
"matplotlib>=3.1.1",
|
||||||
"pandas>=2.0.0", "Jinja2",
|
"pandas>=2.0.0", "Jinja2",
|
||||||
|
|
Loading…
Reference in New Issue