Skip to content

doc: unify section structures

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

We had two docs with slight deviations from the common section structure concerning:

  • class <-> constructor hierarchy;
  • method's callback signature and description.

There are 'before' and 'after' states:

  1. string_decoder.md
String Decoder
  Class: new StringDecoder([encoding])
    stringDecoder.end([buffer])
    stringDecoder.write(buffer)
String Decoder
  Class: StringDecoder
    new StringDecoder([encoding])
    stringDecoder.end([buffer])
    stringDecoder.write(buffer)
  1. perf_hooks.md
Class: PerformanceObserver(callback)
  Callback: PerformanceObserverCallback(list, observer)
  Class: PerformanceObserverEntryList
    performanceObserverEntryList.getEntries()
    performanceObserverEntryList.getEntriesByName(name[, type])
    performanceObserverEntryList.getEntriesByType(type)
  performanceObserver.disconnect()
  performanceObserver.observe(options)
Examples
Class: PerformanceObserver
  new PerformanceObserver(callback)
  performanceObserver.disconnect()
  performanceObserver.observe(options)
Class: PerformanceObserverEntryList
  performanceObserverEntryList.getEntries()
  performanceObserverEntryList.getEntriesByName(name[, type])
  performanceObserverEntryList.getEntriesByType(type)
Examples

with Callback: PerformanceObserverCallback(list, observer) incorporated in the parent section as we usually do for all the callbacks.

These changes also help tools/doc/json.js to parse and JSON-ize the docs more properly.

Merge request reports

Loading