From 4ec56f89186fc6e4ed8b81fa54d7e8bc86fd0f69 Mon Sep 17 00:00:00 2001 From: Justin White Date: Wed, 22 Mar 2023 11:26:29 -0500 Subject: [PATCH 1/4] Fix syntax highlighting on Installation page --- angular.json | 4 +++- src/app/showcase/doc/installation/downloaddoc.ts | 5 +++-- src/app/showcase/doc/installation/stylesdoc.ts | 8 +++++--- src/app/showcase/domain/code.ts | 1 + .../showcase/layout/doc/code/app.code.component.html | 10 ++++++++++ 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/angular.json b/angular.json index 82cdcb9c7fb..8190f3741eb 100755 --- a/angular.json +++ b/angular.json @@ -45,7 +45,9 @@ ], "scripts": [ "./node_modules/prismjs/prism.js", - "./node_modules/prismjs/components/prism-typescript.js" + "./node_modules/prismjs/components/prism-typescript.js", + "./node_modules/prismjs/components/prism-scss.js", + "./node_modules/prismjs/components/prism-bash.js" ], "allowedCommonJsDependencies": [ "@fullcalendar/timegrid", diff --git a/src/app/showcase/doc/installation/downloaddoc.ts b/src/app/showcase/doc/installation/downloaddoc.ts index a60f6722f20..d5e42ab9980 100644 --- a/src/app/showcase/doc/installation/downloaddoc.ts +++ b/src/app/showcase/doc/installation/downloaddoc.ts @@ -16,10 +16,11 @@ export class DownloadDoc { @Input() title: string; code: Code = { - basic: `// with npm + command: ` +# with npm npm install primeng primeicons -// with yarn +# with yarn yarn add primeng primeicons` }; } diff --git a/src/app/showcase/doc/installation/stylesdoc.ts b/src/app/showcase/doc/installation/stylesdoc.ts index 5314d23d3b5..3e1aa35375c 100644 --- a/src/app/showcase/doc/installation/stylesdoc.ts +++ b/src/app/showcase/doc/installation/stylesdoc.ts @@ -23,7 +23,7 @@ export class StylesDoc { @Input() title: string; code1: Code = { - basic: `... + typescript: `... "styles": [ "node_modules/primeicons/primeicons.css", "node_modules/primeng/resources/themes/lara-light-blue/theme.css", @@ -33,8 +33,10 @@ export class StylesDoc { }; code2: Code = { - basic: `@import "primeng/resources/themes/lara-light-blue/theme.css"; + scss: ` +@import "primeng/resources/themes/lara-light-blue/theme.css"; @import "primeng/resources/primeng.css"; -@import "primeicons/primeicons.css";` +@import "primeicons/primeicons.css"; + ` }; } diff --git a/src/app/showcase/domain/code.ts b/src/app/showcase/domain/code.ts index f497e486cdc..2529c4bceec 100644 --- a/src/app/showcase/domain/code.ts +++ b/src/app/showcase/domain/code.ts @@ -2,6 +2,7 @@ export interface Code { basic?: string; html?: string; typescript?: string; + command?: string; scss?: string; data?: string; module?: string; diff --git a/src/app/showcase/layout/doc/code/app.code.component.html b/src/app/showcase/layout/doc/code/app.code.component.html index edb069d86de..f3ce660fa84 100644 --- a/src/app/showcase/layout/doc/code/app.code.component.html +++ b/src/app/showcase/layout/doc/code/app.code.component.html @@ -66,5 +66,15 @@

 {{code.data}}
 
+
+ +

+    {{code.scss}}
+    
+
+ +

+    {{code.command}}
+    
 
\ No newline at end of file From ac225811bb17f3486f90086f4765f9aa3c6c5738 Mon Sep 17 00:00:00 2001 From: Justin White Date: Wed, 22 Mar 2023 11:52:08 -0500 Subject: [PATCH 2/4] Move typescript block first --- src/app/showcase/doc/icons/constantsdoc.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/showcase/doc/icons/constantsdoc.ts b/src/app/showcase/doc/icons/constantsdoc.ts index 4c1e4be4f23..860a49a1a8a 100644 --- a/src/app/showcase/doc/icons/constantsdoc.ts +++ b/src/app/showcase/doc/icons/constantsdoc.ts @@ -35,12 +35,6 @@ export class ConstantsDoc { } code: Code = { - basic: ` -`, - html: ` -
- -
`, typescript: ` import { Component } from '@angular/core'; import { PrimeIcons, MenuItem } from 'primeng/api'; @@ -64,6 +58,12 @@ export class PrimeIconsConstantsDemo { } ]; } -}` +}`, + basic: ` +`, + html: ` +
+ +
` }; } From ad3cde527688b66ad460cbc992137efd16bd5b4e Mon Sep 17 00:00:00 2001 From: Justin White Date: Wed, 22 Mar 2023 11:52:08 -0500 Subject: [PATCH 3/4] Revert "Move typescript block first" This reverts commit ac225811bb17f3486f90086f4765f9aa3c6c5738. --- src/app/showcase/doc/icons/constantsdoc.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/showcase/doc/icons/constantsdoc.ts b/src/app/showcase/doc/icons/constantsdoc.ts index 860a49a1a8a..4c1e4be4f23 100644 --- a/src/app/showcase/doc/icons/constantsdoc.ts +++ b/src/app/showcase/doc/icons/constantsdoc.ts @@ -35,6 +35,12 @@ export class ConstantsDoc { } code: Code = { + basic: ` +`, + html: ` +
+ +
`, typescript: ` import { Component } from '@angular/core'; import { PrimeIcons, MenuItem } from 'primeng/api'; @@ -58,12 +64,6 @@ export class PrimeIconsConstantsDemo { } ]; } -}`, - basic: ` -`, - html: ` -
- -
` +}` }; } From 882040a9069ef91a8a861c33c7a1a0c35cab2c4a Mon Sep 17 00:00:00 2001 From: Justin White Date: Wed, 22 Mar 2023 12:39:18 -0500 Subject: [PATCH 4/4] Fix highlighting on icons page --- src/app/showcase/doc/icons/downloaddoc.ts | 3 ++- src/app/showcase/doc/icons/importdoc.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/showcase/doc/icons/downloaddoc.ts b/src/app/showcase/doc/icons/downloaddoc.ts index 3de9ff9f9ed..49545b870d0 100644 --- a/src/app/showcase/doc/icons/downloaddoc.ts +++ b/src/app/showcase/doc/icons/downloaddoc.ts @@ -16,6 +16,7 @@ export class DownloadDoc { @Input() title: string; code: Code = { - basic: `npm install primeicons` + command: ` +npm install primeicons` }; } diff --git a/src/app/showcase/doc/icons/importdoc.ts b/src/app/showcase/doc/icons/importdoc.ts index 3d8235d6a1d..ddfdc92e42a 100644 --- a/src/app/showcase/doc/icons/importdoc.ts +++ b/src/app/showcase/doc/icons/importdoc.ts @@ -16,6 +16,7 @@ export class ImportDoc { @Input() title: string; code: Code = { - typescript: `@import "primeicons/primeicons.css";` + scss: ` +@import "primeicons/primeicons.css";` }; }