-
Notifications
You must be signed in to change notification settings - Fork 595
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
Merge Scala and Java documentation #527
Comments
Related: lightbend/paradox#54 |
Related to the docs, and how it is structured, right now it's complicated to find a specific topic as you need to navigate through the right sections till the right one (for example to get the page doc for a Directive). Is there any plan to add a search functionality? |
Cool! Yeah, I'm familiar with the Akka search, I didn't know it it will also appear for akka-http docs :) |
Absolutely, we'll also want it in alpakka et cetera. Hope Algolia will bear with us through this setting up :) |
I've also suggested to merge Java and Scala documentation when possible. Maybe to get this started it would make sense to find out on which pages the biggest differences are because these would be the most difficult to merge. |
I think there should also be some "if I'm looking at a scala snippet, the description should use |
But isn't the tabbing independent from snippets anyway? So, you would manually create tabs for Java and Scala and just put in there whatever you need, code and description. I think the most important thing would then be to put the choice of language into a cookie, so that it will be remembered between different pages. I guess that can be implemented in Javascript. |
And a script that switches all tabs on a page from Scala to Java or vice versa. |
Absolutely agree, let's see if they have a ticket for it already, I know it was discussed |
I guess that's true, but it would look a bit weird wouldn't it? Destroys the flow of reading a bit hm |
Don't forget the inline code snippets. Mainly, the only difference between the Scala and Java version is the generics syntax ( |
We should try to avoid those, as people then are confused which imports and context is needed for a snippet to work. |
I'm referring to this type of inline snippets:
From http://doc.akka.io/docs/akka-http/current/scala/http/introduction.html#routing-dsl-for-http-servers |
Ah, I see. True |
Should try to also unifying the directive docs? With #11 we will likely end up duplicating docs in scaladoc and javadoc, but it would simplify a lot of things if we only extract from scaladoc. The main complication is interlinking between directives and linking to non-directive pages which requires parsing either javadoc or scaladoc markup. |
Is there any plan to have the docs converted to PDF? I find it quite useful to get a PDF version to read when offline |
I just wrote them an email :) |
@jlprat There's an upstream ticket to add PDF support to Paradox: lightbend/paradox#14 however this might need to wait until lightbend/paradox#81 is resolved. I'll try to get back to hakking on Paradox to move things forward. |
(Renamed the ticket to "Merge Scala and Java documentation") I thought about a plan how to migrate the current documentation to a state where Java and Scala documentation is merged that would work in an incremental fashion without introducing too many conflicts in the transition period. Here it is:
We can decide not to merge some chapters (like directives) but we will need to think about how to represent these in the final tree. During the process, the documentation will be a bit more confusing. We might think about introducing automatic redirection from stub pages to one of the links by making use of the cookie value that specifies the language preference of the user (which will be one of the things we need for the merged things anyway). WDYT? |
If I understood your suggestion correctly, I think it might work. I only see a problem, the inline code snippets (or type signatures). It will not work easily when the inline contains a type parameter because of different syntax between Java and Scala, and sometimes the types are completely different.
vs.
This is the only weak point I see. |
My comment was more about the structural things so far. For the actual content, I fully agree that we need to solve these situations. For this particular one, I'd suggest we introduce a new paradox directive which allows to specify inline parts in multiple languages. This directive should create multiple |
It sounds doable, but I agree with you that the migration process could be painful, or at least confusing. +1 for the paradox feature :) I think @jonas said something about providing code snippets in multiple languages (like tab based code listings) |
It seems that lightbend/paradox#95 is starting to add features like that. |
Quick note that I agree Johannes's plan sounds very viable :) |
Paradox's new overlay feature might come in handy, allowing the new "shared doc node" to be the fallback for the current Java/Scala. http://developer.lightbend.com/docs/paradox/latest/features/overlay.html |
Here's a proof of concept of using overlays for Akka HTTP docs: jonas@f36a026 Source directory:
Target structure:
It "firewalls" Java and Scala docs so it is not possible to interlink using |
Thanks looks interesting, will have a look once I have a bit more time. |
@jonas' proposal looks like a good use of the overlays to arrive at a gradual way of arriving at a single common documentation base. Looks like this would be a slight variation on @jrudolph's proposal above:
At this point this can be published/merged. Then:
This will take a while. Then when everything has been moved to 'common' we can add support to make the language switching more 'dynamic' (without a page redirect) and publish 1 tree instead of 2 again, perhaps even removing the need to use overlays entirely. |
On the other hand going straight for the 'merged' end-state might save some 'throwaway' work. I looked into client-side 'group switching' in lightbend/paradox#107, seems doable. |
Let's focus on just converting a single page with all the needed paradox features to get the ball rolling. I also think that all the steps to get there are doable, but we might need to push a bit do get them done soon. The problem I see with merging all pages at once, is the sheer volume. Even without the directive pages, there is lots of content and just reviewing a huge bulk of documents seems like quite a burden. Maybe it's not clear with what you mean with "going straight" for the end-state. It sounds a bit like the move should be done in a single atomic operation which might mean that only person is involved in doing the change? That's something I'd like to avoid (and maybe it's not what you meant). At the current point I would also be fine with a feature branch for the conversion to be merged to master once the conversion is complete. The problem with that is that it invites conflicts if much work is done on the documentation content while we do the conversion. When we started the conversation that was the case so I wanted to prevent this disadvantage of a long-running feature branch. Right now the amount of incoming documentation changes isn't too high so it might make sense to do it in a branch. WDYT? |
With "going straight for the end-state" I meant skipping the 'overlays' approach and merging the docs into one tree immediately. Indeed using a feature branch we can split up the work, but merging it would be an atomic operation which is still a disadvantage. I'm a bit on the fence on this one still, perhaps we should indeed just try converting one page 'completely' and then see how that looks. |
First 'merged' page test: http://pi.bzzt.net/akka-docs-new/guide/quickstart.html (based on https://github.com/akka/akka/compare/integrate-docs-scala-java) |
That looks quite cool :) |
I agree, very nice :) I think we should try to improve the inline snippet syntax. Can't we just introduce another special cased tag that allows to write that in a more concise way? |
Looks awesome @raboof :-) |
@raboof Wow, it's really great! I think I could make use of paradox later too. |
Shall we close this one in favor of #1290 ? |
I agree that makes sense |
This is not properly an issue, but more a discussion ticket.
I recently ported some documentation pages from the Scala docs to the Java docs. The content is basically 95% the same, and only the code snippets and the inline code examples differ.
Would it make sense to think about some kind of abstraction so the main documentation text is shared?
Currently, if somebody changes something on a Scala documentation page, they need to also apply the same changes to the Java counterpart (if somebody forgets, both documentation will not be in sync).
The text was updated successfully, but these errors were encountered: