diff --git a/lua/voltage/highlights/plugins/render-markdown.lua b/lua/voltage/highlights/plugins/render-markdown.lua new file mode 100644 index 0000000..9d4adbb --- /dev/null +++ b/lua/voltage/highlights/plugins/render-markdown.lua @@ -0,0 +1,15 @@ +local M = {} + +function M.setup(colors, config) + local accent = colors[config.accent] + + return { + RenderMarkdownCode = { bg = accent.darkest }, + RenderMarkdownCodeBorder = { fg = colors.magenta.light, bg = colors.magenta.darker }, + RenderMarkdownCodeFallback = { fg = colors.fg }, + RenderMarkdownCodeInline = { fg = colors.magenta.light, bg = colors.magenta.darker }, + RenderMarkdownInlineHighlight = { fg = colors.yellow.light, bg = colors.yellow.darker } + } +end + +return M diff --git a/lua/voltage/init.lua b/lua/voltage/init.lua index e299697..1bd22fb 100644 --- a/lua/voltage/init.lua +++ b/lua/voltage/init.lua @@ -97,7 +97,7 @@ function M.setup(opts) end end - for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini" }) do + for _, highlight in ipairs({ "netrw", "fzf", "blink", "mini", "render-markdown" }) do local mod = require("voltage.highlights.plugins." .. highlight) for group, group_opts in pairs(mod.setup(colors, M.config)) do diff --git a/tests/markdown.md b/tests/markdown.md index 895bde6..e83aceb 100644 --- a/tests/markdown.md +++ b/tests/markdown.md @@ -1,3 +1,264 @@ -# Title +# Markdown Test File - All Elements for Color Scheme Testing -This is **bold** and this is a [link](https://example.com) +## Headings + +# Heading 1 +## Heading 2 +### Heading 3 +#### Heading 4 +##### Heading 5 +###### Heading 6 + +--- + +## Text Formatting + +**Bold text** + +*Italic text* + +***Bold and italic*** + +~~Strikethrough~~ + +`Inline code` + +==Highlighted text== + +H~2~O (subscript) + +X^2^ (superscript) + + +--- + +## Lists + +### Unordered List +- Item 1 +- Item 2 + - Nested Item 2.1 + - Nested Item 2.2 +- Item 3 + +### Ordered List +1. First item +2. Second item + 1. Nested First + 2. Nested Second +3. Third item + +### Task List +- [x] Completed task +- [ ] Incomplete task +- [ ] Another task + +--- + +## Code Blocks + +Inline `code` example. + +```python +# Python code block +def hello_world(): + print("Hello, World!") + return True +``` + +```javascript +// JavaScript code block +const greet = (name) => { + console.log(`Hello, ${name}!`); +}; +``` + +```bash +# Shell commands +ls -la +echo "Hello" +``` + +``` +Plain text code block +with multiple lines +``` + +--- + +## Blockquotes + +> This is a blockquote. +> It can span multiple lines. + +> Nested blockquote: +> > Deeper level + +--- + +## Links and Images + +[Regular link](https://example.com) + +[Link with title](https://example.com "Example Title") + +![Image alt text](https://example.com/image.png) + +![Image with title](https://example.com/image.png "Image Title") + + (bare URL) + +--- + +## Tables + +| Syntax | Description | Test Text | +|--------|-------------|-----------| +| Header | Title | Here's this | +| Paragraph | Text | And more | +| `Code` | **Bold** | *Italic* | + +| Left-aligned | Center-aligned | Right-aligned | +|:-------------|:--------------:|--------------:| +| Left | Center | Right | +| Data | More Data | Even More | + +--- + +## Horizontal Rules + +___ + +--- + +*** + +--- + +## Footnotes + +Here's a sentence with a footnote. [^1] + +[^1]: This is the footnote text. + +Another footnote reference. [^2] + +[^2]: Second footnote. + +--- + +## HTML Elements + +HTML span + +
HTML div block
+ +Keyboard input + +
+Click to expand +Hidden content here. +
+ +--- + +## Escaped Characters + +\*This is not italic\* + +\# Not a heading + +\[Not a link\](https://example.com) + +\`Not code\` + +--- + +## Emoji + +:smile: :heart: :rocket: :+1: :tada: + +--- + +## Definition Lists + +Term 1 +: Definition 1 + +Term 2 +: Definition 2a +: Definition 2b + +--- + +## Mixed Content + +This is a **paragraph** with *various* `elements` [link](#) and ![image](image.png). + +- List with **bold** and *italic* items +- Another `code` item +- [Link in list](#) + +> Blockquote with **formatting** and `code` + +```python +# Code with "quotes" and 'apostrophes' +print("Hello, 'World'!") +``` + +--- + +## Long Content for Scrolling + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. Nullam auctor, nisl eget ultricies tincidunt, nisl nisl aliquam nisl, eget ultricies nisl nisl eget nisl. + +### Subsection with Code + +```css +/* CSS example */ +body { + background-color: #ffffff; + color: #333333; +} +``` + +### Another Subsection + +- Item +- Item +- Item + +--- + +## Edge Cases + +### Empty Elements + +#### Empty code block +``` +``` + +#### Empty blockquote +> + +#### Empty list items +- +- + +### Special Characters + +* * * + +_ _ _ + +** ** + +__ __ + +` ` ` + +--- + +## End of File