GithubHelp home page GithubHelp logo

amphora-rss's Introduction

Amphora RSS

CircleCI Coverage Status

Notice

This is a pre-1.x version of the renderer and the API is subject to change. It's recommended to install a specific version of the package until a stable API is reached.

Install

$ npm install --save amphora-rss

Use Case

The primary use case for this renderer is when you want to use component instances to generate RSS feeds. Using this renderer, you can turn feeds into components that can be edited through the Kiln interface to effectively move feed generation to component configuration.

How To

This renderer is highly dependent on the component API provided by Amphora and therefore relies on a component that can generate a feed of documents to be passed off to the renderer. Here's an example implementation

  • An rss-feed component stores within itself the logic to query some service that generates feeds and stores the results within its own instance data.
  • Using the renderer specific model.js file the data of the component is trimmed down into an object with two specific properties:
    • feed: an Array of objects (read below for structure specification)
    • meta: an Object with properties that will be used in generating RSS meta tags at the top of the feed
  • The data is passed to this render which turns feed data into an RSS document

Data Specification

feed Array

At it's core, this renderer is a wrapper around the xml package to build the XML for the feed. This means that it is the responsibility of the renderer specific model.js file to create a feed object that abides by the API of this package. Refer to the package README for structure of this array.

Meta

The meta object is a very simple object composed of few properties which are used in composition of the XML.

  • title: a string rendered in the <title> tag of the XML document
  • description: a string rendered in the <description> tag of the XML document
  • link: a string rendered in the <link> tag of the XML document
  • copyright (optional): a string or number rendered in the <copyright> tag of the XML document. If not provided, the current year will be used.
  • generator (optional): a string rendered in the <generator> tag of the XML document. Defaults to Feed delivered by Clay.
  • docs: a string rendered in the <docs> tag of the XML document. Defaults to http://blogs.law.harvard.edu/tech/rss.

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.