Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generalize content processing with markdown as default (implements #4) #7

Closed

Conversation

jrehwaldt
Copy link
Contributor

Allow multiple content processors using marked as default processor for *.md files (compat behaviour). Implements #4.

Processors can be defined in the configuration as follows:

{
  contentProcessors: {
    '*.md': function(content, page) { return marked(content); },
    '*': function(content, page) { return emoji(content); },
  }
}

Object keys are globs matched against the page's id (i.e., including relative path) using minimatch with the options { nocase: true, matchBase: true }. Processor order is preserved, such that multiple matching processors are applied in the order defined.

Also adds tests for non-markdown file processing and aggregation based off the example structure.

Finally, the method Kartoffeldruck.isMarkdown is removed from the +public+ API.

…rked as default processor for *.md files (compat behaviour). Implements nikku#4.

Processors can be defined in the configuration as follows:
```
{
  contentProcessors: {
    '*.md': function(content, page) { return marked(content); },
    '*': function(content, page) { return emoji(content); },
  }
}
```

Object keys are globs matched against the page's id (i.e., including relative path) using minimatch with the options `{ nocase: true, matchBase: true }`. Processor order is preserved, such that multiple matching processors are applied in the order defined.

Also adds tests for non-markdown file processing and aggregation based off the example structure.

Finally, the method `Kartoffeldruck.isMarkdown` is removed from the +public+ API.
@nikku
Copy link
Owner

nikku commented Nov 11, 2017

Merged via f89d412.

@nikku nikku closed this Nov 11, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants