-
Notifications
You must be signed in to change notification settings - Fork 94
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
New feature: Callouts #2227
New feature: Callouts #2227
Conversation
We also have tried some variations of background color. And icon colors. The main problem of the alternatives is the text and background combination, to create a good contrast. Those variables are in hexadecimal, it should be Refs: https://css-tricks.com/switch-font-color-for-different-backgrounds-with-css/ |
Very nice! :) Some design feedback:
|
This looks very nice! I don't know about using the primary color for info blocks. It looks weird when it is similar to the warn/error/success color. How about something blueish or greyish?
While waiting for potential new css vars for the light backgrounds, we could just hardcode them: I played with your changes, made some changes to |
I think i had similar issues in the past. I think the server is caching the images. Setting up my docker dev environment from scratch fixed it for me - but that is obviously far from ideal. I suspect there is some occ command or so to clean up image cache or even disable it. |
src/mixins/menubar.js
Outdated
}, | ||
}, | ||
{ | ||
label: t('text', 'Error'), |
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.
label: t('text', 'Error'), | |
label: t('text', 'Danger'), |
Maybe danger would be a bit less technical as the user facing term?
src/nodes/CalloutsContainer.js
Outdated
|
||
name: 'calloutContainer', | ||
|
||
content: 'paragraph+', |
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.
Just curious, is limiting to paragraph done on purpose or would there be also a way to have other blocks like headings/lists in the callout container as well? Fine to keep it but if there are limitations maybe a quick code comment might be good about the reasoning ;)
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.
@vinicius73 and me came up with this during a call.
One of the issues we were facing was having different callouts nested - like a warning inside an info. That would be super confusing.
I also thought it would be good to try and keep the schema as simple as possible to make it easier to reason about. I was afraid we might create such complex structures in text that the generated markdown will not be parsed by other markdown consumers. Today i tried to create such a document by nesting lists and quotes etc. and the resulting markdown was parsed well by github. So markdown is able to handle much more complexity than i thought.
So now i think we actually need to allow for the same level of complexity in the schema. If we have a file that has content that the schema does not allow for it will fail to load in text. In case of the callouts this would currently already be invalid:
::: info
### heading in the info
Some text
:::
So I think we should allow for all block content in infoboxes to be able to parse markdown that contains these.
At the same time I would like to try to discourage creating too complex structures in the UI. For example... when you are in an info box and click the warning box button... we turn the infobox into a warning box rather than adding a warning box inside the info box.
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.
I'd be fine either way, but iirc yesterday (in our call after the message) you mentioned that now you think that supporting different node types would be more fitting to what markdown can actually represent.
We could also get this in first with that limitation and look into the further sub-node types in a follow up.
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.
When working on tables i noticed that content that is out of spec for prosemirror will still be inserted as the text content.
So this:
::: info
## Heading
content
:::
Would render like
::: info
Heading
content
:::
Which seems fine for a start. I would also be okay with allowing headings in there - but let's avoid any generic container such as lists or quotes that then allow everything inside them.
During development a |
So @jancborchardt and I talked about this, and we think we could use Nextcloud blue |
7b9cc7b
to
322645b
Compare
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.
Looks good as discussed with removal of the line height adjustments 👍
Lets give @max-nextcloud the chance for a review and feedback on the content nodes before merging 😉
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.
Looks great - both code and ui wise. 🤩
One minor thing that i would like would be if removing multiline callouts worked like changing them to a different type. When i am on one line and i turn the callout off it would be nice if the entire callout would be gone - not just the line i am on. Could be done separately though...
I'll approve this so we can get it in.
using help-circle from material icons we expect to use i icon for the custom-containers feature Signed-off-by: Vinicius Reis <[email protected]>
create a tiptap extention to create a custom-container element, missing markdown-it-container Signed-off-by: Vinicius Reis <[email protected]>
define info, warn, error and success containers Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
use type in toMarkdown Signed-off-by: Vinicius Reis <[email protected]>
also add some css improviments Signed-off-by: Vinicius Reis <[email protected]>
All content was transformed into plain text, missing all node data. Signed-off-by: Vinicius Reis <[email protected]>
- Only paragraph inside container - Change and remove container Signed-off-by: Vinicius Reis <[email protected]>
Also add container icons Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
remove unecessary width Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
also remove dependency vulnerability Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: Vinicius Reis <[email protected]>
944b062
to
2874299
Compare
Signed-off-by: Vinicius Reis <[email protected]>
d344ad6
to
1bcf179
Compare
Summary
Add a new feature called
Callouts
It allows putting more than one paragraph.