From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qKeVAcBEYGNqGwAAbAwnHQ (envelope-from ) for ; Mon, 31 Oct 2022 22:57:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GJqwAcBEYGPu+QAA9RJhRA (envelope-from ) for ; Mon, 31 Oct 2022 22:57:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A7660311C5 for ; Mon, 31 Oct 2022 22:57:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opclz-0000KA-Bb; Mon, 31 Oct 2022 17:56:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opclv-0000HW-75 for guix-devel@gnu.org; Mon, 31 Oct 2022 17:56:44 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opcls-0007W5-G1 for guix-devel@gnu.org; Mon, 31 Oct 2022 17:56:42 -0400 Received: by mail-wr1-x42d.google.com with SMTP id y16so17824292wrt.12 for ; Mon, 31 Oct 2022 14:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beadling-co-uk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:date:message-id:in-reply-to :subject:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=jWND7K54vwee6gSXgcOj0g6o11w4WW7oILsjjnBilOE=; b=lyx7Qw+DQ4vlW+Lv2m4o5yi/STgCITaiVGOKuT/u/2B+IMPDCMnnClqwIL5GGnIYia r0lZxQDoDSiIe2O1kgby6CTFhmuNf2OcC1gtucUuWEUjipf/GE+ZRNBjjAV4VH4NnBET XVjE3dXkId1Gw1SLLb0v19BEBph278HUvOBMe+7pdu4E7z0AiEqRNS7CQt22cgnd+tWg u8EBQuQmAyJN3tXAsCMtqJv6Tb4xRL1s/kmYoDi3ckhU3U0HF2QJSNEUqrlZE4QqNqFc nGApV8hjDmnXVproojlwdpiZytq8PKbnMlju4ntp+BwBNTxRUbqFfd5SXSbkS/P/J93D Rp1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:date:message-id:in-reply-to :subject:to:from:user-agent:references:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jWND7K54vwee6gSXgcOj0g6o11w4WW7oILsjjnBilOE=; b=kEoC8RvvYLcRx5a2aqBWLqKdwEiuzGg99k620wWNmsHLor6effT8AVJlivwBYIVKSh HoKx7FEhoQEBdR3VDXd9iG1MNk7TW1udJuGRVjYsju3+jZJKIrhnUaCKr4wIHbO0IKnw 9BFoOLbv3GxtFFg6IOvY5q5DypoOLrBIQmcOTbGSeeHRtoodZ0QiTjGtLz3U41XbyPDO SbKjTV8pp7J6vJ4qsaVD7JK9BKAtoOfM7qMum/xn4wfgEpAn1aLpFVrWbtWQ+AwsROX/ iKFDW9CsC/jN9DgnfWo0hl8NHANSCr2JBQkrl8co888iBOVsXy75gfIoG2Gc6FFTV6Cg 2jGA== X-Gm-Message-State: ACrzQf10+QLyOtvnl4qDaWzWtQt66ghYy0KCVvfVmaEYSXIp1nYIvIr9 2a/oqEmB9oQQ4GgfQmRN0ANW8DdeJ/fT0mXr X-Google-Smtp-Source: AMsMyM4JIsnsUTr4aPf4HfUrk+HUJkSqexi5l/7hHZ3J2rkqg1VVg8Kv3GbL3zRpvWOLcnCJv5d3Iw== X-Received: by 2002:a5d:4d8d:0:b0:236:7921:e10e with SMTP id b13-20020a5d4d8d000000b002367921e10emr9460wru.61.1667253396835; Mon, 31 Oct 2022 14:56:36 -0700 (PDT) Received: from xps13 ([2a02:6b61:74a5:0:3e3e:75ff:de88:7a90]) by smtp.gmail.com with ESMTPSA id l13-20020adfe58d000000b002366f300e57sm8199139wrm.23.2022.10.31.14.56.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 14:56:36 -0700 (PDT) References: <87edup9h0y.fsf@beadling.co.uk> User-agent: mu4e 1.4.15; emacs 27.2 From: Phil To: guix-devel@gnu.org Subject: Re: Compile skribilo doc containing guix channel references In-reply-to: <87edup9h0y.fsf@beadling.co.uk> Message-ID: <87a65bac8c.fsf@beadling.co.uk> Date: Mon, 31 Oct 2022 21:56:35 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=2a00:1450:4864:20::42d; envelope-from=phil@beadling.co.uk; helo=mail-wr1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-devel" Errors-To: guix-devel-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667253439; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=jWND7K54vwee6gSXgcOj0g6o11w4WW7oILsjjnBilOE=; b=LyfJHdJ5xslBgFcD+wMFn3SLwFQvLDSjwioU175eLeoKpmHKytDU9f9AOXvEN3uGfN69SZ O1HF4IR3m2KlkAwGnZlclSOHmxZ+yWLn0983rVzLgn7m8yZj4KY9inKpYOfU908cApOtm1 sN8nKfD6+IJKIVDaCu/Usefy6Gv43Mm5Q3eVjQ4oWoyDGY9OZc3+OqzFKPCa6u8U+HC9MR xVl4ypHkFVxml/127jCOGwCaxctPxUFWzt6Ibq6fDtpGT4ZyQJJN1ksseNTgE+yt4CXQR4 Px/+JJseJdgwuP8Tq6T6ZO3pNaIyzLypo6AOsgH7f/1xUR9I1uFRFA4ZnsWWYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667253439; a=rsa-sha256; cv=none; b=WICY0nOaEs2o8yOl9f/yM5D+60xpk5yJ55/TgvD4UW5VJzW8P/yaDJq5JsIjKHxCdex4Sz rzTN5TMDa9uOtXzLxB5DUQ8NIV4NTfIswN+UX4tdV7+JB0kwjTp35FeD3Lq7bSJFBLMrRe qriT2F9oreLxG/oLNQfHD2WcV44oJKpQ2SkHqWyJ4lUn+NU7yhyolb9ELjmXo9vUdpYKc3 taGAsybIKx0IvYthetyXJGdMLUFJZFQPwWs8OV1pr3HDp5l/r9tmavmofuaoTJ/KVLMVrU AwEM5C1lrlwwBDf0hIXh0hiTJ0DsbIW/gnOnIxcPzg8CD7xJySf4WpjUy8CN4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=lyx7Qw+D; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.97 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=lyx7Qw+D; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A7660311C5 X-Spam-Score: -1.97 X-Migadu-Scanner: scn1.migadu.com X-TUID: IQFlybnlLhWm Hi, Phil writes: > My guess is there is a better approach - any suggestions? Perhaps I can > call the skribilo compiler from inside "guix repl" for example? To somewhat answer my own question in case it's useful to anyone else or if anyone has any suggestion on how to do it better - there are 2 ways I've found to do this. The most obvious is to abandon the skribilo DSL and write the document directly as a scheme file which will evaluate and write itself out as HTML - it can then be called as: guix repl -- foo.scm: (with-output-to-file "foo.html" (lambda () (evaluate-document d e)))) See skribilo docs for full example. This isn't ideal because you can't use a the skribe format which isn't pure scheme. To do that we have to call the scribilo compiler's main entry point from inside scheme rather than from the command line - the below example worked for me, but it's quite fiddly to get it to work. It is also called from guix repl. To give a very simple example the document can use guix functions to reference infomation in the channel I'm documenting: (p [The ,(package-name my-package) package is set to ,(package-version my-p= ackage).]) The below script has to be one level above the package directory in my channel, and the script must be called the directory which houses it. The output should also go to the same directory. I then moved the output HTML afterwards, rather than putting the target path in --output - this makes sure the links work. The hardcoding of the load-path is also not ideal, I suspect this can be improved. (add-to-load-path "/gnu/store/ymvqgkljzykfv4g7vbw36pgghfjbhnps-skribilo-0.9= .5/share/guile/site/3.0") (add-to-load-path "/gnu/store/2160nv245ys30vxvhpjxgcbjm9rq67gw-guile-reader= -0.6.3/share/guile/site/3.0") (define local-repo-clone-path (dirname (current-filename))) =20 (define local-packages-clone-path (string-append local-repo-clone-path "/packages")) (add-to-load-path local-packages-clone-path) (use-modules (skribilo condition)) (call-with-skribilo-error-catch/exit (=CE=BB () (apply (module-ref (resolve-interface '(skribilo)) 'skribilo) `("--target=3Dhtml" ,(string-append "--source-path=3D" local-packages-clone-path) ,(string-append local-repo-clone-path "/docs/my-channel-skribi= lo-doc.skb") "--output=3Dindex.html"))))