Skip to content

Commit

Permalink
Remove .mbdf and .mbd as markbind supported file extensions (#1762)
Browse files Browse the repository at this point in the history
Syntax parsers do not work with `.mbdf` and `.mbd` and
this functionality could be implemented using other means (e.g. pagesExclude)

Refer to this for the full discussion #1672.
  • Loading branch information
ong6 authored Feb 16, 2022
1 parent 3e0165a commit 0554eda
Show file tree
Hide file tree
Showing 113 changed files with 169 additions and 218 deletions.
4 changes: 2 additions & 2 deletions docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<include src="headers/header.mbdf" />
<include src="headers/header.md" />

<div id="flex-body">
<div id="content-wrapper" class="fixed-header-padding">
{{ content }}
</div>
</div>

<include src="footers/footer.mbdf" />
<include src="footers/footer.md" />
4 changes: 2 additions & 2 deletions docs/_markbind/layouts/devGuide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<include src="headers/header.mbdf" />
<include src="headers/header.md" />

<div id="flex-body">
<nav id="site-nav" class="fixed-header-padding">
Expand Down Expand Up @@ -31,4 +31,4 @@
</nav>
</div>

<include src="footers/footer.mbdf" />
<include src="footers/footer.md" />
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/_markbind/layouts/userGuide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<include src="headers/header.mbdf" />
<include src="headers/header.md" />

<div id="flex-body">
<nav id="site-nav" class="fixed-header-padding">
Expand Down Expand Up @@ -52,4 +52,4 @@
</nav>
</div>

<include src="footers/footer.mbdf" />
<include src="footers/footer.md" />
2 changes: 1 addition & 1 deletion docs/devGuide/design/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This page provides an overview of the MarkBind's architecture.

![MarkBind Architecture Diagram](<{{baseUrl}}/images/dev diagrams/architecture.png>)

The above diagram shows the key classes and <popover content="The content processing flow acts on a **single** source file (`.md` / `.mbd` / `.html`), generating output files or intermediate processing results depending on the content type.">content processing flow</popover> in MarkBind. You may note the following from these:
The above diagram shows the key classes and <popover content="The content processing flow acts on a **single** source file (`.md` / `.html`), generating output files or intermediate processing results depending on the content type.">content processing flow</popover> in MarkBind. You may note the following from these:

### Key classes

Expand Down
4 changes: 1 addition & 3 deletions docs/dg-site.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"pages": [
{
"glob": ["**/*.mbd", "*.md", "devGuide/*.md", "devGuide/*/*.md"]
"glob": ["*.md", "devGuide/*.md", "devGuide/*/*.md"]
},
{
"src": "index.md",
Expand All @@ -20,8 +20,6 @@
"lib/*",
"*.json",
"*.md",
"*.mbd",
"*.mbdf",
"*.njk",
".git/*",
"*.pptx",
Expand Down
4 changes: 1 addition & 3 deletions docs/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"pages": [
{
"glob": ["**/*.mbd", "*.md", "userGuide/*.md", "userGuide/components/*.md", "devGuide/*.md", "devGuide/*/*.md"]
"glob": ["*.md", "userGuide/*.md", "userGuide/components/*.md", "devGuide/*.md", "devGuide/*/*.md"]
},
{
"src": [
Expand All @@ -34,8 +34,6 @@
"lib/*",
"*.json",
"*.md",
"*.mbd",
"*.mbdf",
"*.njk",
".git/*",
"*.pptx",
Expand Down
4 changes: 1 addition & 3 deletions docs/ug-site.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"pages": [
{
"glob": ["**/*.mbd", "*.md", "userGuide/*.md", "userGuide/components/*.md"]
"glob": ["*.md", "userGuide/*.md", "userGuide/components/*.md"]
},
{
"src": [
Expand All @@ -33,8 +33,6 @@
"lib/*",
"*.json",
"*.md",
"*.mbd",
"*.mbdf",
"*.njk",
".git/*",
"*.pptx"
Expand Down
8 changes: 4 additions & 4 deletions docs/userGuide/addingPages.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

%%You can specify which files to be omitted from the site by using the `ignore` field in the `site.config` file as explained [here](siteJsonFile.html#ignore).%%

**More importantly, `.md` and `.mbd` files can be transformed into html pages with matching names.**
**More importantly, `.md` files can be transformed into html pages with matching names.**

<div class="indented">

Expand All @@ -37,9 +37,9 @@
</div>

Here are the steps to add a new page to your site:
1. Add a `.md` (or `.mbd`) file anywhere inside the root directory.
1. Update the [`pages` attribute of the `site.json`](siteJsonFile.html#pages) to cover the new file, if necessary.
1. Use the <trigger trigger="click" for="modal:addingPages-livePreview">live preview</trigger> to view the generated web page for the new file.
1. Add a `.md` file anywhere inside the root directory.
2. Update the [`pages` attribute of the `site.json`](siteJsonFile.html#pages) to cover the new file, if necessary.
3. Use the <trigger trigger="click" for="modal:addingPages-livePreview">live preview</trigger> to view the generated web page for the new file.

<modal large header="Live Preview" id="modal:addingPages-livePreview">
<include src="glossary.md#live-preview" inline/>
Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/cliCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Usage: markbind <command>
**Options** :fas-cogs:

* `-o <file>`, `--one-page <file>`<br>
Serves only a single page from your website **initially**. If `<file>` is not specified, it defaults to `index.md/mbd`.<br>
Serves only a single page from your website **initially**. If `<file>` is not specified, it defaults to `index.md`.<br>
* Thereafter, when changes to source files have been made, the opened pages will be rebuilt if it was affected.<br>
* Navigating to a new page will build the new page, if it has not been built before, or there were some changes to source files that affected it before navigating to it.<br>
* {{ icon_example }} `--one-page guide/index.md`
Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/components/imagesAndDiagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Diagrams, in the form of **inline PlantUML components** are also supported.
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="../syntax/{{ filename }}.mbdf" />
<include src="../syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/components/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The components in this page are used for scaffolding **site and page navigation*
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="../syntax/{{ filename }}.mbdf" />
<include src="../syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/components/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This page lists some other components that may be useful in creating education w
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="../syntax/{{ filename }}.mbdf" />
<include src="../syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/components/popups.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The components in this page can be used to easily create **various forms of pop-
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="../syntax/{{ filename }}.mbdf" />
<include src="../syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/components/presentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The components in this page are the core **presentational** components you may w
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="../syntax/{{ filename }}.mbdf" />
<include src="../syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/formattingContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% from "userGuide/fullSyntaxReference.md" import syntax_topics as topics %}

{% macro show_topic(filename) %}
<include src="./syntax/{{ filename }}.mbdf" />
<include src="./syntax/{{ filename }}.md" />
<hr>
{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion docs/userGuide/fullSyntaxReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@

{% for topic in syntax_topics | dictsort %}
<panel type="seamless" header="###### **{{ topic[1][0] }}**">
<include src="syntax/{{ topic[0] }}.mbdf" />
<include src="syntax/{{ topic[0] }}.md" />
</panel>
{% endfor %}
13 changes: 1 addition & 12 deletions docs/userGuide/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<span id="live-preview">

**_Live preview_** is:
- Regeneration of affected content upon any change to <tooltip content="`.md`, `.mbd`, `.mbdf`, `.njk` files ... anything your content depends on!">source files</tooltip>, then reloading the updated site in the Browser.
- Regeneration of affected content upon any change to <tooltip content="`.md`, `.njk` files ... anything your content depends on!">source files</tooltip>, then reloading the updated site in the Browser.

- Regeneration will also occur upon any modification to attributes in `site.json` with the exception of [`baseUrl`](siteJsonFile.md#baseurl).

Expand All @@ -17,14 +17,3 @@
Use [the `serve` command](cliCommands.html#serve-command) to launch a live preview.

</span>

<br>

#### `.mbd` extension

<span id="mbd-extension">
<md>**`.mbd` extension indicates a MarkBind source file**.</md>

MarkBind is able to take Markdown files (`.md`) and HTML files (`.html`) as source files too.
</span>

8 changes: 4 additions & 4 deletions docs/userGuide/makingTheSiteSearchable.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ If you do not wish to use MarkBind's searchbar (e.g. you have an external servic

You can add a search bar component to your website to allow users to search the site.

{{ embed("Using components → **Search bars**", "syntax/searchBars.mbdf#body") }}
{{ embed("Using components → **Search bars**", "syntax/searchBars.md#body") }}
<p/>
<include src="syntax/keywords.mbdf" />
<include src="syntax/indexing.mbdf" />
<include src="syntax/keywords.md" />
<include src="syntax/indexing.md" />

## Using External Search Services

MarkBind sites can use Algolia Doc Search services easily via the Algolia plugin. Unlike the built-in search, Algolia provides full-text search. See the panel below for more info.

{{ embed("Using plugins → **Algolia**", "plugins/algolia.mbdf") }}
{{ embed("Using plugins → **Algolia**", "plugins/algolia.md") }}

{% from "njk/common.njk" import previous_next %}
{{ previous_next('usingPlugins', 'themes') }}
20 changes: 10 additions & 10 deletions docs/userGuide/markBindSyntaxOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Given below is an overview of the syntax schemes supported by MarkBind.
MarkBind supports all basic Markdown syntax.

<panel type="seamless" header="Some examples ...">
<include src="syntax/headings.mbdf#main-example" />
<include src="syntax/textStyles.mbdf#main-example-markdown" />
<include src="syntax/links.mbdf#main-example" />
<include src="syntax/headings.md#main-example" />
<include src="syntax/textStyles.md#main-example-markdown" />
<include src="syntax/links.md#main-example" />
</panel>

<!-- ======================================================================================================= -->
Expand All @@ -43,9 +43,9 @@ MarkBind supports all basic Markdown syntax.
MarkBind supports additional Markdown features provided by Github-Flavored Markdown (GFMD).

<panel type="seamless" header="Some examples ...">
<include src="syntax/code.mbdf#main-example" />
<include src="syntax/lists.mbdf#main-example-gfmd" />
<include src="syntax/emoji.mbdf#main-example" />
<include src="syntax/code.md#main-example" />
<include src="syntax/lists.md#main-example-gfmd" />
<include src="syntax/emoji.md#main-example" />
</panel>


Expand All @@ -56,9 +56,9 @@ MarkBind supports additional Markdown features provided by Github-Flavored Markd
MarkBind adds several Markdown-like features on top of GFMD.

<panel type="seamless" header="Some examples ...">
<include src="syntax/textStyles.mbdf#main-example-markbind" />
<include src="syntax/lists.mbdf#main-example-markbind" />
<include src="syntax/footnotes.mbdf#main-example-markbind" />
<include src="syntax/textStyles.md#main-example-markbind" />
<include src="syntax/lists.md#main-example-markbind" />
<include src="syntax/footnotes.md#main-example-markbind" />
</panel>

<!-- ======================================================================================================= -->
Expand All @@ -78,7 +78,7 @@ More info: <include src="{{ filename }}#link" inline trim/>
<br>
{% endmacro %}

{% for filename in ['syntax/variables.mbdf', 'syntax/includes.mbdf', 'usingComponents.md'] %}
{% for filename in ['syntax/variables.md', 'syntax/includes.md', 'usingComponents.md'] %}
{{ quote_topic(filename) }}
{% endfor %}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/userGuide/readerFacingFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

##### {{ heading }}
<box>
<include src="syntax/{{ filename }}.mbdf#examples" />
<include src="syntax/{{ filename }}.md#examples" />

<panel type="seamless" header="%%details...%%" >

<include src="syntax/{{ filename }}.mbdf" />
<include src="syntax/{{ filename }}.md" />
</panel>
</box>

Expand Down
68 changes: 64 additions & 4 deletions docs/userGuide/reusingContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
</span>


<include src="syntax/variables.mbdf" />
<include src="syntax/variables.md" />

<hr><!-- ======================================================================================================= -->

<include src="syntax/includes.mbdf" />
<include src="syntax/includes.md" />

<hr><!-- ======================================================================================================= -->

## Reusing Contents Across Sites

**MarkBind supports reusing across sites.** It allows you to include the pages you want from a _sub-site_ in another _main-site_ without having to change anything in the source files of the _sub-site_ as long as the sub-site source files are inside the directory of the _main site_.
**MarkBind supports reusing across sites.** It allows you to include the pages you want from a _sub-site_ in another _main-site_ without having to change anything in the source files of the _sub-site_ as long as the _sub-site_ source files are inside the directory of the _main-site_.

<div class="indented">

Expand All @@ -46,7 +46,7 @@ C:/course/
└── site.json
```

`reading.md` (note how it reuses content from the sub-site `textbook`):
In `reading.md` (note how it reuses content from the sub-site `textbook`):
```markdown
# Week 1 Reading:
<include src="textbook/overview.md" />
Expand All @@ -60,6 +60,66 @@ If you are using Git for version control, you can set up the sub-site repository
</include>


<hr><!-- ======================================================================================================= -->

## Creating Custom Fragments

**MarkBind supports creating custom fragments**. A fragment is a piece of content that can be reused across multiple pages. This allows you to create reusable content similar to [reusing content](#reusing-contents-across-sites), but rather than reusing content from a _sub-site_, content is reused from fragments which can be excluded from page generation.

<box type="warning">
Note: This example below is assuming that you have included the following glob pattern in the `site.json` file:

```js
{
"pages": [
{
"glob": "*.md",
"layout": "normal",
"searchable": "yes"
}
],
}
```

Else, if each page is included individually, there is no need to exclude the fragments as they will not be included in the page generation.
</box>


{{ icon_example }} Suppose you have a fragment file `content-fragment.md` and you want to include it in some pages of the site `course` without rendering `content-fragment.md` as a page.

```
C:/course/
├── content-fragment.md
├── index.md
├── reading.md
└── site.json
```

In `reading.md` (note how it reuses content from the `content-fragment.md`):
```markdown
# Week 1 Reading:
<include src="content-fragment.md" />
```

In `site.json` we then exclude the fragment from the page generation:

```json
...
"pagesExclude": [
"**/*-fragment.md"
],
...
```
</div>

</div>

<include src="tip.md" boilerplate >
<span id="tip_body">
You may use any custom name you wish for your fragments but be sure to update the `pagesExclude` list with the appropriate glob pattern.
</span>
</include>

<hr><!-- ======================================================================================================= -->

## Creating Content Variations
Expand Down
Loading

0 comments on commit 0554eda

Please sign in to comment.