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

[FLINK-12651][docs] Documentation Style Guide. #240

Closed
wants to merge 5 commits into from
Closed

[FLINK-12651][docs] Documentation Style Guide. #240

wants to merge 5 commits into from

Conversation

morsapaes
Copy link
Contributor

What is the purpose of the change

Proposing a documentation style guide to support and standardize new documentation contributions. This should also help in the long-haul effort of reworking existing documentation (FLIP-42). Feedback and suggestions are welcome!

TODO: there are already some improvement points mentioned in the draft document.

Brief change log

Adding a new section to the "How to Contribute" navigation sidebar and linking it from within "Contributing Documentation".

Verifying this change

This change is non-code related.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Sync with upstream repo.
Proposing a guide to support and standardize documentation contributions.
Copy link
Contributor

@sjwiesman sjwiesman 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 driving this @morsapaes. Overall I think the guide makes sense, the thing we have to add to the initial version is adding an Apache license to each file.

contributing/docs-style.md Show resolved Hide resolved
contributing/docs-style.md Outdated Show resolved Hide resolved
contributing/docs-style.md Outdated Show resolved Hide resolved
contributing/docs-style.md Outdated Show resolved Hide resolved
morsapaes and others added 2 commits August 16, 2019 16:21
Co-Authored-By: Robert Metzger <89049+rmetzger@users.noreply.github.com>
…ions. Also replaced the syntax of markdown highlights to get rid of the eye-stabbing red background color.
@sjwiesman
Copy link
Contributor

@fhueske @rmetzger What's your opinion on the status of this style guide? Since we can expect a large influx of documentation PR's for 1.10 it might be a good time to merge this.

Copy link
Contributor

@rmetzger rmetzger 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 addressing my comments. The change is good to merge.

@fhueske
Copy link
Contributor

fhueske commented Dec 11, 2019

I'm having a look right now.

Copy link
Contributor

@fhueske fhueske 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 this great documentation guide @morsapaes!
I left a few comments and suggestions.

Best, Fabian


Below, you find some basic guidelines that can help ensure readability and accessibility in your writing. For a deeper and more complete dive into language style, also refer to the [General Guiding Principles](#general-guiding-principles).

### Addressing the User
Copy link
Contributor

Choose a reason for hiding this comment

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

Concrete examples would be good for the points listed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Of the following four points, only two are about addressing the user. Can you generalize the heading?


### Addressing the User

* **Use active voice.** [Active voice](https://medium.com/@DaphneWatson/technical-writing-active-vs-passive-voice-485dfaa4e498) supports brevity and makes content more engaging. If you add _by squirrels_ after the verb in a sentence and it still makes sense, you are using the passive voice.
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't really get the last sentence. An example would help.

* **Avoid qualifying and prejudging actions.** For a user that is frustrated or struggling to complete an action, using words like _quick_ or _easy_ can lead to a poor documentation experience.

### Using Flink-specific Terms
Use clear definitions of terms or provide additional instructions on what something means by adding a link to a helpful resource, such as other documentation pages or the [Flink Glossary](https://ci.apache.org/projects/flink/flink-docs-master/concepts/glossary.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a note that it would be good to propose new terms for the Glossary?

In the documentation build, navigation is defined using properties configured in the front-matter variables of each page.

<font size="3">
<table width="100%" class="table table-bordered">
Copy link
Contributor

Choose a reason for hiding this comment

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

Combine this table with the other table about variables in the header? Not sure if it is clear that these variables can/should be set in the page header.


* To highlight a tip or piece of information that may be helpful to know:

```liquid
Copy link
Contributor

Choose a reason for hiding this comment

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

add an info text and a closing "tag" to show how it is used in practice

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no closing tag for this syntax.

* To signal danger of pitfalls or call attention to an important piece of information that is crucial to follow:

```liquid
{{ "{% warn " }}%}
Copy link
Contributor

Choose a reason for hiding this comment

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

add an warning text and a closing "tag" to show how it is used in practice


Adding links to documentation is an effective way to guide the user into a better understanding of the topic being discussed without the risk of overwriting.

* **Links between sections in the page.** Each heading generates an implicit identifier to directly link it within a page. This identifier is generated by making the heading lowercase and replacing internal spaces with hyphens.
Copy link
Contributor

Choose a reason for hiding this comment

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

Links between -> Links to

[Link Text](#heading-title)
```

* **Links between files in the repository.** The base relative path to the domain of the documentation is available as a configuration variable named `baseurl`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Links to other pages of the Flink documentation?

[Link Text]({{ "{{ site.baseurl " }}}}/path/to/link_page.html)
```

* **External links**
Copy link
Contributor

Choose a reason for hiding this comment

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

Links to external pages?

```html
<div class="codetabs" markdown="1">

<div data-lang="java" markdown="1"> … </div>
Copy link
Contributor

Choose a reason for hiding this comment

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

expand example and show that syntax highlighting needs to be enabled here as well:

<div class="codetabs" markdown="1">

  <div data-lang="java" markdown="1">
{% highlight java%} 
// Java Code
{% endhighlight%}
  </div>

  <div data-lang="scala" markdown="1">
{% highlight scala%} 
// Scala Code
{% endhighlight%}
  </div>

</div>

In the documentation build, the **Table Of Contents** (TOC) is automatically generated from the headings of the page using the following line of markup:

```liquid
{{ "{% toc " }}%}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is interesting, the Flink website uses {% toc %} while the Flink Documentation uses {:toc}, for the doc we should probably stick to {:toc} then.


* To highlight a tip or piece of information that may be helpful to know:

```liquid
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no closing tag for this syntax.

It's recommended to use Back to Top links at least at the end of each Level-2 section.
</div>

### Annotations
Copy link
Contributor

Choose a reason for hiding this comment

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

This means we want to move away completely from the block-style highlight blocks that are used, for example, in https://ci.apache.org/projects/flink/flink-docs-master/dev/stream/state/broadcast_state.html?


* **Use active voice.** [Active voice](https://medium.com/@DaphneWatson/technical-writing-active-vs-passive-voice-485dfaa4e498) supports brevity and makes content more engaging. If you add _by squirrels_ after the verb in a sentence and it still makes sense, you are using the passive voice.

* **Use you, never we.** Using _we_ can be confusing and patronizing to some users, giving the impression that “we are all members of a secret club and _you_ didn’t get a membership invite”. Address the user as _you_.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a rough estimate of how much of the documentation is written using you vs more passive constructions?

Copy link
Contributor

Choose a reason for hiding this comment

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

The docs are all over the place but I've been pushing this pretty hard in my reviews the past few months.

@morsapaes
Copy link
Contributor Author

The original fork is gone, so I'll just close this PR and open a new one, already incorporating all your suggested changes.

See you on the other side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants