-
Notifications
You must be signed in to change notification settings - Fork 121
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
Refactor importHTML #714
Comments
@raineorshine, hi! I would like to take it. Could you explain please, when we use this function and how HTML input and JSON output look like? I've found this example in
Do we get such JSON output (as input in this example), when we import HTML? |
This question is best answered by searching the code base for "importHtml". You'll notice that it is only called in importText.
The input may be any string of HTML. I think the So the function signatures, excluding options, would look like this: export interface Block {
scope: string,
children: Block[],
}
interface ThoughtUpdates {
thoughtIndexUpdates: GenericObject<Lexeme>,
contextIndexUpdates: GenericObject<ParentEntry>,
}
htmlToJsonBlocks: (html: string) => Block[]
importJsonBlocks: (thoughtsRanked: Path, blocks: Block[]) => ThoughtUpdates
importText: (thoughtsRanked: Path, inputText: string) => ThoughtUpdates Note that |
importHTML
currently converts HTML directly into thought updates. Instead, break it up into two distinct functions that can be used independently as well as in a pipeline.The text was updated successfully, but these errors were encountered: