Skip to content

Commit

Permalink
Tables in markdown are now styled, fixes #2366
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Aug 20, 2023
1 parent 57394d0 commit f9fd1ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Fixed misleading type annotation on `Theme.getUrls`, #2318.
- Fixed duplicate namespace in documentation if `@namespace` is used on a variable with an associated namespace, #2364.
- Fixed `@namespace` property discovery if merged with a type and the type was declared first #2364.
- Tables in markdown are now styled, #2366.
- Symbol locations for signatures on `reflection.sources` now considers the node's name like non-signature location discovery does.

### Thanks!
Expand Down
20 changes: 0 additions & 20 deletions src/lib/output/themes/default/partials/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@ import { camelToTitleCase } from "../../lib";

// Note: Comment modifiers are handled in `renderFlags`

export function comment({ markdown }: DefaultThemeRenderContext, props: Reflection) {
if (!props.comment?.hasVisibleComponent()) return;

const tags = props.kindOf(ReflectionKind.SomeSignature)
? props.comment.blockTags.filter((tag) => tag.tag !== "@returns")
: props.comment.blockTags;

return (
<div class="tsd-comment tsd-typography">
<Raw html={markdown(props.comment.summary)} />
{tags.map((item) => (
<>
<h3>{camelToTitleCase(item.tag.substring(1))}</h3>
<Raw html={markdown(item.content)} />
</>
))}
</div>
);
}

export function commentSummary({ markdown }: DefaultThemeRenderContext, props: Reflection) {
if (!props.comment?.summary.some((part) => part.text)) return;

Expand Down
13 changes: 11 additions & 2 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
--light-color-ts-accessor: var(--light-color-ts-property);
--light-color-ts-get-signature: var(--light-color-ts-accessor);
--light-color-ts-set-signature: var(--light-color-ts-accessor);
/* object literal not included as it is not used and will be removed in 0.25 */
--light-color-ts-type-alias: #d51270;
/* reference not included as links will be colored with the kind that it points to */

Expand Down Expand Up @@ -72,7 +71,6 @@
--dark-color-ts-accessor: var(--dark-color-ts-property);
--dark-color-ts-get-signature: var(--dark-color-ts-accessor);
--dark-color-ts-set-signature: var(--dark-color-ts-accessor);
/* object literal not included as it is not used and will be removed in 0.25 */
--dark-color-ts-type-alias: #ff6492;
/* reference not included as links will be colored with the kind that it points to */

Expand Down Expand Up @@ -485,6 +483,17 @@ blockquote {
.tsd-typography ol {
margin: 1em 0;
}
.tsd-typography table {
border-collapse: collapse;
border: none;
}
.tsd-typography td, .tsd-typography th {
padding: 6px 13px;
border: 1px solid var(--color-accent);
}
.tsd-typography thead, .tsd-typography tr:nth-child(even) {
background-color: var(--color-background-secondary);
}

.tsd-breadcrumb {
margin: 0;
Expand Down

0 comments on commit f9fd1ea

Please sign in to comment.