rdmorganiser / rdmorganiser/rdmo

In views, define style / formatting so that it is propagated by Pandoc

Open
#569 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug type:feature-request
Dominant language
Python
Stars
133
Forks
60
Avg merge
3d 14h
Merged PRs (30d)
21

Description

Description / Beschreibung

Most funders require a DMP in PDF or DOCX format, which adheres faithfully to their own template (including text colour, titles, tables etc.)

In HTML, text formatting may be defined either on the place (e.g. <p style="">) or by referring to a CSS block, either at the beginning of the file (preferably within <head>) or in an external file.

RDMO tolerates a command <style type="text/css"> within the document body and correctly renders it within the HTML document. Yet the whole formatting is lost when exporting the document to another format.

A workaround is to use a reference-doc but that is not practical during development, as it requires to update the reference-doc often, which requires system-admin privileges on the test instance. Moreover, that would require two source files instead of one for each view.

Expected behaviour / Erwartetes Verhalten

There should be a way to add a CSS script at the beginning of the HTML-Django source file, to define formatting centrally for the whole document.

Alternatively/Complementarily, a way to make visible the Pandoc options regulating the conversion from HTML to other formats (-t, -css).

Steps to reproduce / Schritte zum Reproduzieren
  1. Go to RDMOcat and open a sample view of a sample project: it is well formatted.
  2. Export it as a DOCX or PDF.
  3. Open the exported file.
  4. The formatting is lost!
References / Verweise

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Django view templates and the Pandoc export path for HTML-to-PDF and DOCX conversion; the issue names no specific files. Check how inline or centralized style blocks and Pandoc options are currently handled, then verify that one view preserves its formatting in both export formats without a separate reference document.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, django, html, python
Domain
backend, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.