Deprecating documentation
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 {#deprecate-doc}
To mark a document as deprecated in markdown file:
- Locate the title of the page which is prefixed with a
#. For example:
none {:.devsite-disable-click-to-copy}
# Deprecating documentation
- Add the following
includestatement below the title of the document. For example:
none {:.devsite-disable-click-to-copy}
# 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.
- Mark the document as deprecated in the navigation.
Deprecate a document in the navigation {#deprecate-toc}
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.yamlfile 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.
none {:.devsite-disable-click-to-copy}
- title: "Deprecating documentation"
path: /contribute/docs/deprecating-docs.md
- Add a key/value pair of
status: deprecatedunder the title of the page. For example:
none {:.devsite-disable-click-to-copy}
- title: "Deprecating documentation"
status: deprecated
path: /contribute/docs/deprecating-docs.md
- Submit 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:
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 rmto remove the documents that you are deprecating. For example:
-
Locate 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:
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][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: /contribute/docs/deprecating-docs.md
to: /contribute/docs/deprecation-notice.md
- Submit the changes to the Fuchsia repository.
deprecate-docsdeprecation-notice