As Fuchsia evolves, there is a need to deprecate documentation for deprecated features or out-of-date documentation.
Before removing documentation, it is important to establish a deprecation timeline and notify users. In general, it is recommended to remove documentation after a deprecation period of 6 months.
To begin the deprecation process and notify users:
To mark a document as deprecated in markdown file:
Locate the title of the page which is prefixed with a #
. For example:
# Deprecating documentation
Add the following include
statement below the title of the document. For example:
# Deprecating documentation {% verbatim %} {% include "docs/_common/_deprecation_notice.md" %} {% endverbatim %}
Include information about the deprecation for users such as the reasoning behind the deprecation. Also, include any new tools or features that may now be in place instead of the deprecated feature.
Note: For more information on working with the fuchsia.dev navigation, see Updating site navigation and TOC files.
To mark a document as deprecated in a _toc.yaml
file:
Locate the _toc.yaml
file that references the documentation that you are deprecating. For example:
Note: By convention, the _toc.yaml
file should be in the same directory as the markdown file that you are deprecating.
- title: "Deprecating documentation" path: /docs/contribute/docs/deprecating-docs.md
Add a key/value pair of status: deprecated
under the title of the page. For example:
- title: "Deprecating documentation" status: deprecated path: /docs/contribute/docs/deprecating-docs.md
Submit the changes (document and TOC deprecation) to the Fuchsia repository.
After the deprecation timeline has passed, delete the pages and redirect them.
To delete the pages and redirect:
Search for any links that reference the pages that you are removing. For example:
grep -r "/docs/contribute/docs/deprecating-docs.md" ~/fuchsia/docs/
This lists all the documents that link to the page from the grep
command.
Update or remove any links in documentation that references the pages that you are deprecating.
Use git rm
to remove the documents that you are deprecating. For example:
git rm docs/contribute/docs/deprecating-docs.md
Locate the _toc.yaml
files where the documents are referenced and remove the entries for the deprecated documents.
Ensure that doc-checker
passes. Run fx format-code
to run doc-checker:
fx format-code
Fix any issues that doc-checker
may signal.
In the [/docs/_common/_deprecate-docs.yaml][deprecate-docs]
file, create a redirect for the deprecated pages to the deprecation notice page. Also include a comment listing the deprecate feature with a deprecation date. For example:
Note: # Using ? or * is not supported in the redirect links.
# May 13th, 2022 # Deprecating documentation around deprecation - from: /docs/contribute/docs/deprecating-docs.md to: /docs/contribute/docs/deprecation-notice.md
Submit the changes to the Fuchsia repository.