-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT - DO NOT MERGE] Use ml tool output with Python Editor POC #1180
base: main
Are you sure you want to change the base?
Conversation
Preview build will be at |
src/project/project-actions.tsx
Outdated
const json = await readFileAsText(file); | ||
const data = JSON.parse(json) as ActionData[]; | ||
this.setMlData(data); | ||
const actionNames = data.map((action) => action.name).join(" "); |
There was a problem hiding this comment.
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.
@@ -259,7 +291,7 @@ export class ProjectActions { | |||
* @param files the files from drag and drop or an input element. | |||
* @param the type of user event that triggered the load. | |||
*/ | |||
load = async ( | |||
loadHex = async ( |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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 is an alternative to https://github.com/PersonaOASIS/python-editor-v3/tree/ml-area that we can iterate on.
It uses the stubs from https://github.com/PersonaOASIS/micropython-microbit-stubs and the hex from https://github.com/PersonaOASIS/micropython-microbit-v2.
No consideration has been given to supporting other extensions yet.
ml
has been renamed tomodel
to match the stubs so that the links to API from the editor work.