From c05d8756f70f6a0134e54777402c385e8772a7f4 Mon Sep 17 00:00:00 2001 From: Ze Yu Date: Sun, 3 May 2020 09:01:52 +0800 Subject: [PATCH] Update user guide with {% raw %} syntax --- docs/_markbind/variables.md | 6 ------ docs/userGuide/markBindSyntaxOverview.md | 16 +++++++++------- docs/userGuide/syntax/icons.mbdf | 5 +++-- docs/userGuide/syntax/includes.mbdf | 10 ++++++---- docs/userGuide/syntax/links.mbdf | 13 ++++++++----- docs/userGuide/syntax/pageLayouts.mbdf | 12 +++--------- docs/userGuide/usingPlugins.md | 3 ++- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/docs/_markbind/variables.md b/docs/_markbind/variables.md index 2dfa5f3779..8e18f53a0c 100644 --- a/docs/_markbind/variables.md +++ b/docs/_markbind/variables.md @@ -1,9 +1,3 @@ - -{{ baseUrl }} - - -{{ baseUrl }} - #00B0F0 :fas-arrow-down: diff --git a/docs/userGuide/markBindSyntaxOverview.md b/docs/userGuide/markBindSyntaxOverview.md index 91049262b7..6f390a4f86 100644 --- a/docs/userGuide/markBindSyntaxOverview.md +++ b/docs/userGuide/markBindSyntaxOverview.md @@ -99,13 +99,15 @@ As MarkBind uses [VueStrap](https://bootstrap-vue.js.org/docs/components/alert/) [Nunjucks](https://mozilla.github.io/nunjucks/) is a JavaScript based templating tool. Here is a simple example: - -`
    `
    -{% for item in [1, 2, 3, 4] %}
    -  `
  • `Item {{ item }}`
  • `
    -{% endfor %}
    -`
` -
+{% raw %} +```html { .no-line-numbers } + +``` +{% endraw %} {{ icon_arrow_down }} diff --git a/docs/userGuide/syntax/icons.mbdf b/docs/userGuide/syntax/icons.mbdf index a5f7345d1b..16f663cdbd 100644 --- a/docs/userGuide/syntax/icons.mbdf +++ b/docs/userGuide/syntax/icons.mbdf @@ -13,8 +13,9 @@ The advantage of font icons over emojis is font icons can be _styled_ to fit you -The syntax for icons has changed, and the earlier {{ prefix_name }} syntax has been deprecated.
-Please use the new :prefix-name: syntax instead. + +The syntax for icons has changed, and the earlier {%raw%}`{{ prefix_name }}`{%endraw%} syntax has been deprecated.
+Please use the new `:prefix-name:` syntax instead.
###### Using Font Awesome Icons diff --git a/docs/userGuide/syntax/includes.mbdf b/docs/userGuide/syntax/includes.mbdf index 57d83f366d..19eacaa690 100644 --- a/docs/userGuide/syntax/includes.mbdf +++ b/docs/userGuide/syntax/includes.mbdf @@ -130,10 +130,12 @@ In other words, **`` interprets the reused code relative to the origina In `article.md`: - -# {{ title }}
-Author: {{ author }} -
+{% raw %} +```html +# {{ title }}
+Author: {{ author }} +``` +{% endraw %} These variables work the same way as variables in `_markbind/variables.md`, except that they only apply to the included file. They allow the included file to be reused as a template, for different source files using different variable values. diff --git a/docs/userGuide/syntax/links.mbdf b/docs/userGuide/syntax/links.mbdf index 69eff564c0..fc4dfb7275 100644 --- a/docs/userGuide/syntax/links.mbdf +++ b/docs/userGuide/syntax/links.mbdf @@ -32,16 +32,19 @@ Links to files of the generated site (e.g., an HTML page or an image file) can b Absolute paths:
-Links should start with {{ showBaseUrlCode }} (which represents the root directory of the project). -{{ icon_example }} Here's how to specify a link to (1) a page, and (2) an image, using the {{ showBaseUrlCode }}: +Links should start with {% raw %}`{{ baseUrl }}`{% endraw %} (which represents the root directory of the project). -1. Click [here]({{ showBaseUrlCode }}/userGuide/reusingContents.html). -2. `![](`{{ showBaseUrlCode }}`/images/preview.png)` +{{ icon_example }} Here's how to specify a link to (1) a page, and (2) an image, using the {% raw %}`{{ baseUrl }}`: + +1. `Click [here]({{ baseUrl }}/userGuide/reusingContents.html).` +2. `![]({{ baseUrl }}/images/preview.png)` -To ensure that links in the _markbind/ folder work correctly across the entire site, they should be written as absolute paths, prepended with {{ baseUrl }}. + +To ensure that links in the _markbind/ folder work correctly across the entire site, they should be written as absolute paths, prepended with `{{ baseUrl }}`. +{% endraw %}
Relative paths: diff --git a/docs/userGuide/syntax/pageLayouts.mbdf b/docs/userGuide/syntax/pageLayouts.mbdf index f5fe9e24d5..7ff35b39fe 100644 --- a/docs/userGuide/syntax/pageLayouts.mbdf +++ b/docs/userGuide/syntax/pageLayouts.mbdf @@ -1,10 +1,3 @@ - - -{{ MAIN_CONTENT_BODY }} - - ## Page Layouts **A _layout_ is a set of page-tweaks that can be applied to a page (or group of pages) in one go.** @@ -110,7 +103,8 @@ afterSetup(() => { In the `page.md` file of your layouts, it should come with the following reserved variable: - {{ mainContentBody }} + + {%raw%}`{{ MAIN_CONTENT_BODY }}`{%endraw%} which injects the actual page content in every page. This allows you to build layouts in different ways. @@ -124,7 +118,7 @@ which injects the actual page content in every page. This allows you to build la ``` ```html {heading="page.md"} - {{ mainContentBody }} + {%raw%}{{ MAIN_CONTENT_BODY }}{%endraw%} diff --git a/docs/userGuide/usingPlugins.md b/docs/userGuide/usingPlugins.md index a825b84c65..4745bcb2e3 100644 --- a/docs/userGuide/usingPlugins.md +++ b/docs/userGuide/usingPlugins.md @@ -200,7 +200,8 @@ removing such potential conflicts. - Should return an array of string tag names to be blacklisted, with each tag name being at least 2 characters long. -Note however, that variable interpolation syntax {{ variable_name }} will act as per normal. + +Note however, that variable interpolation syntax {% raw %}`{{ variable_name }}`{% endraw %} will act as per normal. Meaning, the user would still be able to use variables in your special tags!