unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Compile skribilo doc containing guix channel references
@ 2022-10-30 20:46 Phil
  2022-10-31 21:56 ` Phil
  2022-11-02 11:36 ` Ludovic Courtès
  0 siblings, 2 replies; 15+ messages in thread
From: Phil @ 2022-10-30 20:46 UTC (permalink / raw)
  To: guix-devel

Hi all,

I'd like to document a private guix channel using Guile-based document
framework: Skribilo - https://www.nongnu.org/skribilo/.

The idea is that the guix channel repo will contain a skb file which can
then reference code in the channel by setting the source-path and then
using the :definition in the source function to reference bits of the
package I want to talk about in my document.

(source :language [:tab 8] [:definition] [:stop] [:start] [:file])

This works really well, but it got me thinking - what would be even
cooler would be if I could import modules in my channel and actually
execute channel functions to generate document output as part of the
document compilation process, rather than just display the package code!

The problem with this is that in order to import modules in my channel,
I'd also have to have the guix core modules on my load-path at skribilo
compilation time, otherwise skribilo complains when my channel makes use
of guix modules.

For example, if I just add the channel packages without guix core
modules at the top of my skribilo document:
(add-to-load-path (string-append (dirname (current-filename)) "/packages"))

I understandably get something like the below:
no code for module (guix git)

Normally when scripting for guix you'd avoid the above problem by using
'guix repl -- some-script.scm' but here I'm using the skribilo
executable, *not* guix as the entry point - it's not entirely clear to me
how to get the required guix modules onto my load path?

As an ill-advised hack I tried the following under guix repl:
(use-modules (gnu packages))
(%package-module-path)

Then I added the returned paths via add-to-load-path at the top of my skb
file.  This resulted in:
$ GUILE_AUTO_COMPILE=0 guix environment --ad-hoc skribilo -- skribilo
--target=html --source-path=.. guix-packages.skb -o index.html
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
/gnu/store/8bab6fga7858whgd11f0wlsi2zsp4yr2-guix-module-union/share/guile/site/3.0/guix/packages.scm:361:5:
Unknown #object: "#~"

My guess is there is a better approach - any suggestions?  Perhaps I can
call the skribilo compiler from inside "guix repl" for example?

Cheers,
Phil.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-17 14:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-30 20:46 Compile skribilo doc containing guix channel references Phil
2022-10-31 21:56 ` Phil
2022-11-02 11:36 ` Ludovic Courtès
2022-11-04 22:13   ` Phil
2022-11-05 16:40     ` Phil
2022-11-05 18:03       ` Ludovic Courtès
2022-11-06 18:50         ` zimoun
2022-11-06 22:12           ` Phil
2022-11-07  8:37             ` zimoun
2022-11-07  9:21           ` Ludovic Courtès
2022-11-07  9:47             ` zimoun
2022-11-10 11:58               ` Ludovic Courtès
2022-11-10 12:39                 ` zimoun
2022-11-17 14:54                   ` Ludovic Courtès
2022-11-05 17:58     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).