Open raphaelgoetter opened 10 years ago
This sounds like an awesome idea. I'll try to spend some time today integrating LESS, SASS and plain CSS.
It's done. Now Techy supports plain CSS, LESS, SASS and AbsurdJS. The full documentation about this change could be found here http://krasimir.github.io/techy/docs/#css
Shortly: you have to add Techy.js
file in the main project's directory with something like that:
module.exports = function() {
return {
css: {
preprocessor: 'sass',
index: 'sass/*.scss'
}
}
}
The compiled file goes to the public
directory of the used theme.
I'll recommend checking the test cases: Absurd, SASS, LESS, Plain CSS.
P.S. The latest version of Techy that you should have to use the above is 0.0.21.
Wow, that was fast. Thank You !
You are welcome.
After my Techy update, I still don't manage to compile plain CSS.
Here's what I did :
1- created a Techy.js file in my /themes/default with this content :
module.exports = function() {
return {
css: {
preprocessor: 'none',
index: 'css/styles.css'
}
}
}
2- changed css/styles.js to css/styles.css with plain CSS
3- lanched a techy
: everything seems OK but no styles.css is compiled in my public folder.
What did I miss ?
The Techy.js
file should be placed in the main project's folder. I.e. the place where you run the techy
command. For example:
project
themes
default
css
a.css
b.css
js
public
styles.css
tpl
Techy.js
page.md
If you use the above file structure then the content of the Techy.js
should be:
module.exports = function() {
return {
css: {
preprocessor: 'none',
index: 'themes/default/css/*.css'
}
}
}
themes/default/public/styles.css
contains the CSS styles from a.css
and b.css
.
Let me know if that doesn't work.
Well, each time I place Techy.js directly in my main project folder, something weird happens : when I run the techy
command, ... it opens the Techy.js file in my sublime text editor and doesn't lanch the techy app ! :/
Ha ... this is strange.Ok, let me provide another possible name for the file. It looks like that it is not a good idea to be with the same name as the command.
Ok. Can you please update the Techy version. It should be the latest 0.0.22.
Now instead of Techy.js
you could use TechyFile.js
.
Hi.
It works now with the new config file name.
But the "watch" funtion seems not not to work : even if "Techy is listening for changes", the /css/styles.css compiles only when I do a techy
command; it's not automatic when I change the CSS
Good catch, thanks. It's because by default Techy is listening for .js
files to fire CSS compilation. I'll add the glob pattern used in the TechyFile.js
to the Gulp's watch method. Will do that probably in the next hour.
By the way if you plan to use Techy you may be interested in this http://krasimir.github.io/techy/docs/#using-yaml-front-matter
A new version 0.0.25 is released. It contains the fix for the missing watch.
And works ! Thank you :)
Oh euh now it's my .md pages (in project folder - or anywhere else) that seems not watched anymore (not automatically compiled in html)
Can you please let me know your file structure. If possible send me your files to info(at)krasimirtsonev.com. The following code is responsible for watching .md
files and it should work.
gulp.watch([root + '/**/*.md'], function(event) {
this.compilePage(event.path);
}.bind(this));
P.S. what is your OS?
By the way, there is a problem of Gulp's watcher. Once it is started it doesn't recognize the newly created files. I.e. when you start Techy and you add a new file it is not watched for changes. You need to restart the Techy. Or that's how it works under Windows7.
I read a bit and found this https://github.com/gulpjs/gulp/issues/269 It looks that we are all waiting for an update of Gulp in order to make the watcher sees new files.
OK, let's wait then :)
BTW my OS is Win8.1
Thannks. Actually, are your markdowns properly watched if they are not created after the Techy's launch. I mean those which are on the disk when run the command.
Yes they are (in every folders) :)
Confirmed on windows 7 (32 bit) as well. .css
files are properly watched and concatenated, .md
files too.
Only .md
files that were created after running the techy command are not picked up by the watch task. For that I too have to run the command again.
Hi,
I'm trying Techy and I wish not to use AbsurdJS for my CSS : I jus't liked to use classic CSS or LESS/Sass CSS.
But it seem that Techy only compiles .js CSS files, is it ?
Would it be possible to compile .css or even .less or .scss ?
Have a nice day,
Raphaël