Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/custom namespaces and elements #82

Conversation

joe1chen
Copy link

Add ability to customize namespaces and elements. This supercedes pull #69.

Examples:

Custom namespace:

feed.namespaces = {
  "xmlns:dcterms": "https://purl.org/dc/terms/",
  "xmlns:media": "https://search.yahoo.com/mrss/"
};

Custom elements at root:

feed.elements = [{
  'custom1': [{
    _attr: {
      attr1: 'value1'
    }
  }, {
    'custom2': 'value2'
  }]
}];

Custom elements in item:

posts.forEach(post => {
  feed.addItem({
    title: post.title,
    id: post.url,
    elements: [{
      'media:content': [{
        _attr: {
          url: 'https://v3spec.msn.com/image1.jpg',
          type: 'image/jpeg',
          medium: 'image'
        }
      }, {
        'media:credit': 'Joe Gargery/Fabrikam Images'
      }]
    }]
  });
});

@coveralls
Copy link

coveralls commented Nov 20, 2018

Coverage Status

Coverage decreased (-1.3%) to 94.313% when pulling 63ee652 on joe1chen:features/custom_namespaces_and_elements into eb08b96 on jpmonette:master.

aslafy-z added a commit to aslafy-z/feed that referenced this pull request Jan 31, 2019
More details: jpmonette#82
All thanks goes to @jeo1chen
@itsMattShull
Copy link

Is there anything I can do to help reconcile the conflicts and get this pull request merged?

@jpmonette
Copy link
Owner

jpmonette commented Aug 1, 2019

@derekshull Thanks for your time. Main things that needs to be addressed are the following:

  • Rename the elements attributes to extra
  • Make sure the data structure provided via extra is xml-js-friendly
  • Get rid of the feedLinks as it seems to be out-of-scope
  • Make sure to support RSS, Atom and JS feed (where applies)
  • Resolve conflicts

Feel free to spin up a new PR & I'll review 🚀.

@mikestopcontinues
Copy link

How does this relate to extensions? If I understand correctly, they're two ways of describing the same thing. Shouldn't they be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants