[DRAFT - DO NOT MERGE] Use ml tool output with Python Editor POC by microbit-robert · Pull Request #1180 · microbit-foundation/python-editor-v3
| const json = await readFileAsText(file); | ||
| const data = JSON.parse(json) as ActionData[]; | ||
| this.setMlData(data); | ||
| const actionNames = data.map((action) => action.name).join(" "); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Action names can have spaces in so this will break. Probably better to have a name per line, but this will require a MicroPython update to change.
| * @param the type of user event that triggered the load. | ||
| */ | ||
| load = async ( | ||
| loadHex = async ( |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the best naming, as this function can handle more than just hex files, though it is its main purpose.
| content: ModelTopicEntry; | ||
| } | ||
|
|
||
| const ModelTopicEntry = ({ content }: MlItemProps) => { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole component is hacky. If we had a markdown alternative for rendering extension documentation, we'd use it here. It's pretty horrible to write the model topic entries in the Sanity format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters