espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.76k stars 743 forks source link

Does the build_board_docs.py script currently work #2440

Closed brendena closed 9 months ago

brendena commented 9 months ago

I tried to build the documentation with EspruinoDocs/build.sh, but there were errors in the build_board_docs.py in this repo.
The error i saw was that it was throwing a error here. It would fail if the array didn't have a zero's index. Which happened over the dicky watch and possibly others json object parsing.

My goal is to see the module page i'm working on. So i tried to fix it here by moving to Python3 and fixing the errors i saw. But the output looked wrong. My best guess is bootstrap is not loading which has many of the classes needed. Lower down the page there are css classes that do get loaded.

Screenshot 2023-12-12 060420

gfwilliams commented 9 months ago

Thanks for trying to check your module's rendering out beforehand!

That's odd - I do see it working here - I use it to build the website.

So what call do you see an error on? I just tried on:

python scripts/build_board_docs.py ESPRUINOBOARD pinout

And it appears to work fine for me. Your changes to get it working with Python 3 sound like a good idea either way though.

As for the result - I think it's correct? Comparing with the printable version at https://www.espruino.com/Original?print it looks about right? It would look a bit different to what it does on the main site, but we don't generally use bootstrap in the reference pages...

brendena commented 9 months ago

The thing i saw might only happen when you try to do a full build EspruinoDocs/build.sh. It through an error when trying to parse Dicky JS wrapper page.

But i made a pull request for the changes https://github.com/espruino/Espruino/pull/2441

gfwilliams commented 9 months ago

Thanks!

But Dicky JS? I thought that was a typo. Where are the files for that board?

brendena commented 9 months ago

My bad it was Dickens. So this is the message i would get from running EspruinoDocs/build.sh

It wouldn't crash the build. I just didn't know what other ramifications it had because it failed. Since when it its this error it does a exit(1).

This is the error i would get. Code section

JSON PARSE FAILED for { "type" : "staticmethod", "class" : "Bangle", "name" : "drawWidgets", "patch":true, "generate_js" : "libs/js/dickens/Bangle_drawWidgets_DICKENS.min.js", "#if" : "defined(BANGLEJS) && defined(DICKENS)" } - list index out of range Traceback (most recent call last): File "scripts/build_docs.py", line 49, in jsondatas = common.get_jsondata(True) File "/home/brendena/Espruino/scripts/common.py", line 271, in get_jsondata print(''.join(traceback.format_exception(None, exc_obj, exc_obj.traceback))) NameError: global name 'traceback' is not defined

gfwilliams commented 9 months ago

Thanks! That's really odd - I wonder why I didn't see it in my builds.

As far as I can tell I'm executing it using Python 3.10.12 so it's not like I'm using Python 2.7. Maybe in a newer release they made it complain about accessing [0] on an empty array - thanks for fixing that code, as it looked broken anyway