# @rtk/node-confluence-content-id-parser

> Confluence content id parser from tables

Latest version **0.0.2** (published 2022-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rtk/node-confluence-content-id-parser
pnpm add @rtk/node-confluence-content-id-parser
yarn add @rtk/node-confluence-content-id-parser
bun add @rtk/node-confluence-content-id-parser
```

Provides the command `node-confluence-content-id-parser`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-01-05 |
| First published | 2021-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=15.9.0 |
| Dependencies | 2 |
| Unpacked size | 24.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rouven T. Kruse |
| Maintainers | rtk |
| Keywords | confluence, parser, content-ids |

## Links

- npm: https://www.npmjs.com/package/@rtk/node-confluence-content-id-parser
- Repository: https://github.com/RTK/node-confluence-content-id-parser
- Homepage: https://github.com/RTK/node-confluence-content-id-parser#readme
- Issues: https://github.com/RTK/node-confluence-content-id-parser/issues
- npm.io page: https://npm.io/package/@rtk/node-confluence-content-id-parser

## Dependencies (2)

- [jsdom](https://npm.io/package/jsdom.md) ^19.0.0
- [@rtk/node-ts-cli-toolkit](https://npm.io/package/@rtk/node-ts-cli-toolkit.md) ^1.0.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-01-05
- 0.0.1 — 2021-08-17

## README

# node-confluence-content-id-parser

## About

This project provides a Command Line Interface (CLI) for automatic data processing
of Atlassian Confluence instances e.g. for localization purposes.

The `node-confluence-content-id-parser` requests a confluence instance with
credentials and crawls all tables of a destination page. Afterwards all tables
will be broke up into maps of language identifiers and string identifiers. All
maps will be merged in the end and encoded into a JavaScript Object Notation
string which will be persisted into a file named after its corresponding
language identifier.

### Example

Your confluence instance hosts a page e.g. `Translations for our landingpage`
with the page identifier `123456`. The page contains a table, e.g.

| String-Id    | en                      | es                                |
| ------------ | ----------------------- | --------------------------------- |
| headline     | Welcome to our page     | Bienvenido a nuestra página       |
| sub-headline | This is our landingpage | Esta es nuestra página de destino |

When invoking the tool with the arguments

-   --confluence-base-uri=https://ourcompanies.confluence
-   --confluence-page-id=123456
-   --confluence-username=MyUsername
-   --confluence-user-token=MyPassword
-   --recognition-pattern=^String-Id$
-   --output-directory=i18n

There will be two files in the `i18n` directory:

-   en.json
-   es.json

With the following contents:

_en.json_

```
json
{
    "headline": "Welcome to our page",
    "sub-headline": "This is our landingpage"
}
```

_es.json_

```
json
{
    "headline": "Bienvenido a nuestra página",
    "sub-headline": "Esta es nuestra página de destino"
}
```

## Installation

```shell
$ npm install @rtk/node-confluence-content-id-parser
```

### Usage

```shell
$ node-confluence-content-id-parser
  \ --confluence-base-uri=$URI
  \ --confluence-page-id=$ID
  \ --confluence-username=$USERNAME
  \ --confluence-user-token=$TOKEN
  \ --output-directory=$OUTPUT_DIRECTORY
  \ --recognition-pattern=$RECOGNITION_PATTERN
  \ --recognitionFlags=$RECOGNITION_FLAGS
```

#### Arguments

| Argument              | Description                                                                                                                    | Required | Default value          |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------- | ---------------------- |
| confluence-base-uri   | The base uri of your confluence instance: protocol, hostname and port                                                          | Yes      | -                      |
| confluence-page-id    | The page id of your contents to be analyzed                                                                                    | Yes      | -                      |
| confluence-username   | Your confluence username, uses new Personal Access Token Authentication if none is given                                       | No       | -                      |
| confluence-user-token | Your confluence user token                                                                                                     | Yes      | -                      |
| output-directory      | The directory to which your content-id files will be writte                                                                    | No       | output                 |
| recognition-pattern   | The pattern (regular expression), which will be used to determine which table contains content-ids                             | No       | `^Content-Id$`         |
| recognition-flags     | The regular expression flags to be applied to the `recognition-pattern`                                                        | No       | `i` (case insensitive) |
| identifier-column     | The index of the column containing the key to be used                                                                          | No       | 0                      |
| starting-column       | The column to start indexing language codes from. This can be useful when you have a column containing comments or annotations | No       | 1                      |
| trim-content          | Should all keys and translations values be automatically trimmed (e.g remove whitespaces at beginning and end)                 | No       | true                   |

---
_Source: https://npm.io/package/@rtk/node-confluence-content-id-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
