Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

publishToConfluence - help with Confluence page format #1260

Open
pablordoricaw opened this issue Oct 9, 2023 · 1 comment
Open

publishToConfluence - help with Confluence page format #1260

pablordoricaw opened this issue Oct 9, 2023 · 1 comment

Comments

@pablordoricaw
Copy link

pablordoricaw commented Oct 9, 2023

Hi docToolchain community 馃憢 !

Newbie here with docToolchain. I'd appreciate any guidance/help configuring the Confluence page format. (If it's possible to configure. I've been digging into the asciidoc2confluence.groovy and don't know if it's doable.)

Thank you in advance 馃檹 !

The sections in the Confluence pages I'm publishing have extra new lines and anchors that I'd like to remove.

What's going on?

  • Here's an example Confluence page with the extra new lines between sections:
    Screenshot 2023-10-09 at 12 52 14

  • Here's the same page open in the Confluence editor showing the new lines and anchors between sections:
    Screenshot 2023-10-09 at 12 51 38

What I'd like to happen:

  • Here's how I'd like the published page to look like in Confluence:
    Screenshot 2023-10-09 at 13 22 04

What generated those Confluence pages?

  • docToolchain v3.0.2

  • docToolchainConfig.groovy

    outputPath = 'build'
    
    inputPath = 'adrs'
    inputFiles = [
            [file: 'adrs.adoc',    formats: ['html']],
        /** inputFiles **/
    ]
    
    // these are directories (dirs) and files which Gradle monitors for a change
    // in order to decide if the docs have to be re-build
    taskInputsDirs = [
                        "${inputPath}"
                     ]
    
    //*****************************************************************************************
    
    //tag::confluenceConfig[]
    //Configureation for publishToConfluence
    
    confluence = [:]
    
    confluence.with {
        input = [
            [ 
                file: "build/html5/adrs.html",
                ancestorName: "ADRs"
            ]
        ]
    
        inputHtmlFolder = ''
        // endpoint of the confluenceAPI (REST) to be used
        // to verify the endpoint, add user/current and paste it into your browser
        // you should get a json about your own user
        api = 'https://confluence-xxx.atlassian.net/wiki/rest/api/'
    
        // the key of the confluence space to write to
        spaceKey = 'XXX'    
    
        // if true, all pages will be created using the new editor v2
        enforceNewEditor = true
    
        // variable to determine how many layers of sub pages should be created
        subpagesForSections = 2
    
        // the pagePrefix will be a prefix for each page title
        // use this if you only have access to one confluence space but need to store several
        // pages with the same title - a different pagePrefix will make them unique
        pagePrefix = ''
    
        pageSuffix = ''
    
        // the comment used for the page version
        pageVersionComment = 'docToolchain publishToConfluence'
    
    }
    //end::confluenceConfig[]
    //*****************************************************************************************
  • My Asciidoc files

    • adrs.adoc
      :doctype: book
      
      = DAF Architecture Decision Records
      
      == DAF Architecture Decision Records
      
      include::./0001-daf-record-architecture-decisions.adoc[]
      
      include::./0002-test-adr.adoc[]
      
      include::./0003-test-2-adr.adoc[]
    • ./0002-test-adr.adoc[]
      === 2. Test ADR
      
      Date: 2023-10-09
      
      ==== Status
      
      Accepted
      
      ==== Context
      
      The issue motivating this decision, and any context that influences or constrains the decision.
      
      ==== Decision
      
      The change that we're proposing or have agreed to implement.
      
      ==== Consequences
      
      What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.
      
  • The HTML generated with the generateHTML task where each <h> tag has a <a> tag with class="anchor"

<body class="book toc2 toc-left">
  <div id="header">
    <h1>DAF Architecture Decision Records</h1>
    <div id="toc" class="toc2">
      <div id="toctitle">Table of Contents</div>
      <ul class="sectlevel1">
        <li><a href="#_daf_architecture_decision_records">DAF Architecture Decision Records</a>
          <ul class="sectlevel2">
            <li><a href="#_0001_record_architecture_decisions">0001. Record architecture decisions</a></li>
            <li><a href="#_2_test_adr">2. Test ADR</a></li>
            <li><a href="#_3_test_2_adr">3. Test 2 ADR</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
  <div id="content">
    <div class="sect1">
        <h2 id="_daf_architecture_decision_records"><a class="anchor" href="#_daf_architecture_decision_records"></a>DAF Architecture Decision Records</h2>
      <div class="sectionbody">
         <!-- ... HTML for the 0001 ADR not shown in example so removed for brevity -->
        <div class="sect2">
          <h3 id="_2_test_adr"><a class="anchor" href="#_2_test_adr"></a>2. Test ADR</h3>
          <div class="paragraph">
            <p>Date: 2023-10-09</p>
          </div>
          <div class="sect3">
            <h4 id="_status_2"><a class="anchor" href="#_status_2"></a>Status</h4>
            <div class="paragraph">
              <p>Accepted</p>
            </div>
          </div>
          <div class="sect3">
            <h4 id="_context_2"><a class="anchor" href="#_context_2"></a>Context</h4>
            <div class="paragraph">
              <p>The issue motivating this decision, and any context that influences or constrains the decision.</p>
            </div>
          </div>
          <div class="sect3">
            <h4 id="_decision_2"><a class="anchor" href="#_decision_2"></a>Decision</h4>
            <div class="paragraph">
              <p>The change that we&#8217;re proposing or have agreed to implement.</p>
            </div>
          </div>
          <div class="sect3">
            <h4 id="_consequences_2"><a class="anchor" href="#_consequences_2"></a>Consequences</h4>
            <div class="paragraph">
              <p>What becomes easier or more difficult to do and any risks introduced by the change that will need to be
                mitigated.</p>
            </div>
          </div>
        </div>
        <!-- ... HTML for the 0003 ADR not shown in example so removed for brevity -->
      </div>
    </div>
  </div>
  <div id="footer">
    <div id="footer-text">
      Last updated 2023-10-09 17:10:27 UTC
    </div>
  </div>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
  <script>
    if (!hljs.initHighlighting.called) {
      hljs.initHighlighting.called = true
        ;[].slice.call(document.querySelectorAll('pre.highlight > code[data-lang]')).forEach(function (el) { hljs.highlightBlock(el) })
    }
  </script>
</body>

EDIT:

  • thank you in advance
@arutscheidt
Copy link

arutscheidt commented Oct 9, 2023

Same in 2.0.2 2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants