GithubHelp home page GithubHelp logo

Comments (7)

jonschlinkert avatar jonschlinkert commented on May 30, 2024

my opinion with assemble in particular is that the focus should be usability for UI folks. So when developers give us a hard time for not modularizing properly or whatever, explain that our main goal is ease-of-use until we get substantial adoption. IMO at that point we'll focus on efficiency.

With any other libs related to assemble I like the idea of modularizing and splitting into separate repos as much as possible. we should keep the language definitions in separate modules like what you're saying. For now though, until a spec for them is pretty solid, I would keep the languages together. It would be a pain to have to update a bunch of language repos if you changed something small. Here is a stab at it - this is missing a couple of things but it seems like a good start.

exports.language: {
  markdown: {
    ext: ['.md']
    ...
  },
  handlebars: {
    ext: ['.handlebars', '.hbs'],
    highlightSyntax: 'html',
    commentsBlock: [
      {
        open: '<!--',
        body: '',
        close: '-->'
      },
      {
        open: '{{!',
        body: '',
        close: '}}'
      },
      {
        open: '{{!--',
        body: '',
        close: '--}}'
      }
    ],
    regex: []
  },
  ...

I have definitions like this for about 30 languages. If you like this idea I can add regex for a bunch of them and push it up later. Then we can add methods to this lib for using the definitions, like methods for doing find/replace on comment blocks or just stripping them, etc. I think these things seem common enough that utilities methods for them would be useful.

Then we can depend on this lib with the yaml and front-matter modules.

from assemble-front-matter.

jonschlinkert avatar jonschlinkert commented on May 30, 2024

btw, if it's okay with you let's rename this to frontmatter since it's more generic and more likely to be used in other modules. it's available with npm too.

from assemble-front-matter.

jonschlinkert avatar jonschlinkert commented on May 30, 2024

one more thought since I missed this comment

it occurred to me that the assemble-'lang' repos would just be wrappers around other libraries

let's try to define the modules and see what this looks like. we have:

  • frontmatter: methods for extracting, converting or even inserting front matter. the focus of this lib is making frontmatter easier to use.
  • language definitions: used by frontmatter, but also applicable to any other projects that need things like common file extensions associated with a language, regex patterns for code comments, etc. the focus of this lib is to provide rock-solid language definitions and regex for common use cases.
  • parsing: all 3rd party libs

from assemble-front-matter.

doowb avatar doowb commented on May 30, 2024

So basically we'll have the following hierarchy for this repo:

  • frontmatter: main repo used for extracting, converting, and/or inserting front matter.
    • assemble-lang: contains a structure of common languages, extensions, regex, and ways for figuring out which language to use (can be used in repos other than frontmatter)
    • 3rd party libs: This includes js-yaml and other parsing libs used inside frontmatter after figuring out the language to use.

By doing this, assemble-yaml will go away and we'll just have the frontmatter repo. Is there a better name than assemble-lang for the languages?

from assemble-front-matter.

jonschlinkert avatar jonschlinkert commented on May 30, 2024

sounds good. assemble-lang is fine, we can change it after I have a chance to lookup keywords and see what people are looking for

from assemble-front-matter.

jonschlinkert avatar jonschlinkert commented on May 30, 2024

By doing this, assemble-yaml will go away and we'll just have the frontmatter repo

you could just rename assemble-yaml to assemble-lang or just lang or lang-utils or whatever. or just start from scratch, whatever you prefer

from assemble-front-matter.

doowb avatar doowb commented on May 30, 2024

This has been resolved with gray-matter

from assemble-front-matter.

Related Issues (2)

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.