Skip to main content

Utilities for generating technical reports.

Project description

icreports

icreports is a configuration management tool (à la CMake) for generating e-books and technical documents. It is used at the Irish Centre for High End Computing (ICHEC) to build the ICHEC handbook.

Features

The project is based on the Jupyter Book toolchain and formats, providing a wrapper that allows building multiple configurations of a book based on tags in document frontmatter, allowing the concept of 'public', 'private' or 'draft' versions.

In particular, it allows:

  • Rendering of different book versions (e.g. public, private, draft) based on document frontmatter tags
  • Automatic conversion of image formats (including TIKZ) to best suit the output format (web, PDF etc).
  • Named build configurations specified in YAML, allowing rendering of multiple versions in the same build job.
  • Book version numbering

Why is this useful?

At ICHEC (at least) we want a handbook that is as easy as possible to contribute to. But the people who maintain the handbook don't have easy access to the centre's hosting infrastructure - so it isn't easy to 'self-host' web services that we need. Ideally we live in a DevOps world where this is possible - but we aren't there yet. This library sidesteps this by relying on public infrastructure like ReadTheDocs to do the document build and hosting. However, we want 'internal' info in the handbook too. The convoluted steps needed to maintain public and internal handbook versions while also building on piecemeal public infrastructures motivated this tool. Maybe you are in a similar situation and it can be helpful for you too.

Usage

Assuming a repository has been set up for a standard Jupyter Book build, to use icreports you can add some build configurations to the existing _config.yml under an icreports key, for example:

title: Mock Book
author: Mock Book Author
exclude_patterns: [/src/media, infra/, infra/README.md, _build, .venv]
only_build_toc_files: true
sphinx:
  config:
    myst_heading_anchors: 3
latex:
  latex_documents:
     targetname: book.tex
icreports:
  project_name: mock_book
  version: 0.0.0
  builds:
    - name: "internal"
      outputs:
        - "pdf"
        - "html"
        - "src"
    - name: "public"
      outputs:
        - "pdf"
        - "html"
        - "src"
      include_tags:
        - "public"

here the book is given a version and two builds 'internal' and 'public' are specified. The public build will only include documents that have the tag 'public' in their frontmatter, through the use of the 'include_tags' attribute. All supported output formats 'pdf', 'html' and 'src' (just copy all sources) are requested in this case. This will lead to four invocations of Jupyter Book (and two custom copy operations for 'src').

To do the builds run:

icreports book --source_dir $SOURCE_DIR 

where SOURCE_DIR is the location of the book sources.

Installation

The project is available on PyPi, you can install it with:

pip install icreports

Some features rely on converting images between various formats. For full image format support imagemagick, cairo and a full LaTeX environment are required. On Mac you can install the former with brew, with MacTeX used to install the LaTeX environment.

Using a container

If you prefer not to set up the dependencies or are having issues with them you can use a container to do the build. Assuming you have podman or docker installed you can do:

cd infra
podman build --platform linux/arm64 -t icreports .
podman run -it -v $SOURCE_DIR:/src -v $BUILD_DIR/:/build -p 8000:8000 --platform linux/arm64 icreports

The SOURCE_DIR is the path to the book sources on the host. The BUILD_DIR is somewhere you want build output to go on the host. --platform can be omitted on x86_64 systems.

Build output will also be served at localhost:8000, which you can open in a web browser.

Contact

For further information you can contact james.grogan@ichec.ie. Due to our current Gitlab hosting setup we can't easily accept contributions or defect reports via that platform. We may in future set up a mirror if of interest - please get in touch by email with any defect reports or other feedback in the meantime.

Copyright

Copyright 2024 Irish Centre for High End Computing

The software in this repository can be used under the conditions of the GPLv3+ license, which is available for reading in the accompanying LICENSE file.

If you are an ICHEC collaborator or National Service user and hope to use this library under different terms please get in touch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icreports-0.0.10.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icreports-0.0.10-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file icreports-0.0.10.tar.gz.

File metadata

  • Download URL: icreports-0.0.10.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for icreports-0.0.10.tar.gz
Algorithm Hash digest
SHA256 912c5b7b24e154a4e0808dea181ee2bde071f1dbd42d02eda81eb1ad18e01bf0
MD5 31a824f95b4d65c53d2cbaaa3e29916b
BLAKE2b-256 c3113785b8139c4fb62a3d391e1cdbb89d10fb9607c5d06c85f022d5e5ddc370

See more details on using hashes here.

File details

Details for the file icreports-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: icreports-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for icreports-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5dbfac7f952863452dc369c32a96439f953a04600db346fc11fda6088d1fceb7
MD5 a3df422f0a9df902c03abdc35d946ce6
BLAKE2b-256 60085a60cac3285f91189ae1380c48ff107e0a59896edc6fa5fa44342e0259db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page