mirror of https://github.com/Nonannet/pyladoc.git
Readme updated (- conda added for installing)
This commit is contained in:
parent
6120a38241
commit
5f6147c2b9
47
README.md
47
README.md
|
@ -1,22 +1,22 @@
|
||||||
# Pyladoc
|
# Pyladoc
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
Pyladoc is a python package for programmatically generating HTML and
|
Pyladoc is a Python package for programmatically generating HTML and
|
||||||
PDF/LaTeX output. This package targets specifically applications where reports
|
PDF/LaTeX output. This package specifically targets applications where reports
|
||||||
or results with Pandas-tables and Matplotlib-figures are generated
|
or results with Pandas tables and Matplotlib figures are generated
|
||||||
to be displayed as website and as PDF document without involving any manual
|
to be displayed as a website and as a PDF document without involving any manual
|
||||||
formatting steps.
|
formatting steps.
|
||||||
|
|
||||||
This package focuses on the "Document in Code" approach for cases
|
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 - similar doch docstrings.
|
Python tools support this approach out of the box—similar to docstrings.
|
||||||
|
|
||||||
As backend for PDF generation LaTeX is used. There are excellent engines for
|
LaTeX is used as the backend for PDF generation. 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
|
||||||
accurate typesetting and what not, placing programmatically content of variable
|
accurate typesetting, placing programmatically generated content of variable
|
||||||
composition and element sizes on fixed size pages without manual intervention
|
composition and element sizes on fixed-size pages without manual intervention
|
||||||
is a hard problem where LaTeX is superior.
|
is a hard problem where LaTeX is superior.
|
||||||
|
|
||||||
## Example outputs
|
## Example outputs
|
||||||
|
@ -34,17 +34,17 @@ The documents are generated by the script [tests/test_rendering_example1_doc.py]
|
||||||
- Tables (Pandas, Markdown or HTML)
|
- Tables (Pandas, Markdown or HTML)
|
||||||
- Matplotlib figures
|
- Matplotlib figures
|
||||||
- LaTeX equations (block or inline)
|
- LaTeX equations (block or inline)
|
||||||
- Named references for figures, tables and equations
|
- Named references for figures, tables, and equations
|
||||||
|
|
||||||
### Key Features
|
### Key Features
|
||||||
- HTML and PDF/LaTeX rendering of the same document
|
- HTML and PDF/LaTeX rendering of the same document
|
||||||
- Single file output including figures
|
- Single file output including figures
|
||||||
- Figure and equation embedding in HTML by inline SVG, SVG in Base64 or PNG in Base64
|
- Figure and equation embedding in HTML by inline SVG, SVG in Base64, or PNG in Base64
|
||||||
- Figure embedding in LaTeX as PGF/TikZ
|
- Figure embedding in LaTeX as PGF/TikZ
|
||||||
- Tested on Linux and Windows
|
- Tested on Linux and Windows
|
||||||
|
|
||||||
### Usage Scenarios
|
### Usage Scenarios
|
||||||
- Webservices
|
- Web services
|
||||||
- Report generation for lab equipment
|
- Report generation for lab equipment
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -54,16 +54,21 @@ It can be installed with pip:
|
||||||
pip install pyladoc
|
pip install pyladoc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
As well as with conda:
|
||||||
|
```bash
|
||||||
|
conda install conda-forge::pyladoc
|
||||||
|
```
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
Pyladoc depends on the markdown package.
|
Pyladoc depends on the markdown package.
|
||||||
|
|
||||||
Optional dependencies are:
|
Optional dependencies are:
|
||||||
- Matplotlib python package for rendering LaTeX equations for HTML output
|
- Matplotlib Python package for rendering LaTeX equations for HTML output
|
||||||
- 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 Jinja2 for rendering pandas tables
|
- Pandas and Jinja2 for rendering Pandas tables
|
||||||
- Matplotlib for rendering matplotlib figures (obviously)
|
- Matplotlib for rendering Matplotlib figures (obviously)
|
||||||
|
|
||||||
For the included template the `miktex`-LaTeX distribution works on Windows
|
For the included template, the `miktex` LaTeX distribution works on Windows
|
||||||
and the following LaTeX setup works on Ubuntu (both tested in CI):
|
and the following LaTeX setup works on Ubuntu (both tested in CI):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -72,7 +77,7 @@ sudo apt-get install -y texlive-latex-extra texlive-fonts-recommended lmodern te
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
It is easy to use as the following example code shows:
|
It is easy to use, as the following example code shows:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import pyladoc
|
import pyladoc
|
||||||
|
@ -108,7 +113,7 @@ doc.to_pdf('test.pdf')
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Contributions are welcome, please open an issue or submit a pull request on GitHub.
|
Contributions are welcome; please open an issue or submit a pull request on GitHub.
|
||||||
|
|
||||||
## Developer Guide
|
## Developer Guide
|
||||||
To get started with developing the `pyladoc` package, follow these steps.
|
To get started with developing the `pyladoc` package, follow these steps.
|
||||||
|
@ -120,14 +125,14 @@ git clone https://github.com/Nonannet/pyladoc.git
|
||||||
cd pyladoc
|
cd pyladoc
|
||||||
```
|
```
|
||||||
|
|
||||||
It's recommended to setup an venv:
|
It's recommended to set up a venv:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m venv .venv
|
python -m venv .venv
|
||||||
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
|
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the package and dev-dependencies while keeping files in the
|
Install the package and development dependencies while keeping files in the
|
||||||
current directory:
|
current directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Loading…
Reference in New Issue