all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Antero Mejr <antero@mailbox.org>, 56576@debbugs.gnu.org
Cc: iyzsong@envs.net
Subject: [bug#56576] [PATCH 1/2] gnu: Add stddoc.
Date: Sun, 7 Aug 2022 14:10:59 +0200	[thread overview]
Message-ID: <3d908ca5-78a5-fc92-5d8a-5e16aee1eda5@telenet.be> (raw)
In-Reply-To: <20220806225743.422102-1-antero@mailbox.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2364 bytes --]


On 07-08-2022 00:57, Antero Mejr via Guix-patches via wrote:
> +                              (invoke "gcc" "-O2" "-g" "-o" "stddoc" "stddoc.c")

For cross-compilation, you need to use #$(cc-for-target) instead of 
"gcc", otherwise it will be compiled for the wrong architecture.

> +                              (with-input-from-file "stddoc.c"
> +                                (lambda _
> +                                  (with-output-to-file "stddoc.c.html"
> +                                    (lambda _
> +                                      (invoke "./stddoc")))))))
Except when emulation is used, cross-compiled binaries cannot be run. 
However, you can add 'this-package' to native-inputs (conditional on 
cross-compilation, otherwise you get a loop) and run that stddoc:

(native-inputs (if (%current-target-system) (list this-package) '()))

[...]

(invoke #$(if (%current-target-system) "stddoc" "./stddoc"))

(untested!).

It includes Javascript and CSS from external sources:

> static void stddoc( FILE *in, FILE *out ) {
>     fprintf(out, "%s\n", "<meta charset='utf-8' emacsmode='-*- 
> markdown -*-'>");
>     fprintf(out, "%s\n", "<link rel='stylesheet' 
> href='https://casual-effects.com/m""arkdeep/latest/apidoc.css?'>");
>
I don't think this is good, privacy-wise, could you substitute them with 
a local copy?

Also, on 
<https://github.com/r-lyeh/stddoc.c/blob/6eef9deaf2e36bae812f50e448a8012b3e5efb14/stddoc.c#L111>, 
it looks like it forgets to quote things like &. I don't know if that's 
important in this particular case but often forgetting to quote things 
can be pretty bad.

(Ignoring the return value of printf also isn't ideal, but less important)

> +      (description "@code{stddoc.c} is a tiny documentation generator for 60
> +programming languages.  Markdeep code comments are extracted from stdin and
> +printed into stdout as a HTML file.")
This seems misleading to me, the Markdown->HTML happens at runtime, via 
the Javascript. Also, instead of mentioning the number 60, you could 
refer to the Javascript package; that way, the user can check if their 
language is in the list. I also don't think that the generator 
'https://morgan3d.github.io/markdeep/latest/markdeep.js' counts as tiny.

stdout -> output, stdin -> input

Greetings,
Maxime


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  parent reply	other threads:[~2022-08-07 12:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 14:57 [bug#56576] [PATCH] gnu: Add nuklear Antero Mejr via Guix-patches via
2022-08-05  3:03 ` 宋文武 via Guix-patches via
2022-08-06 22:57 ` [bug#56576] [PATCH 1/2] gnu: Add stddoc Antero Mejr via Guix-patches via
2022-08-06 22:57   ` [bug#56576] [PATCH 2/2] gnu: Add nuklear Antero Mejr via Guix-patches via
2022-08-07 12:10   ` Maxime Devos [this message]
2024-04-03 22:46 ` [bug#56576] [PATCH v3 1/3] gnu: Add markdeep Christina O'Donnell
2024-04-03 22:46   ` [bug#56576] [PATCH v3 2/3] gnu: Add stddoc Christina O'Donnell
2024-04-03 22:46   ` [bug#56576] [PATCH v3 3/3] gnu: Add nuklear Christina O'Donnell
2024-04-11 10:37   ` bug#56576: [PATCH v3 1/3] gnu: Add markdeep Ludovic Courtès

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=3d908ca5-78a5-fc92-5d8a-5e16aee1eda5@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=56576@debbugs.gnu.org \
    --cc=antero@mailbox.org \
    --cc=iyzsong@envs.net \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.