As Fuchsia evolves, there is a need to deprecate documentation for deprecated features or out-of-date documentation.
Establish a deprecation timeline
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:
Deprecate a document in its markdown file
To mark a document as deprecated in markdown file:
Locate the title of the page which is prefixed with a
#. For example:# Deprecating documentationAdd the following
includestatement below the title of the document. For example:# Deprecating documentation {% include "fuchsia-src/_common/_deprecation_notice.md" %}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.
Deprecate a document in the navigation
To mark a document as deprecated in a _toc.yaml file:
Locate the
_toc.yamlfile that references the documentation that you are deprecating. For example:- title: "Deprecating documentation" path: /docs/contribute/docs/deprecating-docs.mdAdd a key/value pair of
status: deprecatedunder the title of the page. For example:- title: "Deprecating documentation" status: deprecated path: /docs/contribute/docs/deprecating-docs.mdSubmit the changes (document and TOC deprecation) to the Fuchsia repository.
Redirect the pages to the deprecation notice
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
grepcommand.Update or remove any links in documentation that references the pages that you are deprecating.
Use
git rmto remove the documents that you are deprecating. For example:git rm docs/contribute/docs/deprecating-docs.mdLocate the
_toc.yamlfiles where the documents are referenced and remove the entries for the deprecated documents.Ensure that
doc-checkerpasses. Runfx format-codeto run doc-checker:fx format-codeFix any issues that
doc-checkermay signal.In the
/docs/_common/_deprecated-docs.yamlfile, 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:# May 13th, 2022 # Deprecating documentation around deprecation - from: /docs/contribute/docs/deprecating-docs.md to: /docs/contribute/docs/deprecation-notice.mdSubmit the changes to the Fuchsia repository.