Skip to content

feat: accept configuration file ⚙️#19

Merged
AurelienLoyer merged 1 commit intodevelopfrom
feature/use-config-as-paramater
Oct 21, 2020
Merged

feat: accept configuration file ⚙️#19
AurelienLoyer merged 1 commit intodevelopfrom
feature/use-config-as-paramater

Conversation

@AurelienLoyer
Copy link
Copy Markdown
Member

@AurelienLoyer AurelienLoyer commented Oct 19, 2020

  • Add documentation
  • Now we are able to use configuration for the lab generation 👍

In a near futur we can also this file to pass some news configurations like

  • codelab main color
  • end link url
  • ....

Configuration

Values

Name Values Description
base "" The base url of bower_components and elements

Examples

From shell

npx @dxdeveloperexperience/codelab-generator ./index.adoc ./target path/to/config.json

npx @dxdeveloperexperience/codelab-generator ./index.md ./target path/to/config.json

the config.json

{
  "base": "baseurl/test/"
}

or

const codelab = require("@dxdeveloperexperience/codelab-generator");

// ...
await codelab(labTmpFile, labsOutputDir, { base: "" });

Result, it will convert template
from:

<script src="{{ &base }}bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="{{ &base }}elements/codelab.html" />

to:

<script src="baseurl/test/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="baseurl/test/elements/codelab.html" />

@AurelienLoyer AurelienLoyer added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 19, 2020
@AurelienLoyer AurelienLoyer self-assigned this Oct 19, 2020
@AurelienLoyer AurelienLoyer merged commit 4114364 into develop Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants