Skip to content

Conversation

@DominicGBauer
Copy link
Contributor

@DominicGBauer DominicGBauer commented May 30, 2024

Description

Add the following enhancements to docs:

  • Remove returns section
  • Remove inherited from section
  • Remove type parameters section
  • Reduce padding of table cells
  • Added config to hide private and protected properties (reason being that I think this doesn't add value to the user reading the docs)
  • Expand objects so there is no need for a table explaining what is in the object

Notes on removals

The autogeneration process works as follows:

  1. Docs are autogenerated from JSDoc code comments and typescript into HTML by typedoc.
  2. typedoc-plugin-markdown plugin to instead convert to markdown instead of HTML.
  3. docusaurus-plugin-typedoc is then used to convert the markdown into Docusaurus friendly markdown.

We have little leeway with the theme as these are the only options available to edit the markdown output and UX - typedoc and typedoc-plugin-markdown. As such there are two places we can remove the output, either when the markdown is created or using CSS applied when the docusaurus page is served. Ideally we would do it when the markdown is created however the only way to do this is to create a custom plugin which can hook into the markdown page creation but has limited selection functionality e.g.

export function load(app) {
  app.renderer.on(MarkdownPageEvent.END, (page: MarkdownPageEvent) => {
    page.contents = page.contents.replace('## Returns', '');
  });
}

Therefore to remove things we would need to follow this kind of pattern page.contents = page.contents.replace('## Returns', ''); which is difficult to deal with and could result in unintended consequences. Therefore I have opted to instead use CSS ID's to hide the content as this is more specific and not reliant on text which may change.

Dependencies

  • Docusaurus dependencies have been upgraded to 3.3
  • Typedoc dependencies have been updated to latest stable versions

Screenshots

  1. Full width parameters table
image
  1. Removed type parameters and returns
image
  1. Removed inherited from
    Before
image

After
image

  1. Object expanded and table removed
    Before
image

After
image

@DominicGBauer DominicGBauer self-assigned this May 30, 2024
@DominicGBauer DominicGBauer marked this pull request as draft May 30, 2024 13:55
@DominicGBauer DominicGBauer marked this pull request as ready for review May 30, 2024 14:21
@DominicGBauer DominicGBauer merged commit 42e9943 into main Jun 5, 2024
@DominicGBauer DominicGBauer deleted the chore/improve-docs-30-05 branch June 5, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants