0.0.2 • Published 2 years ago

@rtk/node-confluence-content-id-parser v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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-Idenes
headlineWelcome to our pageBienvenido a nuestra página
sub-headlineThis is our landingpageEsta 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

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

Usage

$ 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

ArgumentDescriptionRequiredDefault value
confluence-base-uriThe base uri of your confluence instance: protocol, hostname and portYes-
confluence-page-idThe page id of your contents to be analyzedYes-
confluence-usernameYour confluence username, uses new Personal Access Token Authentication if none is givenNo-
confluence-user-tokenYour confluence user tokenYes-
output-directoryThe directory to which your content-id files will be writteNooutput
recognition-patternThe pattern (regular expression), which will be used to determine which table contains content-idsNo^Content-Id$
recognition-flagsThe regular expression flags to be applied to the recognition-patternNoi (case insensitive)
identifier-columnThe index of the column containing the key to be usedNo0
starting-columnThe column to start indexing language codes from. This can be useful when you have a column containing comments or annotationsNo1
trim-contentShould all keys and translations values be automatically trimmed (e.g remove whitespaces at beginning and end)Notrue
0.0.2

2 years ago

0.0.1

3 years ago