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

Exploring the power behind rich text #19

Open
github-learning-lab bot opened this issue Mar 9, 2020 · 4 comments
Open

Exploring the power behind rich text #19

github-learning-lab bot opened this issue Mar 9, 2020 · 4 comments

Comments

@github-learning-lab
Copy link

Exploring the power behind rich text

Branch: richtextmarkdown

Introduction

As we've seen, Markdown is a user friendly language that can be easily converted to HTML. In this lesson, we'll see how it's possible to use this language in our Rich Text block to create interesting texts.

Rich Text with Markdown

To include texts in the rich-text block, you need to use the text prop:

  "rich-text#home1": {
    "props": {
      "text": "Meu texto",
      "textPosition": "LEFT",
      "textAlignment": "LEFT"
    }

The text prop accepts markdown format. However, if you want to write your text using this language, your code must be similar to the following:

```json
  "rich-text#home1": {
    "props": {
      "text": "# My title h1 \n Insert a paragraph here \n ## My title h2 \n Insert the second paragraph here \n Include a list here \n - Item 1 \n - Item 2 \n - Item3",
      "textPosition": "LEFT",
      "textAlignment": "LEFT"
    }

TIP: Always use the \n command to skip lines when using markdown in the text prop

Other properties of the rich-text component can be found in the Store Framework official documentation

Activity

  1. In about-us.jsonc, change the text in tab-list.item#home1 so that an "About" appears in the first tab;

  2. In the rich-text content linked to this tab, use the text below:

# Our history \n ### We were born from an internal VTEX hackathon! \n That's right. VTEX's first Hackatheme (store theme hackathon) had 3 finalists. One of them was FlatFlat, the store that you're accessing now. FlatFlat was created by the engineers Afonso Praça and Sávio Muniz, together with designers Lucas Falcão and Augusto Barbosa, and new business director Maurício Baum. As the store was created by profissionals having the most diverse backgrounds, the result was an obvious one: they became the finalists with coolest layout among participants.
  1. Insert the title and subtitle in bold.

Expected result:

ℹ️ Remember to access the Rich Text documentation if you have any questions during the activity.


If you're still unsure as to how to send your answers, click here

@github-learning-lab
Copy link
Author

You have successfully completed this step!

Go to the next step!

@vtex-course-hub
Copy link

Oopsie, something went wrong 😿

Results

❌✅❌

Tests

❌ Your tab-list.item#home1 block does not have the correct label text
✅ Update the text content of the rich-text block associated with tab-list.item#home1
❌ The text content of the rich-text block associated with tab-list.item#home1 does not match the expected format

Try again 😁

2 similar comments
@vtex-course-hub
Copy link

Oopsie, something went wrong 😿

Results

❌✅❌

Tests

❌ Your tab-list.item#home1 block does not have the correct label text
✅ Update the text content of the rich-text block associated with tab-list.item#home1
❌ The text content of the rich-text block associated with tab-list.item#home1 does not match the expected format

Try again 😁

@vtex-course-hub
Copy link

Oopsie, something went wrong 😿

Results

❌✅❌

Tests

❌ Your tab-list.item#home1 block does not have the correct label text
✅ Update the text content of the rich-text block associated with tab-list.item#home1
❌ The text content of the rich-text block associated with tab-list.item#home1 does not match the expected format

Try again 😁

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

No branches or pull requests

0 participants