0.1.0 • Published 5 years ago

ng-docu v0.1.0

Weekly downloads
16
License
-
Repository
-
Last release
5 years ago

ng-docu

Build Status

Documentation helper Angular components for writing documentations and articles. See this library in action here.

See animation on github

Installation

Add the package to your angular project using

npm install ng-docu
# or
yarn add ng-docu
# or
ng add ng-docu

Since math requires katex for rendering proper LaTeX expressions, one need to include the katex styles in the angular.json file manually.

"projects": {
  "projectID": {
    "architect": {
      "build": {
        "options": {
          "styles": [
            "./node_modules/katex/dist/katex.min.css"

replace projectID with your projects name.

Usage

There are two modules to use. The DocuModule and the DocuEditorModule. The DocuModule has got predefined components for displaying the documentation generated using the DocuEditorModule.

At first import one of these modules in your application module.

@NgModule({
  imports: [ DocuModule, DocuEditorModule ]
})
export class ApplicationModule{}

The documentation editor

Make sure to have the DocuEditorModule imported. The module provides a complete form with live rendering. It should integrate with your @angular/material configuration.

In the template simply use the editor tag to create a complete form for the article.

<docu-editor></docu-editor>

API

  • @Output() save($event): When the user saves the form, the save event will emit and contain the complete nested form.
  • @Input() documentation: Documentation: The user can patch the form with a previously created documentation.

Displaying the document

The document can be displayed using

<docu-article></docu-article>

which just has a @Input() documentation: Documentation interface.

Get in contact