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

ng-docx

v3.0.1

Published

<p align="center"> <img alt="Ng-Docx Logo"src="https://raw.githubusercontent.com/CarlosTenorio/ng-docx/master/projects/ng-docx-sandbox/src/assets/images/NG_DOCX_icon.png" width="12%"> </p>

Downloads

91

Readme

Build Status npm version npm download license

Getting Started

Welcome to NG-DOCX!

DEMO

Stackblitz

Demo GIF

What is Ng-docx?

Ng-docx is a library that automatically generates a documentation page to easily and beautifully view your markdowns

PeerDependencies

Before install the library, install the necessary dependencies to function properly

Angular compatibility

| Angular | Ng-docx | | ------- | ------- | | 12 | 3.x.x | | 11 | 2.x.x | | 10 | 1.x.x | | 9 | 0.4.x | | 8 | 0.3.x |

Installation

npm install ng-docx

Add styles

Import on your global styles:

The styles from the library:

styles.scss

@import '~ng-docx/assets/styles/ng-docx.scss';

Add scripts

angular.json

"scripts": [
    "node_modules/marked/lib/marked.js",
    "node_modules/prismjs/prism.js",
    "node_modules/prismjs/components/prism-typescript.min.js",
    "node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js"
]

Import the library

Steps

To make your documentation page you must wrap the NgDocxModule, for this follow these steps:

  1. Create a Module on your app, i.e, DocsModule (docs.module.ts)

  2. Import the NgDocxModule and the NgDocxComponent

    docs.module.ts

    import { NgDocxModule, NgDocxComponent } from 'ngx-docx';
  3. Add the names of the files you want to add to the documentation.

    docs.module.ts

    const files = ['getting started', 'theming'];
    
    @NgModule({
        imports: [
            NgDocxModule.forRoot({
                files
            })
        ]
    })
  4. Add the route to NgDocxComponent on your module.

    docs.module.ts

    const routes: Routes = [
        {
            path: '',
            children: [{ path: '', component: NgDocxComponent }]
        }
    ];
    @NgModule({
        imports: [
            NgDocxModule.forRoot({
                files: fileNames
            }),
            RouterModule.forChild(routes)
        ]
    })

Final code on your wrap module

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NgDocxModule, NgDocxComponent } from 'ng-docx';

const fileNames = ['getting started', 'theming'];

const routes: Routes = [
    {
        path: '',
        children: [{ path: '', component: NgDocxComponent }]
    }
];

@NgModule({
    imports: [
        NgDocxModule.forRoot({
            files: fileNames
        }),
        RouterModule.forChild(routes)
    ]
})
export class WrapperDocsModule {}

What type of extensions are supported?

  • Markdown (.md)

Where are my docs located?

The files must be placed in the assets folder inside a subfolder called docs, for example:

  • assets
    • docs
      • getting started.md
      • theming.md