GithubHelp home page GithubHelp logo

Question: If you want to create a plugin for Abell, what data and functions you would expect to be exported out of abell? about abell HOT 5 CLOSED

abelljs avatar abelljs commented on June 27, 2024
Question: If you want to create a plugin for Abell, what data and functions you would expect to be exported out of abell?

from abell.

Comments (5)

saurabhdaware avatar saurabhdaware commented on June 27, 2024

So my first thought is to have plugins that look like this.
abell-rss-feed-plugin.js

function beforeBuild(programInfo) {
  // ... Nothing to do before build
}

function afterBuild(completeContent, programInfo) {
  const rssXML = getRssXMLFromContent(completeContent, programInfo);
  fs.writeFile('rss.xml', rssXML);
  return 
}

module.exports = {beforeBuild, afterBuild}

from abell.

saurabhdaware avatar saurabhdaware commented on June 27, 2024

Implemented this in some amount at feat-plugins-system branch

The first parameter in afterBuild, completeContent is not really needed since most of the information is there in programInfo and additional information can be read from the built files.

from abell.

saurabhdaware avatar saurabhdaware commented on June 27, 2024

afterBuild and beforeBuild functions are added in v0.3.0, Here's an example plugin: https://github.com/saurabhdaware/abell-sitemap-plugin

from abell.

saurabhdaware avatar saurabhdaware commented on June 27, 2024

Idea for source plugins:

function beforeBuild(programInfo, {createContent}) {
  const meta = {
    title: 'Blog from source'
  }

  const content = `# This is head
  ## This is subtitle
  nice
  `

  createContent(content, meta)

This will make it easy to build source plugin and will also help to handle data in standard way rather than relying on plugins to handle that.

from abell.

saurabhdaware avatar saurabhdaware commented on June 27, 2024

I think we have stable plugin system now. Any additional exports can be handled in separate issues.

from abell.

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.