Skip to content

MINOR: Improve Connect docs#11642

Merged
showuon merged 2 commits intoapache:trunkfrom
mimaison:connect_docs
Feb 22, 2022
Merged

MINOR: Improve Connect docs#11642
showuon merged 2 commits intoapache:trunkfrom
mimaison:connect_docs

Conversation

@mimaison
Copy link
Copy Markdown
Member

@mimaison mimaison commented Jan 3, 2022

  • Fix indendation of code blocks
  • Add links to all SMTs and Predicates

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

- Fix indendation of code blocks
- Add links to all SMTs and Predicates
Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mimaison , thanks for fixing it. It will make the doc look better! Left a comment. Thanks.

Comment thread docs/connect.html Outdated
Comment on lines 43 to 45
<pre class="brush: bash;">
&gt; bin/connect-standalone.sh config/connect-standalone.properties connector1.properties [connector2.properties ...]
&gt; bin/connect-standalone.sh config/connect-standalone.properties connector1.properties [connector2.properties ...]
</pre>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found we put an additional line for each command.
image

We should put the ending </pre> at the end of the command, ex:

<pre class="brush: bash;">
&gt; bin/connect-standalone.sh config/connect-standalone.properties connector1.properties [connector2.properties ...]</pre>

Same as other commands.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I've pushed an update

Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. The only thing I'm not sure is that if the SMT and predicate link is correct or not. Other than that, LGTM! Thank you.

@mimaison
Copy link
Copy Markdown
Member Author

@dajac can you take a look? Thanks

Comment thread docs/connect.html
return configs;
}
</pre>
@Override
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does putting this in a CDATA let us avoid the eye-bleeding HTML escaping?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with CDATA but from a quick search it seems it shouldn't be used in HTML documents.
https://developer.mozilla.org/en-US/docs/Web/API/CDATASection states:

Note: CDATA sections should not be used within HTML they are considered as comments and not displayed.


out.print("<h5>");
out.print(docInfo.predicateName);
out.print("<a href=\"#" + docInfo.predicateName + "\">" + docInfo.predicateName + "</a>");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are this really href not name? If so what are they linking to?

Copy link
Copy Markdown
Member Author

@mimaison mimaison Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's linking to the existing <div id="..."> just above on line 61

Copy link
Copy Markdown
Member

@showuon showuon Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you let me know where does these predicateName appear in the doc?
here? https://kafka.apache.org/documentation/#connect_predicates
And what will be the expected output? What hyperlink destination we expected to link to?

Thank you.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predicates are listed in this section: https://kafka.apache.org/documentation/#connect_predicates

Currently the names of predicates are listed but they are not links so we can't easily copy direct links to them.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I got it. You want to add an anchor point in each predicate and transformation. I see now. I've checked, there is already the HTML element id = predicate names and transformation names, so adding an anchor link with the name can link to the position. Looks good to me. Thanks for the explanation.

@mimaison
Copy link
Copy Markdown
Member Author

@showuon @tombentley Can you take another look? Thanks

Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mimaison , for the html changes, I think they are good to be merged. But for the doc tool part, I am still not sure if the change is good or not since I don't know how these tool work. Might need your help to explain to me.

Or, maybe we can first merge the html changes, and discuss the tools change in a separate PR. Up to you. Thanks.


out.print("<h5>");
out.print(docInfo.predicateName);
out.print("<a href=\"#" + docInfo.predicateName + "\">" + docInfo.predicateName + "</a>");
Copy link
Copy Markdown
Member

@showuon showuon Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you let me know where does these predicateName appear in the doc?
here? https://kafka.apache.org/documentation/#connect_predicates
And what will be the expected output? What hyperlink destination we expected to link to?

Thank you.

Copy link
Copy Markdown
Member

@showuon showuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the patch!


out.print("<h5>");
out.print(docInfo.predicateName);
out.print("<a href=\"#" + docInfo.predicateName + "\">" + docInfo.predicateName + "</a>");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I got it. You want to add an anchor point in each predicate and transformation. I see now. I've checked, there is already the HTML element id = predicate names and transformation names, so adding an anchor link with the name can link to the position. Looks good to me. Thanks for the explanation.

@showuon showuon merged commit 576496a into apache:trunk Feb 22, 2022
@mimaison mimaison deleted the connect_docs branch February 22, 2022 13:33
@showuon
Copy link
Copy Markdown
Member

showuon commented Feb 22, 2022

@tombentley , sorry, I found I forgot to ask you if you have other comments. If you have any comments, please raise it. Sorry!

yyu1993 added a commit to confluentinc/kafka that referenced this pull request Feb 25, 2022
* apache-kafka/trunk: (49 commits)
  KAFKA-12738: send LeaveGroup request when thread dies to optimize replacement time (apache#11801)
  MINOR: Skip fsync on parent directory to start Kafka on ZOS (apache#11793)
  KAFKA-12738: track processing errors and implement constant-time task backoff (apache#11787)
  MINOR: Cleanup admin creation logic in integration tests (apache#11790)
  KAFKA-10199: Add interface for state updater (apache#11499)
  KAFKA-10000: Utils methods for overriding user-supplied properties and dealing with Enum types (apache#11774)
  KAFKA-10000: Add new metrics for source task transactions (apache#11772)
  KAFKA-13676: Commit successfully processed tasks on error (apache#11791)
  KAFKA-13511: Add support for different unix precisions in TimestampConverter SMT (apache#11575)
  MINOR: Improve Connect docs (apache#11642)
  ...
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

Successfully merging this pull request may close these issues.

3 participants