Issue compiling with @doc tag
Closed this issue · 4 comments
First off, great project. Everything has been working great so far, with the one exception that we just ran across.
What we're trying to do is include a markdown file for non-developers to maintain, while leaving the scss files to our devs.
Version
gulp-livingcss@2.2.0
livingcss@4.4.0
Example
File structure
┬ dist
└- compiled.css
┬ src
└┬ atoms
├- button.md
└- button.scss
┬ docs
├- atoms.html
├- molecules.html
└- ...
button.scss
/**
* @doc button.md
*
* @example
* <button class="our-button">Button</button>
*
* @section Button
* @page Atoms
*/
.our-button { ... }
button.md
# Button
Description blah blah blah
gulpfile.js
gulp.task('guide:build', () => {
const sourceFiles = './dist/*.css';
const destination = './docs';
gulp.src(sourceFiles)
.pipe(livingcss(destination))
.pipe(gulp.dest(destination));
});
When running the guide:build
task, the following pops up in the console and no new HTML is generated:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
If we exclude the @doc button.md
line from button.scss, the task works perfectly.
Is this functionality supported? Is there something wrong with our configuration?
Edit: Expanded on file structure; Simplified gulp task
Thanks for the compliments. Glad you have been enjoying the project.
@doc
should be supported, so the error is definitely a problem. I'll take a look into this later tonight and see if I can find the issue. Thanks for reporting on it.
Unfortunately, I didn't see a stack trace in the console. Only this (unhelpful) line:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
The only difference I see between your output and ours is that we don't have a real "index" page, since we don't want it to show up in the navigation. Our index.html was manually created and redirects to atoms.html. Any chance that would cause an issue?
I think I figured out what was going on. It looks like tags.js is blowing up when it tries to read the markdown file because it's looking in the "wrong" location.
It's trying to read ./dist/button.md
rather than ./src/atoms/button.md
. Probably because I'm building the ./dist/compiled.css
before running livingcss, so the path is relative to ./dist
rather than ./src
.
I'll take a look at #5, hopefully the solution is in there somewhere. Closing for now, thanks!