sourcejs / Source

[ON HOLD] Living Style Guides Engine and Maintenance Environment for Front-end Components. Core repository.

Home Page:http://sourcejs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

includeFiles doesn't seem to work

adesca opened this issue · comments

In a test readme file I'm trying to include both a markdown file, that only has html, and a .partial file that contains the same content as the markdown files. These files are attached as table.txt.

When a markdown include and a file include are both in the same readme, the EJS parser seems to have trouble and doesn't include either file. When only Markdown files are included the files are included fine. When I attempt to include any file with a globstar, then the files are not included.

Thanks, I'll see what I can find out.

Hi,

I've done few tests in 0.6.0-dev branch, and looks like both EJS helpers are working fine (includeFiles and includeMD). Please make sure that if you use includeMD, that you're specifically call *.md files, otherwise use includeFiles, for situations when you need to import files with markup. Here's the documentation for those methods https://sourcejs.com/docs/spec-helpers/.

Glob should also work, I've tested in this setup:

<%- includeFiles('./partial*.txt'); %>

Where next to main readme.md file which includes this import, I have partial1.txt and partial2.txt.

When you see that something is not working in the development mode, please check the console for errors, that may lead you to the solution.