login
This commit is contained in:
45
src/app/modules/songs/services/text-rendering.service.ts
Normal file
45
src/app/modules/songs/services/text-rendering.service.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
export enum SectionType {
|
||||
Verse,
|
||||
Chorus,
|
||||
Bridge,
|
||||
}
|
||||
|
||||
export enum LineType {
|
||||
title,
|
||||
chrod,
|
||||
text,
|
||||
}
|
||||
|
||||
export interface Line {
|
||||
type: LineType;
|
||||
text: string;
|
||||
}
|
||||
|
||||
|
||||
export interface Section {
|
||||
type: SectionType;
|
||||
number: number;
|
||||
lines: Line[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TextRenderingService {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public render(text: string): Section[] {
|
||||
const lines = text.match(/[^\r\n]+/g);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private findSection(line: string) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user