hpi-swa-lab / SqueakByExample-english

An introductory book about the Squeak/Smalltalk programming system, guiding students and developers through the environment, language, tools, and the Morphic framework by means of a series of examples and exercises.
https://www.lulu.com/shop/patrick-rein-and-christoph-thiede/squeak-by-example-60/paperback/product-8vr2j2.html
Other
24 stars 6 forks source link

Add in-image book reader #222

Open LinqLover opened 7 months ago

LinqLover commented 7 months ago

image

About this version of the book
Squeak by Example is a classical book intended for PDF/print format in the first place. Nevertheless, we made some efforts to make it available right in Squeak. For this, we wrote our own LaTeX parser that uses Sandblocks' Tree-sitter integration and a LaTeX grammar for tree-sitter to convert over 10,000 SLOC of text into Squeak objects (don't try this at home!). You can read the result in this help structure or search it using the search bar at the top. Note that this parser is meant to be an approximation only and we didn't get every space right to save our own sanity. Nevertheless, if you've got any questions or feedback, we're there at our GitHub repo: https://github.com/hpi-swa-lab/SqueakByExample-english

Quickstarter to try out the result (works on both Squeak 6.0 and Squeak 6.1Alpha):

Metacello new
    baseline: 'SBE';
    repository: 'github://hpi-swa-lab/SqueakByExample-english:extract-book/SmalltalkSources';
    get;
    load: #'SBE-Book'.

book := (Smalltalk classNamed: #SBEBook) readFrom: (WebClient httpGet: 'https://github.com/LinqLover/SqueakByExample-english/raw/extract-book-builds/sbe60.sbebook') content.
(Smalltalk classNamed: #SBEHelp) book: book.
HelpBrowser open model showTopicNamed: #SBEHelp.

Implementation

This PR adds two (and a half) packages:

A note on cost-benefit:

I will maybe do some very minor tweaking of the UI but 80% of the project is done and I am currently not planning to address the last 19.5%. However, if you find any urgent issues, I will be happy to take a look at them. Otherwise, I'd like to release this soon. Wdyt, can we merge this and ship it to our students? :-)

LinqLover commented 7 months ago

Open todo:

LinqLover commented 7 months ago

@codeZeilen Thank you! :-) I guess I'm not in a hurry to merge this but will point students to this branch, but would you agree with including the extractor into the CI and mentioning the in-image-reader in the readme and in the preface of the book in the long term? If yes, would we want to do this before or after archiving the 6.0 version on a separate branch (similar to #130)? :)

LinqLover commented 7 months ago

Same question for #225. My $0.02: Given that we still ship the 6.0 version to students, it makes sense to me to keep it maintained in the default branch for now until we release the next edition. Maybe we would even want to release a 6.0.1 edition at some time, but not necessarily. Wdyt?