Skip to content
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

feat(coral): Topic documentation - show empty state and preview #1395

Merged
merged 8 commits into from
Jun 26, 2023

Conversation

programmiri
Copy link
Contributor

@programmiri programmiri commented Jun 23, 2023

About this change - What it does

  • adds an empty state for documentation ("add documentation" is not implemented, later PR)
  • adds a preview for existing documentation ("update documentation" is not implemented, later PR)

Technical background

Approach general:
Since the angular app still uses html to show docs and our users may have saved documentation as html, we decided to go continue with the approach to save the documentation as stringyfied html (at least for now). We still will offer a markdown editor to users. The formatting between html and markdown will happen in frontend (remarkjs together with rehype offers good solutions for that). This provides a more safe input option for us and keeps the door open to change everything to markdown at some point.

  • remarkjs also offeres a library, hook-based, as a "more modern solution" (react-remark) which I initially thought of using, because it would make the editing part easy. But this library is not as well supported. It's based on an older version of remarkjs, which means plugin in the newest version don't work. This should have been updated in the next major release, but this information is from May 2022. There seems to be no activity towards that since then.

Styles

We need to add some overrides for styles. For the html elements in documentation the global styles from DS are applied, which means that there are styles on elements that are reseted to be styled with classes etc (which the html in documentation does not have).

After sync with Mustafa I added styles for basic typography elements (where needed). This should cover most cases for user already, if not all. We can update that if needed.

styles-documentation

Recording

recording-documentation.mov

Relates to #1298

@programmiri programmiri linked an issue Jun 23, 2023 that may be closed by this pull request
3 tasks
@programmiri programmiri self-assigned this Jun 23, 2023
@programmiri programmiri marked this pull request as ready for review June 26, 2023 06:36
@programmiri programmiri requested a review from a team as a code owner June 26, 2023 06:36
Copy link
Contributor

@mathieu-anderson mathieu-anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me except for my bugbear, but I think we should have comments and/or documentation somewhere about the reponsabilities of react-markdown and the rehype-raw plugins, so the flow of html -> string -> markdown -> string -> html is crystal clear :o

Thank you ^^

@programmiri
Copy link
Contributor Author

, but I think we should have comments and/or documentation somewhere about the reponsabilities of react-markdown and the rehype-raw plugins, so the flow of html -> string -> markdown -> string -> html is crystal clear

Yes! I would add that in the next PR though, where I add the "add/edit" functionality, because I'm not 1000% sure now how the process will look like in detail (like, which plugins etc) in the end.

@mathieu-anderson
Copy link
Contributor

Yes, the documentation should probably be written last ^^

Signed-off-by: Mirjam Aulbach <[email protected]>
@programmiri programmiri marked this pull request as draft June 26, 2023 07:38
@programmiri programmiri force-pushed the 1298-topic-overview-documentation branch from 5130972 to 2b53795 Compare June 26, 2023 09:24
@programmiri programmiri marked this pull request as ready for review June 26, 2023 09:29
@mathieu-anderson mathieu-anderson merged commit 74ed1f3 into main Jun 26, 2023
@mathieu-anderson mathieu-anderson deleted the 1298-topic-overview-documentation branch June 26, 2023 11:50
@programmiri programmiri added this to the Klaw Release 2.5 milestone Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🪸 Topic overview - documentation
2 participants