GithubHelp home page GithubHelp logo

Separate the gulp plugin about techy HOT 7 OPEN

dangoor avatar dangoor commented on May 20, 2024
Separate the gulp plugin

from techy.

Comments (7)

krasimir avatar krasimir commented on May 20, 2024

You are right. gulp-sass and gulp-less are required only if you need to use another CSS preprocessor. However, there are part of Techy's features list and we have to be careful by removing them. I'm thinking about moving gulp-sass and gulp-less out of the dependencies' list and if someone want to use them will promp a message saying that they should be added to the package.json file.

from techy.

dangoor avatar dangoor commented on May 20, 2024

I may dig in to the code and make a more specific proposal (or possibly a pull request). I really like the way Techy feels as a Gulp plugin, and I think there's another step to take there, but I'm not 100% clear on it yet.

from techy.

krasimir avatar krasimir commented on May 20, 2024

Yep, it looks like using Techy as gulp plugin is better then the Techy's CLI. I'll spend some time concepting.

from techy.

dangoor avatar dangoor commented on May 20, 2024

One problem that I encountered while playing with Techy last night was that my files were named *.markdown, whereas Techy was expecting *.md. It was no big deal for me to rename my files, but another way to look at it is that in standard Gulp style, I could select whatever set of files I want and then run them through a Markdown processor.

Here's what I'm thinking... there's a Gulp plugin for reading front matter, another for generating RSS, one for processing Markdown, etc.

I see Techy offering a couple of things:

  1. Connection between content and templates (I like the <% get('content') %> and the ability to define custom functions that can go into templates)
  2. an all-in-one static site generator

For people like me who want the flexibility of Gulp (I choose which files run through which processors), that first feature above is valuable. For people who want something that "just works", the second one (something like the current "techy" command) may be nice.

There are Gulp plugins for rendering various kinds of templates, but I'm not sure that they're as well tuned to the static site generation case as Techy.

from techy.

krasimir avatar krasimir commented on May 20, 2024

Sounds good. To simplify the things - the Techy's Gulp plugin should contain only the core functionalities. I.e. the API methods. The Markdown, CSS or JavaScript processing should be left for the techy command and the original Techy module.

I could say that this will make Techy much more flexible tool and will bring new possibilities. However I should make some big changes because the current code is oriented to the Markdown conversion. I think that we should keep most of the logic in the original repository and just provide a proper API for that new Gulp plugin. It will be better for the future development.

from techy.

mathroc avatar mathroc commented on May 20, 2024

I started using techy on a small project and I too think the gulp plugin is great. as far as i know it's the only way to run techy in a deploy process; the techy command does not seems to have a "stop when you're done" option. and that's fine since the gulp plugin exists

however, I think the plugin should focus on the markdown/template processing. CSS & js is handle very well with other plugins, so there's no needs to have it in gulp-techy (it's fine in the techy command)

in particular, here is a few things I think techy-gulp should not do:

  • create _css, _js and _tpl folder if they don"t exists
  • compile and copy files from _css & _js
  • run the techy command (without watch)

here is my use case, I have this folder structure:

src/
├── index.md
├── article/
│   ├── about-something.md
│   └── about-something-else.md
├── about.md
├── contact.md
www/
layout/
└── basic.html

I want gulp-techy to do one thing: compile the .md files present in src/ and put the result in www/

I'd like to do this using this gulpfile.js:

var gulp = require('gulp');
var techy = require('techy');

gulp.task('techy', function() {
    gulp.src('./src/**/*.md')
        .pipe(techy({
            template: 'layout/basic.html'
        }))
        .pipe(gulp.dest('./www'));
});

gulp.task('default', ['techy']);

and here is the one I end up having

var gulp = require('gulp');
var techy = require('techy').gulp({
    root: __dirname+'/techy',
    dest: __dirname+'/techy/dest',
    theme: 'default'
});

gulp.task('techy', function() {
    gulp.src('./src/**/*.md')
        .pipe(techy())
        .pipe(gulp.dest('./www'));
});

gulp.task('default', ['techy']);

that's not much difference but i have to add a /techy folder at the project root to hold the _css, _js, _tpl, dest & public folder created and/or needed by techy, ideally only the _tpl would be needed and - as in the first gulpfile.js - could be anywhere

what do you guys think about it?

from techy.

krasimir avatar krasimir commented on May 20, 2024

I agree with your points and will probably make Techy working as you described.

from techy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.