-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor markdown table generation (#57)
- Loading branch information
1 parent
6e27284
commit 4fa5767
Showing
4 changed files
with
58 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { MarkdownString } from 'vscode'; | ||
|
||
/** | ||
* Create specific table header (2 columns, left aligned) | ||
* for the tree view item hover. | ||
*/ | ||
export function generateMarkdownTableHeader(markdown: MarkdownString) { | ||
markdown.appendMarkdown('Property | Value\n'); | ||
markdown.appendMarkdown(':--- | :---\n'); | ||
} | ||
/** | ||
* Create markdown table row (only if value is not equal `undefined`) | ||
*/ | ||
export function generateMarkdownTableRow(propertyName: string, propertyValue: string | boolean | undefined, markdown: MarkdownString) { | ||
if (propertyValue === undefined) { | ||
return; | ||
} | ||
markdown.appendMarkdown(`${propertyName} | ${propertyValue}\n`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters