Skip to content

Commit

Permalink
Add relocate livingDocs elements
Browse files Browse the repository at this point in the history
  • Loading branch information
fgervasi committed Dec 23, 2022
1 parent 6cab684 commit 1179905
Show file tree
Hide file tree
Showing 14 changed files with 11,390 additions and 0 deletions.
1 change: 1 addition & 0 deletions relocate-living-docs-elements/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
19 changes: 19 additions & 0 deletions relocate-living-docs-elements/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @nzz/et-utils-relocate-living-docs-elements

Extracts the livingdocs elements and places the elements append at the specified HTML target.

## Content

### relocateLivingDocsElements(elementIdPrefix: string, elementIds: string[], targetElement: HTMLElement): void

```ts
import { relocateLivingDocsElements } from "@nzz/et-utils-relocateLivingDocsElements";

relocateLivingDocsElements(elementIdPrefix, elementIds, targetElement));
};
```

## Modules & Node support

The package follows a hybrid module structure, supporting ES6 & CommonJS Module imports.
Node support can be implemented by changing the internal, relative import statements to include the file type suffix `.js` (not `.ts`!). This however breaks the CommonJS Module imports (`require()`), which should not be an issue if Node 12+ is used in the project.
18 changes: 18 additions & 0 deletions relocate-living-docs-elements/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Config } from "@jest/types";

// Sync object
const config: Config.InitialOptions = {
verbose: true,
"testEnvironment": "jsdom",
transform: {
"^.+\\.tsx?$": "ts-jest",
},
};

config.globals = {
"ts-jest": {
tsconfig: "<rootDir>/test/tsconfig.json",
},
};

export default config;
Loading

0 comments on commit 1179905

Please sign in to comment.