npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-gdocs

v1.1.1

Published

Vue component to embed Google Docs content

Downloads

5

Readme

Vue-GDocs

Vue component to embed Google Docs content.

Features:

  • Works with any published Google Docs URL
  • Fixes up padding / width of the original automatically
  • Removes tracking beacons from URLs
  • Makes all links open in a new tab by default
<script>
import VueGdocs from 'vue-gdocs';

export {
	components: {VueGdocs}
};
</script>

<template>
	<div>
		<vue-gdocs :url="https://docs.google.com/document/d/e/SOME-LONG-HASH/pub"/>
	</div>
</template>

Installation

Install via NPM:

npm install --save vue-gdocs

Import into your app:

<script>
import VueGdocs from 'vue-gdocs';

export {
	components: {VueGdocs}
};
</script>

Use in your template:

<template>
	<div>
		<vue-gdocs :url="https://docs.google.com/document/d/e/SOME-LONG-HASH/pub"/>
	</div>
</template>

API

Properties

The vue-gdocs component accepts the following properties:

| Property | Type | Default | Description | |---------------|-----------|-----------|------------------------------------------------------------------------------------------------------------------------------| | url | String | | The URL of the published Google Doc to display | | urlOptions | Object | {} | Additional options to pass to fetch when retrieving the URL | | follow | Boolean | false | Handle all document-to-document links by replacing the current document contents, if false link will act like a regular link | | fixes | Array | See below | An array of fixes to apply, in order | | customFixes | Object | {} | Additional user defined fixes, see notes below |

Notes:

  • Fixes defaults to all available fixes being enabled in a suitable execution order
  • customFixes is a simple lookup object of functions to run. Each function is called as ($doc) (a jQuery wrapped version of the full document. Each function can return undefined (to carry on with processing on the top level document) or a jQuery object as a replacement body
  • Following links only works if the link is a published document link - i.e. should end in /pub

Events

The following events are emitted from the component:

| Event | Payload | Description | |--------------|------------------|--------------------------------------------------------------------------------------------------------------| | click-link | ({url, event}) | Emitted when a link is clicked within the document, use event.preventDefault() to prevent normal behaviour |

Fixes

The following fixes ship with the component and are all enabled by default:

| Fix | Description | |-----------------|--------------------------------------------------------------------| | bodyRoot | Add the gdoc-root class to the actual body root <div/> wrapper | | bodyPadding | Remove main document padding | | bodyWidth | Remove main document maximum-width restrictions | | linkTargets | Make all <a/> links open in a new window | | linkUnshorten | Remove Google shortner prefixes for all links |