From: "Clément Lassieur" <clement@lassieur.org>
To: 27153@debbugs.gnu.org
Subject: bug#27153: gnu: sicp: Add the HTML version.
Date: Tue, 30 May 2017 23:05:42 +0200 [thread overview]
Message-ID: <87y3teukbd.fsf@lassieur.org> (raw)
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:
--8<---------------cut here---------------start------------->8---
(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"))))
--8<---------------cut here---------------end--------------->8---
next reply other threads:[~2017-05-30 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 21:05 Clément Lassieur [this message]
2017-05-30 21:11 ` bug#27153: [PATCH] gnu: sicp: Add the HTML version Clément Lassieur
2017-05-31 13:39 ` Ludovic Courtès
2017-06-01 9:09 ` Clément Lassieur
2017-05-31 3:42 ` bug#27153: " Maxim Cournoyer
2017-05-31 6:44 ` Clément Lassieur
2017-05-31 13:39 ` Ludovic Courtès
2017-06-01 13:27 ` Christopher Allan Webber
2017-06-03 0:48 ` Maxim Cournoyer
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=87y3teukbd.fsf@lassieur.org \
--to=clement@lassieur.org \
--cc=27153@debbugs.gnu.org \
/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.