holidaypirates / nucleus

Nucleus is a living style guide generator for atomic css based components. It's a Node application parsing the source SCSS files and reading information from DocBlock annotations.
https://holidaypirates.github.io/nucleus/
MIT License
474 stars 43 forks source link

Added substitution 'template' to allow importing of markup from external .html files #62

Closed gotofritz closed 2 years ago

gotofritz commented 7 years ago

As discussed here, having to copy and paste html from other documents into a comment in an scss file really inconvenient. With this PR, you can use the @{template: /pth/to/file} substition.

Path can either be absolute paths, relative to where nucleus is running, or you can set a templatePath variable in the config and it will be prepended to all paths in the substitution.

It would be even better if we could leave the argument empty, and have a templateSuffix property in the config, and then nucleus would automatically find a file of the same name as the one being processed:

 // file: navigation.css
 /**
  * blah blah
  *   @{template: }
  */

 // config.nucleus.js
 { 
    templatePath: "src/styleguide/templates/"
    templateSuffix:  ".html"
 }

// -> nucleus automatically tries to fetch src/styleguide/templates/navigation.html

But if I understand correctly, Substitute doesn't know the name of the file it is processing.

Still, this is a step forward and should save lots of time

gotofritz commented 7 years ago

"All checks have failed"

This looks like the same error as the other pull request that has been sitting there for about a month. It looks like Travis is not set up correctly, and there's nobody at hand to fix it.

I hope the project's not being abandoned...

pkkummermo commented 7 years ago

Hopefully not, and this PR looks like great functionality to be added to Nucleus. Perhaps @michaelseibt could shed some light on where this project is going?