Skip to content

Commit

Permalink
Add htmlLang option
Browse files Browse the repository at this point in the history
Closes #1951.
  • Loading branch information
Gerrit0 committed Jul 1, 2022
1 parent c75aa02 commit 90a9526
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@

### Features

- Added `--htmlLang` option to set the [`lang`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) attribute in the generated HTML. Defaults to `en`, #1951.
- Added support for TypeDoc specific `:getter` and `:setter` meaning keywords in declaration references.
- Warnings caused by comment contents will now do a better job of including the location of the text that caused the warning.

Expand Down
2 changes: 1 addition & 1 deletion src/lib/output/themes/default/layouts/default.tsx
Expand Up @@ -4,7 +4,7 @@ import type { PageEvent } from "../../../events";
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";

export const defaultLayout = (context: DefaultThemeRenderContext, props: PageEvent<Reflection>) => (
<html class="default">
<html class="default" lang={context.options.getValue("htmlLang")}>
<head>
<meta charSet="utf-8" />
{context.hook("head.begin")}
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/declaration.ts
Expand Up @@ -123,6 +123,7 @@ export interface TypeDocOptionMap {
gitRemote: string;
gaID: string;
githubPages: boolean;
htmlLang: string;
hideGenerator: boolean;
cleanOutputDir: boolean;

Expand Down
6 changes: 6 additions & 0 deletions src/lib/utils/options/sources/typedoc.ts
Expand Up @@ -250,6 +250,12 @@ export function addTypeDocOptions(options: Pick<Options, "addDeclaration">) {
type: ParameterType.Boolean,
defaultValue: true,
});
options.addDeclaration({
name: "htmlLang",
help: "Sets the lang attribute in the generated html tag.",
type: ParameterType.String,
defaultValue: "en",
});
options.addDeclaration({
name: "gaID",
help: "Set the Google Analytics tracking ID and activate tracking code.",
Expand Down

0 comments on commit 90a9526

Please sign in to comment.