Skip to content

Commit

Permalink
Merge pull request #225 from patternfly/allow-special-attrs-titles
Browse files Browse the repository at this point in the history
allow special asciidoc attrs in titles
  • Loading branch information
jschuler authored Feb 3, 2023
2 parents 720dbd5 + fd0cd4c commit a418806
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 1,225 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"description": "This library provides the quickstarts module",
"license": "MIT",
"workspaces": [
"packages/*"
"packages/dev",
"packages/module",
"packages/transform-adoc"
],
"scripts": {
"build": "yarn workspace @patternfly/quickstarts build && yarn build:adoc",
Expand All @@ -25,7 +27,7 @@
"test:a11y": "patternfly-a11y --config patternfly-a11y.config"
},
"devDependencies": {
"@patternfly/patternfly-a11y": "4.2.1",
"@patternfly/patternfly-a11y": "^4.3.1",
"@percy/script": "^1.1.0",
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "2.11.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"serve": "serve public"
},
"dependencies": {
"@patternfly/patternfly": "4.183.1",
"@patternfly/patternfly": "^4.222.4",
"@patternfly/quickstarts": "2.3.2",
"@patternfly/transform-adoc": "*",
"@patternfly/react-core": "^4.135.0",
"@patternfly/react-core": "^4.267.6",
"asciidoctor": "^2.2.1",
"i18next": "^19.8.3",
"i18next-browser-languagedetector": "^6.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WARNING: This content is generated by running npm --prefix .build run generate:a
:product-version: 1
:product-long: Application Services
:product: App Services
:registry-product-long: Red Hat OpenShift Service Registry
:registry-product-long: Red Hat OpenShift{nbsp}Service Registry
:registry: Service Registry
// Placeholder URL, when we get a HOST UI for the service we can put it here properly
:service-url: https://console.redhat.com/application-services/streams/
Expand Down Expand Up @@ -72,7 +72,7 @@ ifdef::qs[]
Learn how to create and set up your first {registry} instance in {registry-product-long}.

[#introduction]
Welcome to the quick start for {registry-product-long}. In this quick start, you'll learn how to create and view a {registry} instance, create a schema in this instance, and create a service account to connect an application or service to this instance.
Welcome to the quick{nbsp}start for {registry-product-long}. In this quick start, you'll learn how to create and view a {registry} instance, create a schema in this instance, and create a service account to connect an application or service to this instance.
endif::[]

[id="proc-creating-service-registry-instance_{context}"]
Expand Down
18 changes: 9 additions & 9 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@
"showdown": ">=1.8.6"
},
"dependencies": {
"@patternfly/react-catalog-view-extension": "4.12.15",
"@patternfly/react-catalog-view-extension": "^4.93.15",
"dompurify": "^2.2.6",
"history": "^5.0.0",
"showdown": "1.8.6"
},
"devDependencies": {
"@patternfly/patternfly": "4.122.2",
"@patternfly/react-core": "4.135.15",
"@patternfly/react-icons": "4.11.4",
"@patternfly/react-styles": "4.11.4",
"@patternfly/react-tokens": "4.12.5",
"@patternfly/documentation-framework": "1.0.2",
"@patternfly/patternfly": "^4.222.4",
"@patternfly/react-core": "^4.267.6",
"@patternfly/react-icons": "4.93.6",
"@patternfly/react-styles": "4.92.6",
"@patternfly/react-tokens": "4.94.6",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.1.0",
Expand All @@ -71,10 +72,10 @@
"@types/react-dom": "^16.8.0",
"clean-css-cli": "^4.3.0",
"concat-files": "^0.1.1",
"dart-sass": "^1.25.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
"node-sass": "^6.0.1",
"node-sass-glob-importer": "^5.3.2",
"prettier": "^2.1.2",
"purgecss": "^4.0.0",
Expand All @@ -92,7 +93,6 @@
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-visualizer": "^5.5.0",
"sass": "^1.35.2",
"tslib": "^2.0.3",
"@patternfly/documentation-framework": "1.0.2"
"tslib": "^2.0.3"
}
}
2 changes: 1 addition & 1 deletion packages/module/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const commonPlugins = [
const includePaths = ['node_modules/', '../../node_modules/'];
const commonScssOptions = {
includePaths,
sass: require('node-sass'),
sass: require('sass'),
importer: globImporter(),
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'sass:math';

// frontend/public/style/_vars.scss
$font-size-base: 14px;
$pfext-m-catalog-tile-height: 100%;
Expand Down Expand Up @@ -104,11 +106,11 @@ $catalog-tile-width: $pfext-m-catalog-tile-width;
border: 1px solid var(--pf-global--BorderColor--300);
display: flex;
flex: 1;
padding-top: ($grid-gutter-width / 2);
padding-top: math.div($grid-gutter-width, 2);

&--with-sidebar {
margin: 0 ($grid-gutter-width / 2);
padding-bottom: ($grid-gutter-width / 2);
margin: 0 math.div($grid-gutter-width, 2);
padding-bottom: math.div($grid-gutter-width, 2);
}

&__btn-group__group-by {
Expand All @@ -123,7 +125,7 @@ $catalog-tile-width: $pfext-m-catalog-tile-width;

&__description {
margin-top: -10px;
padding: 0 ($grid-gutter-width / 2) 10px;
padding: 0 math.div($grid-gutter-width, 2) 10px;
@media (min-width: $grid-float-breakpoint) {
padding-left: $grid-gutter-width;
padding-right: $grid-gutter-width;
Expand Down Expand Up @@ -296,7 +298,7 @@ $catalog-tile-width: $pfext-m-catalog-tile-width;

&__tabs {
flex: 0 0 220px;
margin: 0 ($grid-gutter-width / 2) 0 0;
margin: 0 math.div($grid-gutter-width, 2) 0 0;
}
}

Expand Down
8 changes: 7 additions & 1 deletion packages/module/src/QuickStartPanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import QuickStartController from './QuickStartController';
import { QuickStartContext, QuickStartContextValues } from './utils/quick-start-context';
import { QuickStart } from './utils/quick-start-types';
import { camelize } from './utils/quick-start-utils';
import { removeParagraphWrap } from './QuickStartMarkdownView';
import { markdownConvert } from './ConsoleInternal/components/markdown-view';

type HandleClose = () => void;

Expand Down Expand Up @@ -112,7 +114,11 @@ const QuickStartPanelContent: React.FC<QuickStartPanelContentProps> = ({
className="pfext-quick-start-panel-content__name"
style={{ marginRight: 'var(--pf-global--spacer--md)' }}
>
{quickStart?.spec.displayName}{' '}
<span
dangerouslySetInnerHTML={{
__html: removeParagraphWrap(markdownConvert(quickStart?.spec.displayName)),
}}
/>{' '}
<small className="pfext-quick-start-panel-content__duration">
{quickStart?.spec.durationMinutes
? getResource(
Expand Down
3 changes: 2 additions & 1 deletion packages/module/src/catalog/QuickStartTileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-cl
import { StatusIcon } from '@console/shared';
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
import { QuickStartStatus, QuickStartType } from '../utils/quick-start-types';
import QuickStartMarkdownView from '../QuickStartMarkdownView';

type QuickStartTileHeaderProps = {
status: string;
Expand Down Expand Up @@ -38,7 +39,7 @@ const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps> = ({
return (
<div className="pfext-quick-start-tile-header">
<Title headingLevel="h3" data-test="title" id={quickStartId}>
{name}
<QuickStartMarkdownView content={name} />
</Title>
<div className="pfext-quick-start-tile-header__status">
{type && (
Expand Down
6 changes: 4 additions & 2 deletions packages/module/src/styles/legacy-bootstrap/_code.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'sass:math';

//
// Code (inline and block)
// --------------------------------------------------
Expand All @@ -21,8 +23,8 @@ code {
// Blocks of code
pre {
display: block;
padding: (($line-height-computed - 1) / 2);
margin: 0 0 ($line-height-computed / 2);
padding: math.div($line-height-computed - 1, 2);
margin: 0 0 math.div($line-height-computed, 2);
font-size: ($font-size-base - 1); // 14px to 13px
line-height: $line-height-base;
color: $pre-color;
Expand Down
14 changes: 8 additions & 6 deletions packages/module/src/styles/legacy-bootstrap/_type.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'sass:math';

//
// Typography
// --------------------------------------------------
Expand All @@ -18,13 +20,13 @@ h1, .h1,
h2, .h2,
h3, .h3 {
margin-top: $line-height-computed;
margin-bottom: ($line-height-computed / 2);
margin-bottom: math.div($line-height-computed, 2);
}
h4, .h4,
h5, .h5,
h6, .h6 {
margin-top: ($line-height-computed / 2);
margin-bottom: ($line-height-computed / 2);
margin-top: math.div($line-height-computed, 2);
margin-bottom: math.div($line-height-computed, 2);
}

h1, .h1 { font-size: $font-size-h1; }
Expand All @@ -39,7 +41,7 @@ h6, .h6 { font-size: $font-size-h6; }
// -------------------------

p {
margin: 0 0 ($line-height-computed / 2);
margin: 0 0 math.div($line-height-computed, 2);
}


Expand All @@ -50,7 +52,7 @@ p {
ul,
ol {
margin-top: 0;
margin-bottom: ($line-height-computed / 2);
margin-bottom: math.div($line-height-computed, 2);
ul,
ol {
margin-bottom: 0;
Expand All @@ -75,7 +77,7 @@ dd {

// Blockquotes
blockquote {
padding: ($line-height-computed / 2) $line-height-computed;
padding: math.div($line-height-computed, 2) $line-height-computed;
margin: 0 0 $line-height-computed;
font-size: $blockquote-font-size;
border-left: 5px solid $blockquote-border-color;
Expand Down
18 changes: 9 additions & 9 deletions packages/module/src/styles/patternfly-nested.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
@import '@patternfly/patternfly/sass-utilities/all';

.pfext-quick-start__base {
$pf-global--enable-reset: false;
@import '@patternfly/patternfly/base/common';
@import '@patternfly/patternfly/utilities/Accessibility/accessibility.scss';
$pf-global--enable-reset: false;
@import '@patternfly/patternfly/base/common';
@import '@patternfly/patternfly/utilities/Accessibility/accessibility';

// it's okay that we include everything since we'll purge the unused styles
@import '@patternfly/patternfly/components/all';
@import '@patternfly/patternfly/layouts/all';
// it's okay that we include everything since we'll purge the unused styles
@import '@patternfly/patternfly/components/all';
@import '@patternfly/patternfly/layouts/all';

// some apps globally set text-align: center
text-align: left;
}
// some apps globally set text-align: center
text-align: left;
}
23 changes: 11 additions & 12 deletions packages/transform-adoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,28 @@
"publishConfig": {
"access": "public"
},
"dependencies": {
"@patternfly/react-core": "^4.267.6"
},
"devDependencies": {
"@types/react": "^16.8.0",
"@types/react-dom": "^17.0.0",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"node-sass": "^6.0.1",
"@types/react": "^16.8.0",
"@types/react-dom": "^17.0.0",
"asciidoctor": "^2.2.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"rollup": "^2.37.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-node-externals": "^2.2.0",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-visualizer": "^5.5.0",
"asciidoctor": "^2.2.1",
"react": "^16.14.0",
"react-dom": "^16.14.0"
},
"dependencies": {
"@patternfly/react-core": "^4.135.0"
"rollup-plugin-visualizer": "^5.5.0"
},
"peerDependencies": {
"asciidoctor": ">=2.2.1",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"asciidoctor": ">=2.2.1"
"react-dom": ">=16.8.0"
}
}
2 changes: 1 addition & 1 deletion packages/transform-adoc/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const commonScssOptions = {
importer(path) {
return { file: path[0] !== '~' ? path : path.slice(1) };
},
sass: require('node-sass'),
sass: require('sass'),
};

// CommonJS build
Expand Down
Loading

0 comments on commit a418806

Please sign in to comment.