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

Update doc #2415

Merged
merged 22 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/userGuide/components/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

The components in this page are the core **presentational** components you may want to use. Panels and tabs can be used to **organise content sections**, while badges and boxes can **highlight small, specific pieces of information**.
</div>
<box type = "warning" header = "#### Use of markdown in content" >

As presentational components are HTML-based, you need to follow the HTML syntax when using markdown in the content of the components.
More specifically, you should use either:
- add a line break with no indentation before the markdown content
- use the `<markdown>` (block level elements) or `<md>` (inline level elements) tags to wrap the markdown content.

For more information, please refer to this [section]({{baseUrl}}/userGuide/usingHtmlJavaScriptCss.html#markdown-in-html).
</box>

{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

Expand Down
17 changes: 16 additions & 1 deletion docs/userGuide/syntax/badges.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## Badges

**Example:**
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<span class="badge bg-primary">
Some Plain Text
</span>

<span class="badge bg-primary">
<md>_Some Markdown_</md>
</span>
</variable>
</include>

**You can choose from a variety of colors for your badges. You can also use the `rounded-pill` class to make the badges pill-shaped.**
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
Expand All @@ -24,7 +39,7 @@ Normal:
</variable>
</include>

You can use Badges in combination with headings, buttons, links, etc.
**You can use Badges in combination with headings, buttons, links, etc.**

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
Expand Down
20 changes: 14 additions & 6 deletions docs/userGuide/syntax/boxes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@

## Boxes

**Boxes come with different built-in types.**

**Simple Example**
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<box>
default
plain text
</box>

<box>
<md>_markdown_</md>
</box>
</variable>
</include>

**Boxes come with different built-in types.**

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<box type="info">
info
</box>
Expand Down Expand Up @@ -50,9 +61,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<box>
default
</box>
<box type="info" theme="primary">
primary
</box>
Expand Down
3 changes: 2 additions & 1 deletion docs/userGuide/syntax/panels.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<variable name="highlightStyle">html</variable>
<variable name="code">
<panel header="This is your header for a Panel, click me to expand!">
Lorem ipsum ...
<markdown>_markdown_</markdown>
plain text ...
</panel>
</variable>
</include>
Expand Down
3 changes: 2 additions & 1 deletion docs/userGuide/syntax/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<variable name="code">
<tabs>
<tab header="First tab">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ullamcorper ultrices lobortis.
Text in the first tab
<markdown>_some markdown_</markdown>
</tab>
<tab header="Disabled second tab :x:" disabled>
</tab>
Expand Down
39 changes: 38 additions & 1 deletion docs/userGuide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Cats | yes | 100 |
</span>
```

The table specified by the markdown syntax above will be rendered as a block-level element, which will be included in a inline span element. This makes the HTML output invalid.
The table specified by the Markdown syntax above will be rendered as a block-level element, which will be included in a inline span element. This makes the HTML output invalid.

<panel header="Underlying Error (Example)" type="seamless">

Expand All @@ -57,3 +57,40 @@ Cats | yes | 100 |
</div>
```

##### Markdown Rendering Issues

If you encounter issues in rendering Markdown in a component, it is likely that the Markdown is not being properly recognized due to syntax errors. Signposting is required to inform Markdown to parse the content of a presentation component as Markdown rather than plain text.

You could signpost Markdown either by:

- using the `<markdown>`(block level elements) or `<md>`(inline level elements) tags to wrap the Markdown content.
- using an empty line without any indentation before the Markdown content

###### Example: correct Markdown rendering using tags or newline:
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<box>

**Example1**
</box>

<box>
<md> **Example2** </md>
</box>

<box>
<markdown> **Example3** </markdown>
</box>


</variable>
</include>
<panel header="###### Example: Markdown not rendered without singposting" type="seamless">
<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">html</variable>
<variable name="code">
<box> **This will be rendered as plain text**</box>
</variable>
</include>
</panel>
Loading