asciidoctor / asciidoctor-confluence Goto Github PK
View Code? Open in Web Editor NEWPush Asciidoctor file to Confluence
Home Page: https://rubygems.org/gems/asciidoctor-confluence
License: MIT License
Push Asciidoctor file to Confluence
Home Page: https://rubygems.org/gems/asciidoctor-confluence
License: MIT License
As a user
I want to generate XHTML output
So Confluence will accept it as valid markup.
This involves setting the Asciidoctor options in Asciidoctor::Confluence::Publisher as follows:
@asciidoctor_options[:backend] = 'xhtml'
Looks like this project hasn't received much attention in some time: no commits since 2015, a couple open PRs, a few open issues and lack of stated supported for newer versions of Confluence.
$ asciidoctor-confluence --host REDACTED --spaceKey REDACTED --title Troubleshooting --update --username REDACTED --password REDACTED --pageid 1186267139 index.adoc
An error occurred, the page has not been updated because:
Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)
Is there an SSL option?
I encountered an error connecting to the server with self-signed certificate.
To get around it I prepared PR: #24
Friends:
Thank you in advance for your time and attention.
I am trying to use the docker image for asciidoctor, specifically the asciidoctor-confluence.
I tried the following
HOST=https://conf.es.ak.azz.com
SPACEKEY=MDRD
TITLE="First Test"
USERNAME=zulu
PASSWORD=zebra
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor
asciidoctor-confluence --host $HOST --spaceKey $SPACEKEY --title $TITLE
--username $USERNAME --password $PASSWORD adoc_tester.adoc
An error occurred, the page has not been created because:
SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello
I did some research it looks like the https related libraries are not baked in for https end points specfically the SSL V3 is not available inside the image.
Can I get some help on how to solve it or the docker image be upgraded to use SSL3 ?
Thank you once again for your time and attention.
-Narahari
Hello,
When the adoc contains a toc (left, macro, ...), a table of contents is generated, but the links are not working (Confluence 5.9.3).
$ asciidoctor-confluence --host HOST --spaceKey MT --title TITLE --username USERNAME--password PWD file.adoc
An error occurred, the page has not been created because:
undefined method `+' for nil:NilClass
Is there a way to enable stack traces ?
Here is my version (latest from master branch):
$ asciidoctor-confluence -V
Asciidoctor-confluence v0.0.2
Asciidoctor 1.5.2 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.1p85 (2015-02-26 revision 49769) [x64-mingw32]) (lc:CP850 fs:Windows-1252 in:- ex:CP850)
c:/dev/softs/Ruby22-x64/lib/ruby/gems/2.2.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in `exit': no implicit conversion from nil to integer (TypeError)
from c:/dev/softs/Ruby22-x64/lib/ruby/gems/2.2.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in `<top (required)>'
from c:/dev/softs/Ruby22-x64/bin/asciidoctor-confluence:23:in `load'
from c:/dev/softs/Ruby22-x64/bin/asciidoctor-confluence:23:in `<main>'
Thanks ๐
It would be nice to show diagrams in confluence using confluence plantuml plugin. My files contains diagrams who are converted using asciidoctor-diagrams, but, for asciidoctor-confluence, a better integration could be use.
It could be interesting to set the attributes :
env=confluence
env-confluence
when generating the output.
I currently use it to remove outputfile suffix for cross-references links :
ifdef::env-confluence[:outfilesuffix:]
...
This is an ext link <<ext.adoc#ext_target>>
Hi,
I am getting this error because the ssl certificate is self-signed. Is there a way to disable certificate validation in https/ssl connections?
Error:
An error occurred, the page has not been created because:
SSL_connect returned=1 errno=0 state=error: certificate verify failed
Call:
asciidoctor-confluence --host https://myconfluence --spaceKey X --title Title --username x --password y README.adoc
Regards and thanks in advance.
When trying to write a test document I got:
asciidoctor-confluence --host myhost --spaceKey snadbox --title title --username user --password password ~/test.adoc
Where test.adoc consists of:
=== This is a test Hello World
I got:
An error occurred, the page has not been created because: A JSON text must at least contain two octets!
I also tried to add --verbose to diagnose things and got:
/home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/options.rb:77:in `init_options': invalid option: --verbose (OptionParser::InvalidOption) from /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/options.rb:20:in `parse!' from /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/options.rb:89:in `parse!' from /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/invoker.rb:17:in `invoke' from /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:6:in `' from /home/brucea/bin/asciidoctor-confluence:23:in `load' from /home/brucea/bin/asciidoctor-confluence:23:in `'
>ruby -v ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
running on RHEL7 x86_64
asciidoctor-confluence --help
outputs help for both asciidoctor-confluence and asciidoctor before dying:
> asciidoctor-confluence --help Usage: asciidoctor-confluence --host HOSTNAME --spaceKey SPACEKEY --title TITLE [ASCIIDOCTOR OPTIONS]... FILE... --host HOST the hostname of the Confluence instance --spaceKey SPACEKEY the Confluence space within the page will be created --title TITLE the title of the Confluence page --pageid PAGEID the id of the page to update --update indicate that the page must be updated instead of created --username USERNAME the username used if credential are need to create the page --password PASSWORD the password used if credential are need to create the page -h, --help Show the full helper (including Asciidoctor helper) -V, --version display the version and runtime environment (or -v if no other flags or arguments) Usage: asciidoctor [OPTION]... FILE... Translate the AsciiDoc source FILE or FILE(s) into the backend output format (e.g., HTML 5, DocBook 4.5, etc.) By default, the output is written to a file with the basename of the source file and the appropriate extension. Example: asciidoctor -b html5 source.asciidoc ``` -b, --backend BACKEND set output format backend: [html5, xhtml5, docbook5, docbook45, manpage] (default: html5) additional backends are supported via extensions (e.g., pdf, latex) -d, --doctype DOCTYPE document type to use when converting document: [article, book, manpage, inline] (default: article) -o, --out-file FILE output file (default: based on path of input file); use - to output to STDOUT --safe set safe mode level to safe (default: unsafe) enables include macros, but restricts access to ancestor paths of source file provided for compatibility with the asciidoc command -S, --safe-mode SAFE_MODE set safe mode level explicitly: [unsafe, safe, server, secure] (default: unsafe) disables potentially dangerous macros in source files, such as include::[] -s, --no-header-footer suppress output of header and footer (default: false) -n, --section-numbers auto-number section titles in the HTML backend; disabled by default -e, --eruby ERUBY specify eRuby implementation to use when rendering custom ERB templates: [erb, erubis] (default: erb) -C, --compact compact the output by removing blank lines. (No longer in use) -a, --attribute key[=value] a document attribute to set in the form of key, key! or key=value pair unless @ is appended to the value, this attributes takes precedence over attributes defined in the source document -T, --template-dir DIR a directory containing custom converter templates that override the built-in converter (requires tilt gem) may be specified multiple times -E, --template-engine NAME template engine to use for the custom converter templates (loads gem on demand) -B, --base-dir DIR base directory containing the document and resources (default: directory of source file) -D, --destination-dir DIR destination output directory (default: directory of source file) -I, --load-path DIRECTORY add a directory to the $LOAD_PATH may be specified more than once -r, --require LIBRARY require the specified library before executing the processor (using require) may be specified more than once -q, --quiet suppress warnings (default: false) --trace include backtrace information on errors (default: false) -v, --verbose enable verbose mode (default: false) -t, --timings enable timings mode (default: false) -h, --help show this message -V, --version display the version and runtime environment (or -v if no other flags or arguments) ``` /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in `exit': no implicit conversion from nil to integer (TypeError) from /home/brucea/.gem/ruby/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in`' from /home/brucea/bin/asciidoctor-confluence:23:in `load' from /home/brucea/bin/asciidoctor-confluence:23:in`'
Hello:
I want to use this gem but unfortunately it works only with asciidoctor 1.5.2.
Is there a plan to make this beautiful gem to be asciidoctor 2.10.0 compatible ?
Regards and thank you for this gem.
-Narahari
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday/options.rb:153:in new': tried to create Proc object without a block (ArgumentError) from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday/options.rb:153:in
memoized'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday/options.rb:234:in <class:ProxyOptions>' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday/options.rb:216:in
module:Faraday'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday/options.rb:1:in <top (required)>' from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in
require'
from internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday.rb:80:in
block in require_libs'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday.rb:79:in each' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday.rb:79:in
require_libs'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday.rb:240:in <module:Faraday>' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/faraday-0.9.2/lib/faraday.rb:16:in
<top (required)>'
from internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in
require'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence.rb:6:in <top (required)>' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/options.rb:2:in
require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/options.rb:2:in <top (required)>' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/invoker.rb:4:in
require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/lib/asciidoctor/confluence/invoker.rb:4:in <top (required)>' from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in
require'
from internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:4:in
<top (required)>'
from C:/Ruby31-x64/bin/asciidoctor-confluence:32:in load' from C:/Ruby31-x64/bin/asciidoctor-confluence:32:in
I've been prototyping the rendering of documents into Confluence storage format, using relevant Confluence macros to have a more "native" look & feel and bypassing some limitations (covers issues #3 and #18).
I also just discovered via https://discuss.asciidoctor.org/Confluence-erb-templates-td5184.html that @mfriedenhagen actually tried something similar a while ago (though I used haml not erb)
Since this project seems no longer active and was more focused on the upload to Confluence, I'm leaning toward releasing that as an independent ruby library - which could then be combined with asciidoctor-confluence to switch from xhtml, or used with any other Confluence REST API client lib.
Let me know if you think a different approach is better !
Steps to reproduce:
docker run --rm asciidoctor/docker-asciidoctor asciidoctor-confluence --version
echo $?
Expected results:
0
in step 2.Actual results:
1
.Output:
$ docker run --rm asciidoctor/docker-asciidoctor asciidoctor-confluence --version
Unable to find image 'asciidoctor/docker-asciidoctor:latest' locally
latest: Pulling from asciidoctor/docker-asciidoctor
c67f3896b22c: Pull complete
94e0a328a61c: Pull complete
4eb7dbe1cbfa: Pull complete
5267350f46f2: Pull complete
23aa78cbccb9: Pull complete
Digest: sha256:d1e01a3d819e4c55514a6499c3c3af6a4b9f7fbc814430d8d803b91f6c819391
Status: Downloaded newer image for asciidoctor/docker-asciidoctor:latest
Asciidoctor-confluence v0.0.2
Asciidoctor 1.5.7.1 [https://asciidoctor.org]
Runtime Environment (ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
/usr/lib/ruby/gems/2.4.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in `exit': no implicit conversion from nil to integer (TypeError)
from /usr/lib/ruby/gems/2.4.0/gems/asciidoctor-confluence-0.0.2/bin/asciidoctor-confluence:7:in `<top (required)>'
from /usr/bin/asciidoctor-confluence:23:in `load'
from /usr/bin/asciidoctor-confluence:23:in `<main>'
$ echo $?
1
As a user
I want to be able to create or update a page under another one
Then I can structure my publications
Trying to publish a file with a table:
table.adoc:
== Demo Table
|===
| Col1 | Col2 | Col3 | Col4
| Text1 | Text2 | Text3 | Text4
|===
asciidoctor-confluence --host https://<host> --spaceKey <key> --title <title> --username <username> --password <password> table.adoc
I get the errors:
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:153: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:153: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:153: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:153: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:153: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/faraday-0.9.2/lib/faraday/options.rb:62: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/home/rschulze/.gem/ruby/2.7.0/gems/json-1.8.6/lib/json/common.rb:155: warning: Using the last argument as keyword parameters is deprecated
An error occurred, the page has not been created because:
Error parsing xhtml: Unexpected close tag </colgroup>; expected </col>.
at [row,col {unknown-source}]: [10,10]
Confluence version is 7.2.0
As I user
I want to get benefit from the syntax highlighting in Confluence
So reading technical documentation will be easier
I love this project however I'm trying to add a property to be used when the application parses ascii doctor files which contain the include directive with a specific value e.g. {generated} in the path. This is set when the script is called to point to a specify file path actually part of this project
https://github.com/Swagger2Markup/swagger2markup
I thought the --attribute was intended for this however if I specify in this way
--attribute generated="d:/files/generated"
I get an error unknown attribute --attribute although the help from -? indicates --attribute is an option for a key value pair.
I am using this correctly or is there a better way to replace this ascii doctor variable?
Many thanks
Please make the tool compatible with Confluence Cloud (Oct. 2018). According to Help โ About Confluence the version is:
Confluence 1000.0.0-858e0d87fbd
Here is an apparent incompatiblity I ran into:
An error occurred, the page has not been created because:
Error parsing xhtml: Unexpected close tag </colgroup>; expected </col>.
at [row,col {unknown-source}]: [44,10]
Thanks for this tool! If I get asciidoctor-confluence
to work, it would solve soo many issues for me.
Thing is: It works for a simple page, but on using the following minimal AsciiDoc fragment it will throw an error:
* foo
* bar +
* baz
which results in:
โ doc git:(master) โ ./upload-to-confluence
Enter Password:
An error occurred, the page has not been created because:
[com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </p>; expected </br>.
at [row,col {unknown-source}]: [16,26]
I assume that some party is whining about a non-closed <br>
-Tag (which is perfectly fine for HTML).
Unfortunately my Ruby skills are void and I even have no clue where the troublesome code sits in.
We need to use client certificate to call the api (mtls),. How can i configure a truststore and password for it and then a client certificate name which shall be used from there?
Exception in thread "main" org.sahli.asciidoc.confluence.publisher.client.http.RequestFailedException: request failed (request: GET https://domain.com/confluence/rest/api/content/890284430/child/page?limit=25&start=0&expand=version <empty body>, response: <none>, reason: Received fatal alert: handshake_failure)
at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequest(ConfluenceRestClient.java:247)
at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequestAndFailIfNot20x(ConfluenceRestClient.java:227)
at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.getNextChildPages(ConfluenceRestClient.java:[29](https://gitlab.com/Mercedes-Intelligent-Cloud/cloud-technologies-architecture/mbos-portal/-/jobs/3372970952#L29)1)
at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.getChildPages(ConfluenceRestClient.java:259)
at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.deleteConfluencePagesNotPresentUnderAncestor(ConfluencePublisher.java:141)
at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.startPublishingUnderAncestorId(ConfluencePublisher.java:126)
at org.sahli.asciidoc.confluence.publisher.client.ConfluencePublisher.publish(ConfluencePublisher.java:81)
at org.sahli.asciidoc.confluence.publisher.cli.AsciidocConfluencePublisherCommandLineClient.main(AsciidocConfluencePublisherCommandLineClient.java:98)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1[36](https://gitlab.com/group/project/-/jobs/3372970952#L36)7)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1[37](https://gitlab.com/group/project/-/jobs/3372970952#L37)9)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:[38](https://gitlab.com/group/project/-/jobs/3372970952#L38)4)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:[39](https://gitlab.com/group/project/-/jobs/3372970952#L39)3)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.sahli.asciidoc.confluence.publisher.client.http.ConfluenceRestClient.sendRequest(ConfluenceRestClient.java:2[44](https://gitlab.com/group/project/-/jobs/3372970952#L44)
As a user
I want to publish the images included in adoc file in Confluence along with the content
So everything will be available in Confluence
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.