From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFuXJ-0002T6-6D for guix-patches@gnu.org; Tue, 30 May 2017 23:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFuXG-0005Ix-3p for guix-patches@gnu.org; Tue, 30 May 2017 23:43:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:43335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFuXF-0005Ir-V7 for guix-patches@gnu.org; Tue, 30 May 2017 23:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dFuXF-00058u-Ly for guix-patches@gnu.org; Tue, 30 May 2017 23:43:01 -0400 Subject: bug#27153: gnu: sicp: Add the HTML version. Resent-Message-ID: From: Maxim Cournoyer References: <87y3teukbd.fsf@lassieur.org> Date: Tue, 30 May 2017 20:42:34 -0700 In-Reply-To: <87y3teukbd.fsf@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Tue, 30 May 2017 23:05:42 +0200") Message-ID: <87d1apsndh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 27153@debbugs.gnu.org Hi Cl=C3=A9ment, Cl=C3=A9ment Lassieur writes: > Yesterday, while browsing the Info version of SICP, I came accross an > incomplete figure (Figure 3.1: environments A and B are missing). I > thought the HTML version might be complete and indeed it was. It's > really nice by the way, see http://sarabander.github.io/sicp/. And real > figures are in my opinion more pleasant to study than ASCII art figures. > > So I think we should add the HTML version to our package. :-) That > would allow us to use it without Internet access. > > I find it much easier to browse the Info manual than the HTML one, so I > wrote this small Elisp snippet to switch from the former to the latter: > > (defun sicp-browse () > "Ask a browser to load the HTML version of the current node." > (interactive) > (let* ((home (expand-file-name "~")) > (dir (concat "file://" home "/.guix-profile/share/doc/sicp/html/= ")) > (node Info-current-node) > (pattern > (string-join > '("^\\(?1:[0-9]\\)\.\\(?2:[0-9]\\)\.\\(?3:[0-9]\\)$" ; 4-5-7 > "^\\(?1:[0-9]\\)\.\\(?2:[0-9]\\)$" ; 4-5 > "^Chapter \\(?1:[0-9]\\)$") ; Chapter= 4 > "\\|"))) > (if (string-match pattern node) > (let ((chapter (match-string 1 node)) ; 4 > (section (match-string 2 node)) ; 5 > (sub-section (match-string 3 node)) ; 7 > base > (anchor "")) > (if section > (setq base (format "%s_002e%s" chapter section)) > (setq base (format "Chapter-%s" chapter))) > (when sub-section > (setq anchor (format "#g_t%s_002e%s" base sub-section))) > (browse-url (concat dir base ".xhtml" anchor))) > (error "Node not matched")))) Cool! Thanks for sharing. I having started my study of SICP yet, but that's something I've been meaning to do. Also, couldn't the info version contain real figures (bitmaps)? Emacs is capable of displaying images; maybe the info viewer is able to detect if yes or no images are supported, and degrade gracefully to an alternative (ascii art) when support is lacking? Just some thoughts :) Maxim