Is it possible to render the navigation pane on the left?

This issue has been tracked since 2023-03-03.

Is there any way to render the site with the two main panes reversed, i.e. with the navigation pane on the left?

I know that this is a subjective matter, but most sites (including https://typedoc.org/guides/overview/!) has the navigation tree in the left pane.

Thank you!

Gerrit0 wrote this answer on 2023-03-05

You could do this pretty easily with the customCss option

.container-main {
  flex-direction: row-reverse;
}

@media (min-width: 1024px) {
  .col-content {
    padding-left: 2rem;
    padding-right: 0;
  }
  .col-menu {
    border-left: 0;
    border-right: 1px solid var(--color-accent);
  }
}
ilg-ul wrote this answer on 2023-03-05

Thank you, this customCss solved the problem.

In case others find this useful too, perhaps it could be automated with an option to directly generate these CSS definitions.

ilg-ul wrote this answer on 2023-03-05

For those interested to see how a site with the navigation pane on the left looks like, here is my first such project:

Gerrit0 wrote this answer on 2023-03-05

Adding a flag for every possible configuration is something I do my best to avoid -- goal is to provide a sufficiently customizable output without having to support & test every possible combination on release. (Particularly true for the theme output, since tests there aren't easy to maintain in a useful way)

ilg-ul wrote this answer on 2023-03-05

I see.

From a maintainer point of view, you are right, customisation options are indeed more difficult to maintain.

However, you should also consider the user perspective; CSS knowledge is at premium and few users are able to create a configuration like the one you suggested before.

If you do not think that customisable theme options are the solution, at least consider adding a page in the documentation with possible custom CSS configurations (start with this one), such that users can directly use them without having to ask for support.

Gerrit0 wrote this answer on 2023-03-05

If multiple people are using the same css it'd probably be better to create a custom theme and release that. https://typedoc.org/guides/themes/

typedoc --plugin ./left-nav-theme.js --theme left-nav 
// @ts-check
// CC0

const td = require("typedoc");
const fs = require("fs");
const { join } = require("path");

const css = `
.container-main {
  flex-direction: row-reverse;
}

@media (min-width: 1024px) {
  .col-content {
    padding-left: 2rem;
    padding-right: 0;
  }
  .col-menu {
    border-left: 0;
    border-right: 1px solid var(--color-accent);
  }
}
`;

class LeftNavigationTheme extends td.DefaultTheme {
  /** @param {td.Renderer} renderer */
  constructor(renderer) {
    super(renderer);

    renderer.once(
      td.Renderer.EVENT_END,
      /** @param {td.RendererEvent} event */
      (event) => {
        const styleCss = join(event.outputDirectory, "assets/style.css");
        fs.appendFileSync(styleCss, css);
      }
    );
  }
}

/** @param {td.Application} app */
exports.load = function (app) {
  app.renderer.defineTheme("left-nav", LeftNavigationTheme);
};
ilg-ul wrote this answer on 2023-03-05

That's a great idea, a theme would be definitely preferred.

Unfortunately I have no experience with TypeDoc themes (and poor experience with web sites in general), so I might not be the one that can do it at an acceptable quality level. :-(

Dayday10 wrote this answer on 2023-03-05
More Details About Repo
Owner Name TypeStrong
Repo Name typedoc
Full Name TypeStrong/typedoc
Language TypeScript
Created Date 2014-05-24
Updated Date 2023-03-19
Star Count 6487
Watcher Count 68
Fork Count 639
Issue Count 48

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date