<commit_before>:version: 0.0.2
:asciidoctor-base-version: 1.5.2
:confluence-version: 5.x

= Asciidoctor-Confluence {version}

Asciidoctor-confluence is a ruby gem that takes Asciidoc files, parse them using https://github.com/asciidoctor/asciidoctor[Asciidoctor] and push the result into https://www.atlassian.com/software/confluence[Confluence].
This gem currently supports Asciidoctor {asciidoctor-base-version} +
This gem is compatible with Confluence {confluence-version}

== How to use it ?

First you need to download and install the gem

[source, ruby]
----
gem install asciidoctor-confluence
----

Then to create a page

[source]
----
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD file.adoc
----

To update a page
[source]
----
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD --update file.adoc
#or
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD --update --pageid PAGEID file.adoc
----

Here is the list of arguments that can used with this gem

.Gem parameters
|===
|Argument | Is mandatory | Role | Example

|host
|yes
|The hostname of the Confluence instance
|http://confluence.mydomain/

|spaceKey
|yes
|The space wihtin the page will be created
|'AS' in http://confluence.mydomain/display/AS/

|title
|yes
|The title of the Confluence page 
|

|username
|no
|The username to use if the page has write restrictions
|

|password
|no
|The password associated to the account used to login into Confluence
|

|update
|false
|Indicate that the page must be updated instead of created. No values are required for this option
|

|pageid
|no
|The ID of the page you want to update, if it's not provided it will be determined using the space key and the title
|
|===


== Want to try it ?

If you want to try asciidoctor-confluence you can either download the gem:
[source]
gem install asciidoctor-confluence

Or install from the source

. Install the gem locally (at the moment it has not been publish to rubygem)
.. Clone the github repository locally `git clone https://github.com/gscheibel/asciidoctor-confluence.git`
.. Built it `gem build asciidoctor-confluence.gemspec`
.. Install it `gem install ./asciidoctor-confluence.{version}.gem`
.. To check it has been done correctly `asciidoctor-confluence -v` should display `asciidoctor-confluence: {version}`
. Have a Confluence instance
.. If you don't have a Confluence server, you can use a Docker container (e.i.: https://registry.hub.docker.com/u/cptactionhank/atlassian-confluence/), the option requires therefore an Atlassian account so it can generate a trial licence key.<commit_msg>fix typo in readme (PR #16)<commit_after>:version: 0.0.2
:asciidoctor-base-version: 1.5.2
:confluence-version: 5.x

= Asciidoctor-Confluence {version}

Asciidoctor-confluence is a ruby gem that takes Asciidoc files, parse them using https://github.com/asciidoctor/asciidoctor[Asciidoctor] and push the result into https://www.atlassian.com/software/confluence[Confluence].
This gem currently supports Asciidoctor {asciidoctor-base-version} +
This gem is compatible with Confluence {confluence-version}

== How to use it ?

First you need to download and install the gem

[source, ruby]
----
gem install asciidoctor-confluence
----

Then to create a page

[source]
----
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD file.adoc
----

To update a page
[source]
----
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD --update file.adoc
#or
asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE --username USERNAME --password PASSWORD --update --pageid PAGEID file.adoc
----

Here is the list of arguments that can used with this gem

.Gem parameters
|===
|Argument | Is mandatory | Role | Example

|host
|yes
|The hostname of the Confluence instance
|http://confluence.mydomain/

|spaceKey
|yes
|The space within which the page will be created
|'AS' in http://confluence.mydomain/display/AS/

|title
|yes
|The title of the Confluence page 
|

|username
|no
|The username to use if the page has write restrictions
|

|password
|no
|The password associated to the account used to login into Confluence
|

|update
|false
|Indicate that the page must be updated instead of created. No values are required for this option
|

|pageid
|no
|The ID of the page you want to update, if it's not provided it will be determined using the space key and the title
|
|===


== Want to try it ?

If you want to try asciidoctor-confluence you can either download the gem:
[source]
gem install asciidoctor-confluence

Or install from the source

. Install the gem locally (at the moment it has not been publish to rubygem)
.. Clone the github repository locally `git clone https://github.com/gscheibel/asciidoctor-confluence.git`
.. Built it `gem build asciidoctor-confluence.gemspec`
.. Install it `gem install ./asciidoctor-confluence.{version}.gem`
.. To check it has been done correctly `asciidoctor-confluence -v` should display `asciidoctor-confluence: {version}`
. Have a Confluence instance
.. If you don't have a Confluence server, you can use a Docker container (e.i.: https://registry.hub.docker.com/u/cptactionhank/atlassian-confluence/), the option requires therefore an Atlassian account so it can generate a trial licence key.
{'fraction_non_alphanumeric': 0.09488388969521044, 'fraction_numerical': 0.002902757619738752, 'mean_word_length': 4.147525676937442, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3333892', 'n_tokens_mistral': 1739, 'n_tokens_neox': 1663, 'n_words': 671}