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

edc-client-js

v3.3.0

Published

Documentation javascript client for edc

Downloads

182

Readme

edc-client-js

npm version

This project is meant to be used with easy doc contents (aka edc).

edc is a simple yet powerful tool for agile-like documentation management.

Learn more at https://www.easydoccontents.com.

edc Version Compatibility

Current release is compatible with edc v3.0+

Note

If you have an Angular application, you can use our edc help angular component available here :

https://github.com/tech-advantage/edc-popover-ng

Dependencies

No dependencies.

Installation

You can import your library with NPM in any Angular application by running:

$ npm install edc-client-js --save

with YARN, use:

$ yarn add edc-client-js

Usage

The edc help client has been made to be used with any web framework.

Instantiating a new EdcClient

To use the help client, you first have to instantiate a new EdcClient.

Below is an example for an Angular Typescript project, where exported documentation is served on /doc url :

this.edcClient = new EdcClient('/doc/');

Note that you can use ES6 imports to import classes from edc-client-js :

import { EdcClient, Documentation, Helper, InformationMap } from 'edc-client-js';

Calling the help client

The edc help client exposes several methods to get the content :

  • getContent(): Promise<ExportInfo>

Returns a promise when the content is ready, containing information about current content, including the info.json file from the export, the current plugin and language ids. (see ExportInfo object)

  • getTitle(): Promise<string>

Returns a promise containing the title of the current documentation, in the current language.

  • getToc(): Promise<Toc>

Returns a promise containing a table of content as Toc (see Toc object) representing the content of the toc.json file from the export.

edcClient.getToc().then(toc: Toc => this.toc = toc);
  • getHelper(mainKey, subKey): Promise<Helper>

Provides help content for the brick identified by the given keys. Contains the brick description, articles, links and information about the export.

(see Helper object).

  • getDocumentation(idDocumentation): Promise<Documentation>

Provides help content for a particular documentation, and information about how the request has been resolved, ie the language for this content, the export id it belongs to.

(see DocumentationTransfer , Documentation objects).

  • getInformationMapFromDocId(): Promise<InformationMap>

Returns a promise containing the information map of the given documentation.

See InformationMap.

  • getPopoverLabels(): Promise<PopoverLabel>

Returns a promise containing the translated labels of the given documentation, in the given language.

See PopoverLabel.

Translations

edc supports multi language documentations, and a translation language can be specified when requesting a content from the help client.

Content language resolution will be based on the export information present in the info.json files (default language, present translation languages).

The help client will try and resolve the content in the requested language; if no content was found, it will use the last resolved language, or default export language as a final fallback.

Note that returned context content (Helper.ts) and documentation content (DocumentationTransfer.ts) have the resolved language, so you can update your component translation settings if you want it to follow the documentation's.

Navigation

edc-client-js provides content urls, to make navigation to documentation in the web help explorer easier.

  • getContextWebHelpUrl(): string

Returns the url for loading the contextual help in the web help explorer (edc-help-ng).

  • getDocumentationWebHelpUrl(): string

Returns the url for loading the documentation in the web help explorer (edc-help-ng).

  • getHomeWebHelpUrl(): string

The edc-help-ng home url.

  • getErrorWebHelpUrl(): string

The edc-help-ng error page url.

  • getPopoverI18nUrl(): string

Returns the url for the i18n popover files, for customizing label translations in the edc-popover-ng project.

  • getWebHelpI18nUrl(): string

Returns the url of the i18n web help explorer files, for customizing label translations in the edc-help-ng project.

More

If you want more information, you can check our Angular help component library using this edc help client :

https://github.com/tech-advantage/edc-popover-ng

License

MIT TECH'advantage