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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve TLS docs, add javaseref shortcode #637

Merged
merged 3 commits into from
Jan 19, 2021

Conversation

stIncMale
Copy link
Member

@stIncMale stIncMale commented Jan 18, 2021

Formerly #622.

Note that this MR removes the TLS docs duplication and points reactive and Scala driver docs to the Java driver page. TSL docs for the reactive and Scala drivers were missing some relevant sections from the Java driver. By using only a single copy of this documentation, we can be sure that there are no outdated copies.

I installed hugo 0.25 locally from sources and manually checked that the changes, especially those related to the new javaseref, work properly.

JAVA-3420

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

My worry is that users will get lost jumping from their driver to the sync driver and that would cause confusion to the users. So I would prefer it being duplicated.

Most of the documentation is duplicated and then updated to the relevant paths / code examples.

In the future once this is migrated over to the docs team, they will be able to include the content.

Is that something we can do here? Include the content, so theres only one copy but it appears inline with all the languages?

@stIncMale
Copy link
Member Author

stIncMale commented Jan 19, 2021

My worry is that users will get lost jumping from their driver to the sync driver and that would cause confusion to the users.
...
Include the content, so theres only one copy but it appears inline with all the languages?

The answer is complicated: in theory "yes", in practice "no". Despite I found a way to do so, the approach only works when the Hugo re-generates a page that embeds the content of a different page (this must be related to some sort of internal evaluation order). I created 1fe5cbf to show how it could look like, but we can't really do this.

TL;DR The TLS docs are now duplicated again.


For the sake of sharing knowledge, below are the possible approaches.

  1. The official approach is to use the readFile function and write our own shortcode. The official page suggests writing a shortcode, but does not provide an example. The problems with this approach are
    1.1. Does not include headers from the embedded content into the TOC.
    1.2. Does not process shortcodes from the embedded content.
  2. A community approach of embedding generated page content, described here and here. Shortcodes are processed with this approach, which is nice. The problems with this approach are:
    2.1. Still does not include headers from the embedded content into the TOC. I did not find people complaining, but this is the behaviour I observed.
    2.2. Works only when Hugo re-generates a page that embeds another one as a result of updating either the page or the embed shortcode (updating the page that is embedded does not help and results in removing the embedded content). I did not find similar complaints in the Internet.

Judging by sections 2.1, 2.2, there is a tiny hope that newer versions of Hugo do not have the problems (at least not the one in section 2.2.), but we are locked at Hugo 0.25. Interestingly, Hugo maintainers do not want to provide a built-in way to embed (duplicates the generated content) or include (no content duplication) content: gohugoio/hugo#247.

Copy link
Member

@rozza rozza 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 looking into the embedding but I agree duplicating for now seems way easier.

@stIncMale stIncMale merged commit 858d743 into mongodb:master Jan 19, 2021
@stIncMale stIncMale deleted the JAVA-3420 branch January 19, 2021 20:35
jfitzu pushed a commit to nextworld-tools/mongo-java-driver that referenced this pull request Mar 3, 2021
jfitzu added a commit to nextworld-tools/mongo-java-driver that referenced this pull request Mar 3, 2021
ispringer pushed a commit to evergage/mongo-java-driver that referenced this pull request May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants