-
Notifications
You must be signed in to change notification settings - Fork 323
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
Render tables in documentation. #11564
base: develop
Are you sure you want to change the base?
Conversation
Also: - Separate parser for our flavor of Markdown from the CodeMirror integration; move the parser into ydoc-shared and use for Markdown line-wrapping. - Introduce our own version of yCollab extension; initially just the upstream version translated to Typescript and our code style. - Refactor CodeEditor.
}, | ||
}) | ||
|
||
/** TODO: Add docs */ |
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.
Let's fill another missing docs here.
app/gui/src/project-view/components/MarkdownEditor/TableEditor.vue
Outdated
Show resolved
Hide resolved
app/gui/src/project-view/components/MarkdownEditor/TableEditor.vue
Outdated
Show resolved
Hide resolved
watch([vueHost, toRef(props, 'source')], ([vueHost, source]) => { | ||
if (!vueHost) return |
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.
Since some version of Vue we can decompose properties
const { source } = defineProps<{ source: string}>
it makes source
reactive, so there will be no need for toRef
.
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.
Props destructuring is actually a rather simplistic macro--it would be equivalent to replacing references to source
with props.source
. So the destructured bindings are reactive values, but they aren't reactive references that can be watched.
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.
Right, I didn't read the documentation to the end...
}) | ||
|
||
const editing = ref(false) | ||
</script> |
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.
Do we allow editing single cells? I see no logic for updating file after change.
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.
We decided during refinement not to allow cell edits until we have support for structural table edits. This is a simple synchronization implementation based on passing a string into the component; for edits we will replace it with a (local-only) cell YText
that is synchronized with a slice of the whole-documentation YText
.
app/gui/src/project-view/components/MarkdownEditor/TableEditorCell.vue
Outdated
Show resolved
Hide resolved
app/gui/src/project-view/components/MarkdownEditor/markdown/decoration.ts
Outdated
Show resolved
Hide resolved
/** | ||
* @param ytext | ||
* @param awareness | ||
* @param undoManager Set undoManager to false to disable the undo-redo plugin | ||
*/ |
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.
Please write some summary here (we don't need empty @param
s)
If this is yCollab copy, write what changes we've made (and license information if required).
) { | ||
ast.module.transact(() => applyTextEditsToAstImpl(ast, textEdits, metadataSource)) | ||
} | ||
|
||
function applyTextEditsToAstImpl( | ||
ast: MutableAst, |
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.
Why we add new named function? We could just put it inside transact lambda.
This reverts commit 7431384.
…wip/kw/doc-tables
Pull Request Description
Closes #9970.
Gravacao.de.Tela.2024-11-14.as.19.29.50.mov
Also:
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.