ng-docu
Documentation helper Angular components for writing documentations and articles. See this library in action here.
Installation
Add the package to your angular project using
npm install ng-docu
yarn add ng-docu
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