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

General improvements to the documentation #375

Merged
merged 5 commits into from
Jul 21, 2021

Conversation

swarren12
Copy link
Contributor

@swarren12 swarren12 commented Apr 23, 2021

A PR for general improvements to the documentation.

So far:

  • splitting out the examples so that we can prove they compile (spoilers: some previously didn't)
  • highlighting important pieces of information using admonitions
  • general rework of the "Using the Disruptor" section

@swarren12 swarren12 requested a review from Palmr April 23, 2021 12:02
@swarren12
Copy link
Contributor Author

One thing I'm not too happy about right now is that Gradle is enforcing checkstyle on the examples, which is nice in theory but it causes some lines to wrap in inconvenient ways... not sure if we should reformat or just turn it off?

@Palmr
Copy link
Contributor

Palmr commented Apr 23, 2021

it causes some lines to wrap in inconvenient ways

Is there a specific example of this?

You can add a suppression to config/checkstyle/suppress.xml e.g.

<suppress checks="LineLength" files="examples[\\/].*"/>

@swarren12
Copy link
Contributor Author

it causes some lines to wrap in inconvenient ways

Is there a specific example of this?

It's mostly in the method signatures of things where checkstyle seems to want parameters to be final, e.g.:

public static void handleEvent(final LongEvent event, final long sequence, final boolean endOfBatch)

Because of the formatting, this ends up rendered in the HTML as:

        public static void handleEvent(final LongEvent event, final long sequence, final boolean
endOfBatch)

@Palmr
Copy link
Contributor

Palmr commented Apr 23, 2021

Feels like what you want is checkstyle to have a smaller LineLength rule for code under src/examples to play nicer with the max-width: 62.5em on #content in the asciidoc theme we have?

Previously, the example code was all written directly into the
documentation, decoupling it from any real code. This meant changes to
APIs or whatever could unknowningly break the example code, adding to
the number of considerations that a developer would, in theory, be
required to worry about when changing something.

By promoting these examples to real code, we can offload that mental
strain onto the compiler, thus giving us more confidence that the
examples work. In theory, it also means that in the future we could
even add some tests for these to prove they're doing what we claim!
Specifically:
  - move the Java 8 examples to the top, as using these features is likely
    to be more common than using the legacy styles
  - replace in-example comments with callouts for better readability
  - general rewording to make it easier to read
This will fix some grammar warnings and shuffle some paragraphs around.
@swarren12 swarren12 marked this pull request as ready for review July 6, 2021 08:16
@Palmr Palmr merged commit c6cabe9 into LMAX-Exchange:master Jul 21, 2021
@swarren12 swarren12 deleted the improve-docs branch July 21, 2021 16:13
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.

None yet

2 participants