Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Nov 7, 2023
1 parent 5f8d629 commit 73e95b1
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ testem.log
Thumbs.db

ideas.md
/.vscode
/.vscode
serveAll.bat
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { AddFileComponent } from './user-input/add-file/add-file.component';
import { NotificationComponent } from './notification/notification.component';
import { DeploySpecComponent } from './user-input/deploy-spec/deploy-spec.component';
import { HeadingComponent } from './heading/heading.component';
@NgModule({
declarations: [
AppComponent,
Expand Down Expand Up @@ -110,6 +111,7 @@ import { DeploySpecComponent } from './user-input/deploy-spec/deploy-spec.compon
AddFileComponent,
NotificationComponent,
DeploySpecComponent,
HeadingComponent,
],
imports: [
BrowserModule,
Expand Down
10 changes: 10 additions & 0 deletions src/app/heading/heading.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="heading" *ngIf="heading != ''">
<h1 *ngIf="level == 1">{{ heading }}</h1>
<h2 *ngIf="level == 2">{{ heading }}</h2>
<h3 *ngIf="level == 3">{{ heading }}</h3>
<h4 *ngIf="level == 4">{{ heading }}</h4>
<h5 *ngIf="level == 5">{{ heading }}</h5>
<h5 *ngIf="level == 6">{{ heading }}</h5>
<h5 *ngIf="level == 7">{{ heading }}</h5>
<h5 *ngIf="level == 8">{{ heading }}</h5>
</div>
Empty file.
21 changes: 21 additions & 0 deletions src/app/heading/heading.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HeadingComponent } from './heading.component';

describe('HeadingComponent', () => {
let component: HeadingComponent;
let fixture: ComponentFixture<HeadingComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [HeadingComponent]
});
fixture = TestBed.createComponent(HeadingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
11 changes: 11 additions & 0 deletions src/app/heading/heading.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';

@Component({
selector: 'app-heading',
templateUrl: './heading.component.html',
styleUrls: ['./heading.component.sass'],
})
export class HeadingComponent {
@Input() heading: string = '';
@Input() level: number = 1;
}
35 changes: 35 additions & 0 deletions src/app/markdown-content/markdown-content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,40 @@ export class MarkdownContentComponent {
language: style,
title: name,
});
} else if (lines[i].trim().startsWith('#')) {
//image
let name = lines[i].split('[')[1].split(']')[0];
let url = lines[i].split('(')[1].split(')')[0];
let style = '';
if (lines[i].split(')')[1].includes('{')) {
style = lines[i].split('{')[1].split('}')[0];
}
if (lines[i].startsWith('?[')) {
let urlToImage =
'http://' +
IrisinterfaceService.host +
':' +
IrisinterfaceService.port +
'/woop/image/get/' +
url;
let newURL = await this.http
.get(urlToImage, { responseType: 'text' })
.toPromise()
.then((res) => {
return res;
});
if (newURL != undefined) {
url = newURL;
} else {
console.log('error getting image');
}
}
this.blocks.push({
type: 'image',
code: url,
language: style,
title: name,
});
} else if (lines[i].startsWith('$$$[')) {
//image
let name = lines[i].split('[')[1].split(']')[0];
Expand All @@ -123,6 +157,7 @@ export class MarkdownContentComponent {
!lines[i].startsWith('~~~') &&
!lines[i].startsWith('![') &&
!lines[i].startsWith('$$$[') &&
!lines[i].startsWith('#') &&
!lines[i].startsWith('?[')
) {
if (lines[i].startsWith('```')) {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/MarkdownCompiler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default class MarkdownCompiler {
static compileMarkdown(markdown: string): any[] {
return [];
}
}

0 comments on commit 73e95b1

Please sign in to comment.