GithubHelp home page GithubHelp logo

vladholubiev / aws-news-post-formatter Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 52.74 MB

Formats & fixes HTML from AWS News API; Extracts custom tags based on the headline

Home Page: https://awsnews.info

License: MIT License

Shell 0.85% TypeScript 98.54% JavaScript 0.61%
aws npm-package

aws-news-post-formatter's Introduction

aws-news-post-formatter CircleCI

Fixes HTML from AWS News API and converts it to a clean html, markdown and text; Extracts custom tags based on the headline

Install

$ yarn add @vladholubiev/aws-news-post-formatter

Usage

It is meant to be used to prettify outputs of HTML from aws-news-api-client.

It also parses custom tags based on the post headline.

const {getPostBody, getCustomTags} = require('@vladholubiev/aws-news-post-formatter');

getPostBody('<p>Some HTML</p>'); // returns {html, markdown, text}

getCustomTags('AWS Fargate Supports Container Workloads Regulated By ISO, PCI, SOC, and HIPAA'); // ['iso', 'pci-dss', 'soc', 'hipaa']

Things this library does with HTML formatting

  • Normalizes relative URLs to absolute URLs
  • Removes all style attributes, style tags, class attributes
  • Normalizes tables to be full width
  • Fixes table formatting to have headers
  • Removes empty paragraphs and links
  • Normalizes bullet points in lists
  • Fixes double <b> tags and replaces them with <strong> tags

Moreover

  • Converts HTML to markdown with table support
  • Converts HTML to text with readable tables!

Custom tags extraction

Extracts tags based on the headline. Useful if you want to filter out noise. List of tags:

  • hipaa
  • iso
  • pci-dss
  • hitrust
  • soc
  • fips
  • nne
  • irap
  • fedramp
  • disa-stig
  • pki
  • gxp
  • govcloud
  • aws-pop-up
  • aws-well-architected
  • oracle-db
  • quick-start
  • partner-network
  • aws-competency
  • courses
  • aws-marketplace
  • solution-consulting
  • regional-expansion
  • tagging
  • language-expansion
  • bottlerocket
  • free-rtos
  • sap
  • launch-wizard
  • deep-racer

Check out src/custom-tags if you want to add more tags or adjust the existing ones.

See Also

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT

aws-news-post-formatter's People

Contributors

vladholubiev avatar vladgolubev avatar

Stargazers

Eduardo Rabelo avatar Pakinwet Saksamerprom avatar

Watchers

 avatar  avatar

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.