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
Conversation
Sync with upstream repo.
Proposing a guide to support and standardize documentation contributions.
There was a problem hiding this 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.
… statement in every documentation file.
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.
There was a problem hiding this 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.
I'm having a look right now. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 " }}%} |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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** |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 " }}%} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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_. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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. |
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:
@Public(Evolving)
: noDocumentation