googleapis / doc-pipeline

Apache License 2.0
10 stars 11 forks source link

feat: add style support for "deprecated" #557

Open bshaffer opened 1 year ago

bshaffer commented 1 year ago

The property and value status: deprecated works in the TOC to mark certain classes/pages as deprecated. When a class, method, or parameter have status: deprecated we should have a similar way to mark stylistically that it's deprecated.

syntax:
      parameters:
        -
          id: data
          var_type: array
          description: 'Optional. Data for populating the Message object.'
          status: deprecated

This would render html like the following:

<tr>
      <td><code>{{{id}}}</code></td>
      <td>
        <code>{{#var_type}}{{{var_type}}}{{/var_type}}{{^var_type}}{{{type.specName.0.value}}}{{/var_type}}</code>
        <br>
        {{{description}}}
        {{>partials/uref/parameters}}
 {{if status == deprecated}}
 <aside class="deprecated">
  <b>Deprecated:</b> A note or tip for a deprecated feature, product, or service.
 </aside>
 {{/if status == deprecated}} 
      </td>
    </tr>

A feature like this would be useful for all languages!