public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: virtio-comment@lists.linux.dev
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Subject: [RFC PATCH v1 2/2] Embed virtio-queue.h as PDF attachment
Date: Sun, 15 Sep 2024 10:56:31 +0300	[thread overview]
Message-ID: <v1-proposal-attachfiles-2.manos.pitsidianakis@linaro.org> (raw)
In-Reply-To: <v1-proposal-attachfiles.manos.pitsidianakis@linaro.org>

Using the TeX package `attachfile2` we're able to attach the C header
file as a PDF standards-compliant attachment in the PDF document,
allowing it to be a single source of truth for related files.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 commands-html.tex |  7 +++++++
 commands-pdf.tex  | 10 ++++++++++
 headerfile.tex    |  2 ++
 virtio.tex        |  1 +
 4 files changed, 20 insertions(+)

diff --git a/commands-html.tex b/commands-html.tex
index 488eacb..144bbb2 100644
--- a/commands-html.tex
+++ b/commands-html.tex
@@ -180,3 +180,10 @@
 \vspace{0.2in}
 }
 
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% VIRTIO C header file (.h) PDF attachments - expand to nothing
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\attachsource}[1]{%
+}%
diff --git a/commands-pdf.tex b/commands-pdf.tex
index 23289d8..62d4169 100644
--- a/commands-pdf.tex
+++ b/commands-pdf.tex
@@ -196,3 +196,13 @@
 \vspace{0.2in}
 }
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% VIRTIO C header file (.h) PDF attachments
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\attachsource}[1]{%
+{%
+This file is available as a PDF attachment %
+\attachfile[icon=Paperclip,mimetype=text/x-c,author=\virtioauthor{}]{#1}%
+}%
+}%
diff --git a/headerfile.tex b/headerfile.tex
index 767005c..d194031 100644
--- a/headerfile.tex
+++ b/headerfile.tex
@@ -1,5 +1,7 @@
 \chapter[virtio_queue.h]{virtio_queue.h}\label{sec:virtio-queue.h}
 \label{sec:virtio-ring.h}
+\attachsource{virtio-queue.h}
+
 This file is also available at the link
 \virtiourlh.
 All definitions in this section are for non-normative reference
diff --git a/virtio.tex b/virtio.tex
index 37e49b1..94f508f 100644
--- a/virtio.tex
+++ b/virtio.tex
@@ -38,6 +38,7 @@
 \usepackage{underscore}
 \usepackage{xstring}
 \usepackage{enumitem}
+\usepackage{attachfile2}
 \IfFileExists{ellipsis.sty}{\usepackage{ellipsis}}{
 \message{!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
 \message{LaTeX Warning: Missing ellipsis.sty: dots (...) will look ugly}
-- 
γαῖα πυρί μιχθήτω


  parent reply	other threads:[~2024-09-15  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-15  7:56 [RFC PATCH v1 0/2] Embed files as PDF attachments Manos Pitsidianakis
2024-09-15  7:56 ` [RFC PATCH v1 1/2] specvars.tex: Add \virtioauthor command Manos Pitsidianakis
2024-09-15  7:56 ` Manos Pitsidianakis [this message]
2024-09-15 11:11 ` [RFC PATCH v1 0/2] Embed files as PDF attachments Michael S. Tsirkin
2024-09-15 11:31   ` Manos Pitsidianakis
2024-09-15 11:56     ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v1-proposal-attachfiles-2.manos.pitsidianakis@linaro.org \
    --to=manos.pitsidianakis@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=virtio-comment@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox