Add a "PDF" export button beside the download icon for Markdown content #3136
Zak Siddiqui opened 8 hours ago

Summary

When a user views Markdown content in OneDev, the only way to take it elsewhere is the download icon, which yields the raw .md file. Raw Markdown is fine for developers but is awkward for business and other non-technical readers. Add a second icon — labelled PDF — beside the existing download button that renders the Markdown to a PDF in one click, using the same rendering OneDev already performs on screen.

Problem

Markdown is a developer-friendly format, not a business-friendly one. A product owner, analyst, or executive who is handed a .md file sees syntax markers (#, **, |-tables, fenced code) rather than a finished document, and most office tooling cannot open it cleanly.

Today the workaround is a manual, multi-step process:

  1. Download the file.
  2. Find a third-party "Markdown to PDF" website.
  3. Copy/paste or upload the content.
  4. Download the result, then share it.

Every one of those steps is friction, and step 2 is worse than friction — it means handing potentially confidential internal documentation to an unknown external service.

Motivation

  • Bridge the developer ↔ business gap. Sharing a polished PDF lets engineers communicate specifications, design notes, and runbooks with stakeholders who don't live in a code editor — no translation effort required on either side.
  • Keep confidential content inside OneDev. Server-side conversion removes any reason to paste internal docs into a public converter site. For teams handling anything sensitive, this alone justifies the feature.
  • Remove steps, not just clicks. From "view the doc" directly to "share a document" in one action.
  • Consistency and professionalism. Output should look like the document the author intended (headings, tables, code blocks, links) and ideally reflect the org's rendering style, so shared documents look deliberate rather than like a raw text dump.
  • Low incremental cost. OneDev already renders this content server-side; the feature is mostly a matter of exposing that rendering as a PDF download.

Proposed solution

Add a PDF icon immediately adjacent to the existing download icon, shown whenever the content being viewed is rendered as rich Markdown. Clicking it generates a PDF of the rendered content server-side and downloads it.

  • Availability (per Q1 = C): anywhere OneDev renders Markdown as rich HTML — the Files page viewer, issue and pull-request descriptions and comments, wiki pages, and README rendering.
  • Rendering (per Q2/Q3): reuse OneDev's existing Markdown rendering so the PDF matches the on-screen result.
  • Generation (per Q5): generate on demand per request; no stored artifacts to manage or invalidate.
  • Access (per Q6): honor existing project and file permissions; a user can only export what they can already view.

User experience

  • Icon sits directly next to the download button; tooltip reads "Export as PDF".
  • While generating, the icon shows a busy/disabled state.
  • On success, the browser downloads <name>.pdf.
  • On failure, a clear inline error is shown rather than a silent no-op.
  • The feature is discoverable without documentation — the "PDF" label makes its purpose obvious at a glance.

Acceptance criteria

  •  A PDF-labelled icon appears next to the download icon for Markdown-rendered content.
  •  Clicking it downloads a PDF of the full rendered content (headings, lists, tables, code blocks, links preserved).
  •  Available in the Files markdown viewer and other rich-Markdown surfaces (issues, PRs, wiki, README), per the agreed scope.
  •  Conversion happens server-side; no content is sent to any external service.
  •  Access is restricted to users who can already view the content.
  •  Reasonable behaviour for very large documents and for content containing links/images (define expected handling).
  •  Busy state and error state are handled gracefully.

Out of scope

  • PDF export for binary or non-Markdown files.
  • Editing or annotating the PDF.
  • Converting to Markdown from other formats.

Other

  • Faithfully it must reproduce on-screen styling.
  • Embed images and Use fully qualified links.
  • Include document metadata (Filename/commit date/commit hash).
  • Service Desk commented 8 hours ago

    Thanks for the detailed proposal. OneDev does parse Markdown into HTML on the server, but the final on-screen result is not a self-contained server-rendered document: its appearance comes from browser CSS, and some content is completed dynamically in the browser. Producing a faithful PDF server-side would therefore require adding and operating a browser/PDF rendering engine, including resource loading, authentication, pagination, font handling, and limits for large documents. This is considerably more than exposing the existing Markdown renderer.

    For the stated use case, please use the browser’s Print → Save as PDF function on the rendered page. It uses the already-rendered content, keeps confidential data within OneDev and the user’s browser, and does not involve a third-party conversion service. We do not currently plan to add a separate server-side PDF export action. If browser printing fails for a particular Markdown construct or OneDev page, please provide that concrete example so we can investigate the rendering/print styling issue.

1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-3136
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover