Skip to content

Commit 4ab7e3a

Browse files
Add text support for icon in unordered lists
1 parent 37b7756 commit 4ab7e3a

File tree

7 files changed

+375
-71
lines changed

7 files changed

+375
-71
lines changed

docs/userGuide/deployingTheSite.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
</div>
2121

2222
## Generic steps for deploying a MarkBind site
23-
24-
1. Set the [`baseUrl` property of the `site.json` file](siteJsonFile.html#baseurl) to match the deploy location.
25-
1. (Optional) Use the [`markbind serve` command](cliCommands.html#serve-command) to stage the site locally and confirm the contents are as expected.
26-
1. Use the [`markbind build` command](cliCommands.html#build-command) to generate the site from source files. That command puts the generated site files in a directory named `_site` (you can change the output directory using parameters supplied to the command).
27-
1. Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms.
23+
* Set the [`baseUrl` property of the `site.json` file](siteJsonFile.html#baseurl) to match the deploy location. { text="Step 1:" }
24+
* (Optional) Use the [`markbind serve` command](cliCommands.html#serve-command) to stage the site locally and confirm the contents are as expected. { text="Step 2:" }
25+
* Use the [`markbind build` command](cliCommands.html#build-command) to generate the site from source files. That command puts the generated site files in a directory named `_site` (you can change the output directory using parameters supplied to the command). { text="Step 3:" }
26+
* Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms. { text="Step 4:" }
2827

2928
**Steps for deploying multiple MarkBind sites:**
3029

31-
1. Create multiple `site.json` files. Ensure that the [`baseUrl` property of each `site.json` file](siteJsonFile.html#baseurl) matches its deploy location.
32-
1. (Optional) Use the [`markbind serve -s <file>` command](cliCommands.html#serve-command) to stage each site locally and confirm the contents are as expected.
33-
1. For each site:
34-
1. Use the [`markbind build -s <file>` command](cliCommands.html#build-command) to generate the site from source files.
35-
1. Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms.
30+
* Create multiple `site.json` files. { text="Step 1:" }
31+
* Ensure that the [`baseUrl` property of each `site.json` file](siteJsonFile.html#baseurl) matches its deploy location. { text="Step 1.1:" }
32+
* (Optional) Use the [`markbind serve -s <file>` command](cliCommands.html#serve-command) to stage each site locally and confirm the contents are as expected. { text="Step 2:" }
33+
* For each site: { text="Step 3:" }
34+
* Use the [`markbind build -s <file>` command](cliCommands.html#build-command) to generate the site from source files. { text="Step 3.1:" }
35+
* Upload the site files to the Web server. The sections below explain how to automate this step if you are deploying to some online platforms. { text="Step 3.2:" }
3636

3737
## Deploying to GitHub Pages
3838

docs/userGuide/syntax/lists.md

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,61 @@
1818

1919
****Customizing the Unordered list appearance:****
2020

21-
**To customize unordered lists' icons, add the configuration `{icon="icon-name"}` after a specific list item.**
21+
**To customize unordered lists' icons, add the configuration `{icon="icon-name"}` and/or `{text="text"}` after a specific list item.**
2222

2323
<include src="codeAndOutput.md" boilerplate >
2424
<variable name="highlightStyle">markdown</variable>
2525
<variable name="code">
26-
* Item 1 { icon="glyphicon-education" }
27-
* Item 2
26+
* Item 1 { text="Step 1 :+1:" icon="glyphicon-education" }
27+
* Item 2 { text="Step 2" }
2828
* Item 2.1 { icon="fas-file-code" }
2929
* Item 2.2
30-
* Item 3 { icon="fas-code-branch" }
30+
* Item 3 { text="Step 3" }
3131
* Item 3.1
32-
* Item 4 { icon="octicon-git-pull-request" }
32+
* Item 4 { text="\`PR`" icon="octicon-git-pull-request" }
3333
* Item 4.1 { icon="mif-perm-media" }
34-
* Item 5 { icon="glyphicon-education" }
34+
* Item 5 { text="Step 5" icon="glyphicon-education" }
3535
* Item 5.1 { icon="notebook_with_decorative_cover" }
3636
</variable>
3737
</include>
3838

39+
<box type=info seamless>
40+
41+
Customization will be carried over to the other items within the **same level of the list**.
42+
Example:
43+
<include src="codeAndOutput.md" boilerplate >
44+
<variable name="highlightStyle">markdown</variable>
45+
<variable name="code">
46+
* Item 1 { icon="glyphicon-education" }
47+
* Item 1.1
48+
* Item 2
49+
</variable>
50+
</include>
51+
52+
The customised icon appears for Item 2 but not for Item 1.1.
53+
54+
Hence, if you customize any item on a certain level, you must also **customize the first item on that level**. If not, the list will revert to its uncustomized form.
55+
If you wish to remove the customization from the following levels, you can set `text` and/or `icon` to be an empty string `""`.
56+
57+
Example:
58+
<include src="codeAndOutput.md" boilerplate >
59+
<variable name="highlightStyle">markdown</variable>
60+
<variable name="code">
61+
* Item 1 { icon="glyphicon-education" text="Only for this bullet" }
62+
* Item 2 { icon="" }
63+
</variable>
64+
</include>
65+
</box>
66+
3967
You can use any of the [icons](../formattingContents.html#icons) supported by MarkBind. If an item has a specified icon, that icon will be used for it and for subsequent items at that level.
4068

69+
Markdown can also be used in texts.
70+
4171
<box type=warning seamless>
42-
If you customize any item on a certain level, you must also customize the first item on that level. If not, the list will revert to its uncustomized form.
72+
You may need to add escape characters when using special characters for Markdown in text.
4373
</box>
4474

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

4777
<include src="codeAndOutput.md" boilerplate >
4878
<variable name="highlightStyle">markdown</variable>
@@ -55,6 +85,17 @@ If you customize any item on a certain level, you must also customize the first
5585
</variable>
5686
</include>
5787

88+
<include src="codeAndOutput.md" boilerplate >
89+
<variable name="highlightStyle">markdown</variable>
90+
<variable name="code">
91+
92+
* Item 1 { text="Step 1" t-size="35px" }
93+
* Item 2 { text="Step 2" t-size="4rem" }
94+
* Item 3 { text="Step 3" t-size="5em" }
95+
96+
</variable>
97+
</include>
98+
5899
You can utilize any [CSS size unit](https://www.w3schools.com/cssref/css_units.php).
59100

60101
**You can also use images as icons.**
@@ -72,19 +113,19 @@ You can utilize any [CSS size unit](https://www.w3schools.com/cssref/css_units.p
72113

73114
If either the `i-width` or the `i-height` of an image is not specified, the unspecified dimension will adjust to maintain the image's original aspect ratio. For example, for an image of size 800x600 (4:3), if `i-width` is set to 400px, its height will be 300px.
74115

75-
**The icon's appearance can be further customized by adding a `i-class` attribute.**
116+
**The icon and text's appearance can be further customized by adding a `i-class` and `t-class` attribute respectively.**
76117

77118
<div id="main-example-markbind">
78119

79120
<include src="codeAndOutput.md" boilerplate >
80121
<variable name="highlightStyle">markdown</variable>
81122
<variable name="code">
82-
* Item 1 { icon="/images/deer.jpg" i-width="60px" height="17px" i-class="rounded" }
83-
* Item 2
123+
* Item 1 { icon="/images/deer.jpg" text="Deer" i-width="60px" height="17px" i-class="rounded" t-class="text-warning my-2" }
124+
* Item 2 { t-class="text-info my-2" }
84125
* Item 2.1 { icon="fas-question-circle" i-class="badge rounded-pill my-1 bg-success text-white" }
85126
* Item 2.2
86127
* Item 2.3 { i-class="badge rounded-pill my-1 bg-primary text-white"}
87-
* Item 3
128+
* Item 3 { t-class="text-primary my-2" }
88129
* Item 3.1
89130
* Item 3.2 { icon="fas-question-circle" i-class="badge rounded my-1 bg-danger text-white" }
90131
* Item 3.3
@@ -104,9 +145,22 @@ If either the `i-width` or the `i-height` of an image is not specified, the unsp
104145

105146
<box type=tip seamless>
106147

107-
Similar to the `icon` attribute, other icon attributes such as `i-class`, `i-width`, `i-height`, `i-spacing` apply for subsequent list items at the same level, until they are overridden by the same attribute. For example, Item 2.3's `i-class` overrides Item 2.1's and applies up to Item 3.1.
148+
Similar to the `icon` and `text` attribute, other icon attributes such as `i-class`, `i-width`, `i-height`, `i-spacing`, `t-size` and `t-class` apply for subsequent list items at the same level, until they are overridden by the same attribute. For example, Item 2.3's `i-class` overrides Item 2.1's and applies up to Item 3.1.
149+
108150
</box>
109151

152+
**The spacing between the icon and the content can be customized by using a `i-spacing` attribute.**
153+
154+
<include src="codeAndOutput.md" boilerplate >
155+
<variable name="highlightStyle">markdown</variable>
156+
<variable name="code">
157+
* Item 1 { icon="+1" text="Yay" }
158+
* Item 2 { i-spacing="1rem" }
159+
* Item 3 { i-spacing="2rem" }
160+
</variable>
161+
</include>
162+
163+
110164
</div>
111165

112166
**You can apply Markdown's heading and paragraph syntax within the list.**

0 commit comments

Comments
 (0)