Skip to content

Commit

Permalink
Merge pull request #225 from pro-vision/feature/stylemark-source-info
Browse files Browse the repository at this point in the history
feat(pv-stylemark): add info regarding the source of the components s…
  • Loading branch information
friewerts authored Apr 25, 2024
2 parents c5a5e66 + 59deaac commit d5065da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/pv-stylemark/tasks/lsg/getLsgData.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const { resolveApp, getAppConfig } = require("../../helper/paths");
* @typedef {{
* componentName: string;
* componentPath: string;
* srcPath: string;
* options: Object;
* description: string;
* examples: Array<StyleMarkExampleData>;
Expand Down Expand Up @@ -113,6 +114,7 @@ const getLsgDataForPath = async (markdownPath) => {
const { name, dir } = pathParse(markdownPath);
const componentsSrc = resolveApp(getAppConfig().componentsSrc);
const componentPath = relPath(componentsSrc, dir);
const srcPath = relPath(componentsSrc, markdownPath);

const { attributes: frontmatterData, body: fileContentBody } = frontmatter(fileContent);

Expand All @@ -135,6 +137,7 @@ const getLsgDataForPath = async (markdownPath) => {
return {
componentName: name,
componentPath,
srcPath,
options: frontmatterData,
description,
examples: exampleData,
Expand Down
4 changes: 4 additions & 0 deletions packages/pv-stylemark/tasks/templates/lsg-component.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<section class="dds-component" id="{{componentName}}">
<h2 class="dds-component__name">{{options.name}}</h2>
<h2 class="dds-component__source theme-content-element-source">
<span class="dds-component__source-label theme-content-element-source-label">Source:</span>
<span class="dds-component__source-path theme-content-element-source-path">{{srcPath}}</span>
</h3>
<div class="dds-component__description">
{{{description}}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@
margin: 0 0 24px;
}

&__source {
margin-bottom: 24px;
font-size: 14px;
font-weight: normal;
color: $dds-color__black-040;
}

&__source-label {
margin-right: 4px;
font-weight: 700;
text-transform: uppercase;
}

&__source-path {
font-family: Courier, monospace;
}

&__description {
h1 {
@extend %dds-typo__headline-1;
Expand Down

0 comments on commit d5065da

Please sign in to comment.