Exercise character
nticaric opened this issue · 9 comments
I like 2. And I would think that we want the answers to questions to be hidden by default, with a triangle to click on to reveal the answer.
I'm wondering how else an online version can be enhanced:
- Link to the Common Lisp Hyperspec for each builtin function.
- Link to my code for the functions I define (Link within the book, or to the Github files?)
- Ability to run code in the browser.
@norvig Here's my vision of the online book. I played only with the first chapter and it's obviously not complete but just wanted your opinion if we should move in this direction.
https://nticaric.github.io/paip-lisp/#/chapter1
Each chapter would be broken down into its own file and would be markdown flavored. Code highlighting would also look nice as shown here
https://nticaric.github.io/paip-lisp/#/code
If you like it, I'll create a pull request
Great start! That looks very nice, both the overall layout and the code highlighting. I think we want a serif font for the body text, to make it stand out more from sans-serif code font. Somebody helpfully posted a comment on the fonts used in the original book; I'm not sure if they would be best for online viewing. For the "evaluates to" arrow, I think we want ⇒
⇒
On the code highlighting: the orange colored symbols are not quite right. It seems okay that defun
, if
, lambda
, etc. are highlighted, but other special forms like setf
are not; also some functions like append
and cons
are highlighted, but most functions are not.
Ok, I guess we have to play a little bit with the code highlighting plugin. It's from
https://github.com/akirak/prism-emacs-lisp
The project seems to be pretty young and in development. Maybe @akirak could address some of those issues
There are other highlighters, like highlightjs.org
or code-prettify.
@nticaric Thanks for mentioning the plugin, but it needs rework due to my lack of expertise in Lisp and regular expressions. There is another guy rewriting it so that it can be merged into the code base of PrismJS.
Re: highlighting
https://github.com/orthecreedence/highlight-lisp
I have used this and is used by the Common Lisp Cookbook
It is specific to Common Lisp