norvig / paip-lisp

Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exercise character

nticaric opened this issue · comments

In the print version each exercise starts with a monitor with a question mark. What would be the best replacement for this in the text file?

805b1

Here are some propositions:
  1. anything else?

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

Thanks @aarvid. This one seems to be working pretty well. I'll created a PR for this