mostly-adequate-guide icon indicating copy to clipboard operation
mostly-adequate-guide copied to clipboard

in browser exercises???

Open ChuckJonas opened this issue 4 years ago • 9 comments

In chapter 5 (curry), you first encounter exercises. The section states:

Throughout the book, you might encounter an 'Exercises' section like this one. Exercises can be done directly in-browser provided you're reading from gitbook (recommended).

Maybe I'm missing something, but I don't see any way to do these in browser. It mentions an "embedded editor" but I'm not seeing one...

Wondering if this is an outdated / no longer supported feature of gitbook?

ChuckJonas avatar Feb 25 '21 15:02 ChuckJonas

I think the last build which is hosted on https://mostly-adequate.gitbook.io/ is broken. In each chapter there is only 1st page available, the rest are blank.

ping @DrBoolean

seyfer avatar Feb 27 '21 19:02 seyfer

I also don't know what I'm missing. I also tried running this locally and though I see all the functions in the support index.js, I can't run that locally. Not sure if I should just hack together an html page so I can do it in the console. ¯_(ツ)_/¯

JoshTRN avatar Mar 04 '21 01:03 JoshTRN

@ChuckJonas Wondering if this is an outdated / no longer supported feature of gitbook?

Yes indeed, in-browser exercises seem to no longer work since the update to the new gitbook platform. That's a pity. This was using a plugin which may no longer be supported. The section will need to be rephrased until a new way to embed in-browser exercises is found.

@seyfer @JoshSchreuder In each chapter there is only 1st page available, the rest are blank.

The whole chapter is actually available on the first page but for some reason, Gitbook is creating new blank pages for anchors of the chapter. This is perhaps a configuration setting which has to be done differently with the new Gitbook we recently switched over to. Thanks for reporting, I'll give it a look.

KtorZ avatar Mar 08 '21 10:03 KtorZ

also in CH08 last exercise is missing a piece, the real question though :rofl:

sebbalex avatar Mar 09 '21 18:03 sebbalex

@KtorZ isn't there a way to just preload all the functions by sourcing the JS in the HTML? That would make it so you could just do all the exercises in the console.

JoshTRN avatar Mar 09 '21 18:03 JoshTRN

If anything, It is possible to do the exercise in the terminal with node.js.

KtorZ avatar May 01 '21 15:05 KtorZ

@KtorZ, not really actually. There is a problem with dependencies versions. You will get unable to resolve dependency tree while installing exercises deps. I've bumped their versions to the latest and finally I'm able to play with them

 "devDependencies": {
    "cli": "^1.0.1",
    "eslint": "7.26.0",
    "eslint-config-airbnb": "18.2.1",
    "eslint-plugin-import": "2.23.2",
    "eslint-plugin-jsx-a11y": "6.4.1",
    "eslint-plugin-react": "7.23.2",
    "live-server": "1.2.1",
    "mocha": "8.4.0"
 }

Fellach avatar May 16 '21 11:05 Fellach

Even after updating the versions and installing the tests are not working correctly, they always fail even when correct...

Edit: if i set node version to 10.22.1 they work.

hariseldon78 avatar Jun 06 '21 05:06 hariseldon78

Even after updating the versions and installing the tests are not working correctly, they always fail even when correct...

Edit: if i set node version to 10.22.1 they work.

Thanks! I downgraded from 18.3.0 to 8.17.0 and it worked.

sevillaarvin avatar Jul 22 '22 09:07 sevillaarvin