@digitalus-app/wiki
v0.0.1
Published
DigApp/wiki ===========
Readme
DigApp/wiki
The DigApp/Wiki adds a simple editable wiki to your DigPlatform application.
Installation
Add libraries to your project
# install platform dependencies if your project doesn't already include them
npm i @digitalus/db @digitalus/platform @digitalus/db @digitalus/ui @digitalus/user
# install peer dependencies
npm i ngx-markdown
# install wiki app
npm i @digitalus-app/wikiInclude the modules in your application
// app.module.ts
// ...
import {DigAppWikiModule} from '@digitalus-app/wiki';
import {DigDbModule} from '@digitalus/db';
import {DigUiModule} from '@digitalus/ui';
import {DigUserModule} from '@digitalus/user';
import { environment } from '../environments/environment';
@NgModule({
// ...
imports: [
// ...
DigPlatformModule.forRoot(environment.digPlatform),
DigDbModule,
DigUiModule,
DigUserModule,
DigAppWikiModule,
// ...
]
})
export class AppModule { }
DigAppWikiPage
Wiki pages implement the following interface:
| Property | Description |
| -------- | ----------- |
| uid?: string | firebase document id |
| created_at?: number | timestamp the the page was created |
| created_by?: string | uid of the user that created the page |
| updated_at?: number | timestamp page was last updated |
| updated_by?: string | uid of the user that last updated the page |
| path: string | path to page |
| title: string | page title |
| excerpt: string | short text excerpt |
| body: string | page body, markdown |
| labels?: string[] | string labels |
Wiki Service
The DigAppWiki service provides the public API for wikis.
| Method | Returns | Description |
| ------ | ------- | ----------- |
| get(path: string / string[]) | Observable<DigAppWikiPage> | load a page |
| children(path: string / string[]) | Observable<DigAppWikiPage[]> | loads an array of a page's children |
| index() | Observable<DigAppWikiPage[]> | loads an array of a page's children |
| set(path: string / string[], data: DigAppWikiPage) | Observable<DigAppWikiPage> | set page data (replaces all data) |
| update(path: string / string[], data: any) | Observable<DigAppWikiPage> | update an existing page (merges data) |
| delete(path: string / string[]) | Observable<boolean> | delete a page |
Wiki Page Component
A wiki page is an editable markdown page.
API
| Property | Description |
| -------- | ----------- |
| @Input() path: string / string[] | path to the page |
| @Input() editable: boolean | enable the editor UI |
Example
<dig-app-wiki-page path="/my/demo/page" [editable]="true"></dig-app-wiki-page>