Skip to content

Commit

Permalink
Add once attribute to custom lists so attributes only apply to curr…
Browse files Browse the repository at this point in the history
…ent item
  • Loading branch information
KevinEyo1 authored Apr 7, 2024
1 parent 74e580b commit fa48343
Show file tree
Hide file tree
Showing 6 changed files with 693 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/devGuide/projectManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,4 @@ Note that:
* Result: 'tlylt' will be updated to have both icons(code and doc)

{% from "njk/common.njk" import previous_next %}
{{ previous_next('githubActions/markbindReusableWorkflows', 'styleGuides') }}
{{ previous_next('githubActions/markbindReusableWorkflows', 'styleGuides') }}
27 changes: 27 additions & 0 deletions docs/userGuide/syntax/lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ Markdown can also be used in texts.
You may need to add escape characters when using special characters for Markdown in text.
</box>

**You can add an icon or text that only applies to a specific item by using the `once` attribute.**

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
* Item 1 { icon="glyphicon-education" }
* Item 2 { icon="fas-code-branch" once=true }
* Item 2.1
* Item 2.2
* Item 3
</variable>
</include>

Subsequent items at the same level will not inherit icons or texts with the `once` attribute and will instead inherit the icons or texts before it.

The `once` attribute also applies to all other attributes such as `i-size` and `t-size` as seen below.

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code">
* Item 1 { icon="glyphicon-education" i-size="40px" i-class="text-primary" }
* Item 2 { i-size="25px" once=true }
* Sub-item 2.1
* Item 3
</variable>
</include>

**You can adjust the icon and text's size by using the `i-size` and `t-size` attribute respectively.**

<include src="codeAndOutput.md" boilerplate >
Expand Down
Loading

0 comments on commit fa48343

Please sign in to comment.