Skip to content

Commit

Permalink
feat: added ability to default to no title
Browse files Browse the repository at this point in the history
fix: fixed error that could happen when editing admonitions
feat: added per-admonition copy button setting (close #118)
feat: added setting to turn off title parsing (close #123)
  • Loading branch information
valentine195 committed Nov 22, 2021
1 parent ab83fb4 commit 0983790
Show file tree
Hide file tree
Showing 8 changed files with 365 additions and 244 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,13 @@ Commands may be registered for each custom admonition type to insert them into a

See [this section](#register-and-unregister-commands) for more information.

### Mermaid Graphs

Mermaid graphs are supported by Admonitions, but with some caveats:

1. You cannot combine mermaid graphs and embeds/transclusions.
2. Mermaid graphs do not work in collapsed-by-default admonitions.

## Non-code block Admonitions

As of version 6.0.0, there is a new setting: Enable Non-codeblock Admonitions.
Expand Down
19 changes: 19 additions & 0 deletions src/@types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface Admonition {
color: string;
command: boolean;
injectColor: boolean;
noTitle: boolean;
copy: boolean;
}

export interface INestedAdmonition {
Expand All @@ -29,6 +31,7 @@ export interface ISettingsData {
version: string;
enableMarkdownProcessor: boolean;
injectColor: boolean;
parseTitles: boolean;
}

export type AdmonitionIconDefinition = {
Expand Down Expand Up @@ -61,6 +64,22 @@ export declare class ObsidianAdmonitionPlugin extends Plugin_2 {
): void;
unregisterCommandsFor(admonition: Admonition): void;
registerCommandsFor(admonition: Admonition): void;
getAdmonitionElement(
type: string,
title: string,
icon: AdmonitionIconDefinition,
color?: string,
collapse?: string,
id?: string
): HTMLElement;
getAdmonitionElementAsync(
type: string,
title: string,
icon: AdmonitionIconDefinition,
color?: string,
collapse?: string,
id?: string
): Promise<HTMLElement>;
}

export type RPGIconName =
Expand Down
12 changes: 11 additions & 1 deletion src/lang/locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,15 @@ export default {
"There was an error parsing the image.",
"Admonition Icon": "Admonition Icon",
Color: "Color",
Save: "Save"
Save: "Save",
"No Admonition Title by Default": "No Admonition Title by Default",
"The admonition will have no title unless ":
"The admonition will have no title unless ",
" is explicitly provided.": " is explicitly provided.",
"Show Copy Button": "Show Copy Button",
"A copy button will be added to the admonition.":
"A copy button will be added to the admonition.",
"Parse Titles as Markdown": "Parse Titles as Markdown",
"Admonition Titles will be rendered as markdown.":
"Admonition Titles will be rendered as markdown."
};
Loading

0 comments on commit 0983790

Please sign in to comment.