okhttp
okhttp copied to clipboard
Code example box in the docs
The code examples are difficult to read because they are in the "normal" text
OkHttpClient
Maybe you could make a codebox like on this page
Recipes
Hi, I'm interested in working on this issue. This would be my first time contributing. Can it be assigned to me?
Yes, thanks, please take a look. I can point you at some of the documentation processes after I get home.
@yschimke Sure, that would be great, thank you. Also, I was wondering how I can locally test my changes and view the documentation as it would appear on https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/
Take a look at this test script, which should generate a local site directory https://github.com/square/okhttp/pull/7414
@yschimke Hey again. Thanks for the test script. It is super helpful for rendering the docs. So I have been trying to get the code blocks to work properly in the inline KDocs markdown, but it doesn't seem to work as expected. For example this snippet: ''' // The singleton HTTP client. public final OkHttpClient client = new OkHttpClient(); ''' does not render as code. (using single quotes instead of back-ticks here since the comments support markdown)
The same thing with the code indented: ''' <4 SPACES>// The singleton HTTP client. <4 SPACES>public final OkHttpClient client = new OkHttpClient(); ''' does render as a code block, but now the issue I see is that the rendered code block appends a '' character at the end of each line. I have tried many different syntaxes as well as adding 2 spaces at the end of each line to stop this behavior but it won't seem to work. Just wondering if you have any advice here as its a very specific issue that I don't see anyone else having with KDoc and Dokka.
Sorry, Not sure I can help here. Maybe raise a bug at https://github.com/Kotlin/dokka and link to the branch with a reproduction.
So options we've tried
"'''java" - current ones that don't render "'''" - tried as well "<4 spaces>" - tried but leaving additional character at end of line
You could also try bumping the dokka plugin? gradlePlugin-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.6.21"
Sure, sounds good. bumping dokka to 1.7.10 seems to do the trick. I just raised a PR for that. I raised a bug with Dokka and they validated that code blocks are supported with 1.7.0 and above.
Should be fixed on next release.
Hi, I'm interested in contributing to this issue. This would be my first open-source contribution. Can it be assigned to me?
Sorry, should already be fixed with https://github.com/square/okhttp/pull/7421