Demo HomepageAPI DocsLicenseSource Code

Functions

createMultipleMarkdownSection(markdownFileSources, extras)

Creates a section of a page from multiple markdown files, and adds the passed css selectors for inserting layout customization.

Example markdown source files:

// ./sourceDir/file1.md
# First Markdown Title Content
// ./sourceDir/file2.md
# Second Markdown Title Content

Example usage:

export const config: ScullyConfig = {
  // ...
  routes: {
    '/path': {
      type: MultiMarkdownPageBuilderPlugin,
      sectionBuilders: [
        createMultipleMarkdownSection(['./sourceDir/file1.md', './sourceDir/file2.md'], { containerDivId: 'gridContainer', elementsDivClass: 'grid-item' })
      ]
    }
  }
};

Example output:

<div id="gridContainer">
 <div id="element1" class="grid-item">
     <h1>First Markdown Title Content</h1>
 </div>
 <div id="element2" class="grid-item">
     <h1>Second Markdown Title Content</h1>
 </div>
</div>
createSingleMarkdownSection(markdownFileSource, extras)

Creates a section of a page from a single markdown file, and adds the passed css selectors for inserting layout customization.

Example markdown source file:

# Markdown Title Content

Example usage:

export const config: ScullyConfig = {
  // ...
  routes: {
    '/path': {
      type: MultiMarkdownPageBuilderPlugin,
      sectionBuilders: [
        createSingleMarkdownSection('./homepage/installation.md', { containerDivId: 'installationContainer', elementDivId: 'installationItem' }),
      ]
    }
  }
};

Example output:

<div id="installationContainer">
 <div id="installationItem">
     <h1>Markdown Title Content</h1>
 </div>
</div>

createMultipleMarkdownSection(markdownFileSources, extras) ⇒

Creates a section of a page from multiple markdown files, and adds the passed css selectors for inserting layout customization.

Example markdown source files:

// ./sourceDir/file1.md
# First Markdown Title Content
// ./sourceDir/file2.md
# Second Markdown Title Content

Example usage:

export const config: ScullyConfig = {
  // ...
  routes: {
    '/path': {
      type: MultiMarkdownPageBuilderPlugin,
      sectionBuilders: [
        createMultipleMarkdownSection(['./sourceDir/file1.md', './sourceDir/file2.md'], { containerDivId: 'gridContainer', elementsDivClass: 'grid-item' })
      ]
    }
  }
};

Example output:

<div id="gridContainer">
 <div id="element1" class="grid-item">
     <h1>First Markdown Title Content</h1>
 </div>
 <div id="element2" class="grid-item">
     <h1>Second Markdown Title Content</h1>
 </div>
</div>

Kind: global function
Returns:

A MarkdownSectionBuilder that will be used by the plugin to create the single markdown section.

Param Type Description
markdownFileSources Array.<string>

source of the markdown files to be converted into HTML, then passed into the sectionBuilder

extras SingleMarkdownSectionBuilderExtras

The containerIdAttribute will be attached as the id attribute value for the container div. The elementsDivClass will be attached as the class attribute value for the interior element div. Passing null for either will omit the selector.

createSingleMarkdownSection(markdownFileSource, extras) ⇒

Creates a section of a page from a single markdown file, and adds the passed css selectors for inserting layout customization.

Example markdown source file:

# Markdown Title Content

Example usage:

export const config: ScullyConfig = {
  // ...
  routes: {
    '/path': {
      type: MultiMarkdownPageBuilderPlugin,
      sectionBuilders: [
        createSingleMarkdownSection('./homepage/installation.md', { containerDivId: 'installationContainer', elementDivId: 'installationItem' }),
      ]
    }
  }
};

Example output:

<div id="installationContainer">
 <div id="installationItem">
     <h1>Markdown Title Content</h1>
 </div>
</div>

Kind: global function
Returns:

A MarkdownSectionBuilder that will be used by the plugin to create the single markdown section.

Param Type Description
markdownFileSource string

source of the markdown file to be converted into HTML, then passed into the sectionBuilder

extras SingleMarkdownSectionBuilderExtras

The containerIdAttribute will be attached as the id attribute value for the container div. The elementIdAttribute will be attached as the id attribute value for the interior element div. Passing null for either will omit the selector.