0.1.5 • Published 5 years ago
@internetarchive/ia-book-downloads v0.1.5
\
This webcomponent follows the open-wc recommendation.
Installation
npm i ia-book-downloadsor
yarn add @internetarchive/ia-book-downloadsUsage
<script type="module">
import 'ia-book-downloads/ia-book-downloads.js';
</script>
<ia-book-downloads></ia-book-downloads>Supply the element with an optional array of download options to immediately render. Each result can have these properties:
{
type: 'Encrypted Adobe PDF', // Button text
url: '#', // The URL to the downloadable item
note: 'PDF files contain high quality images of pages.', // Optional note to render below the button
}Styling
ia-book-downloads {
--downloadButtonColor: #fff;
--downloadButtonBg: #547fba;
--externalButtonColor: #547fba;
--externalButtonBg: #fff;
}Linting with ESLint
To scan the project for linting errors, run
npm run lintTesting with Karma
To run the suite of karma tests, run
npm run testTo run the tests in watch mode (for TDD, for example), run
npm run test:watchTooling configs
For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.
If you customize the configuration a lot, you can consider moving them to individual files.
Local Demo with es-dev-server
npm startTo run a local development server that serves the basic demo located in demo/index.html