Skip to content

Commit

Permalink
Merge pull request #125 from brianhuster/dev
Browse files Browse the repository at this point in the history
Syntax highlighting for code block in markdown, asciidoc
  • Loading branch information
brianhuster authored Oct 17, 2024
2 parents 169be32 + a1857c1 commit ab3e501
Show file tree
Hide file tree
Showing 11 changed files with 1,690 additions and 434 deletions.
9 changes: 2 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
### Breaking changes
`require('live-preview')` is deprecated (but still usable). Use `require('livepreview')` instead.

For help, use `:help livepreview` instead of `:help live-preview`.

### New features

Improve performance
Code block syntax highlighting in markdown and Asciidoc files

Fix some errors with Katex renderings
**⚠️ Important Notice:** You must clear the cache of the browser after updating to ensure the plugin works correctly.
12 changes: 7 additions & 5 deletions lua/livepreview/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ local html_template = function(body, stylesheet, script_tag)
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live preview</title>
]] .. stylesheet .. [[
]] .. script_tag .. [[
<link rel="stylesheet" href="/live-preview.nvim/static/katex/katex.min.css">
<link rel="stylesheet" href="/live-preview.nvim/static/katex/katex.min.css">
<script defer src="/live-preview.nvim/static/katex/katex.min.js"></script>
<script defer src="/live-preview.nvim/static/katex/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
<script src="/live-preview.nvim/static/mermaid/mermaid.min.js"></script>
<link rel="stylesheet" href="/live-preview.nvim/static/highlight/default.min.css">
<script defer src="/live-preview.nvim/static/highlight/highlight.min.js"></script>
<script defer src='/live-preview.nvim/static/ws-client.js'></script>
]] .. script_tag .. [[
</head>
<body>
Expand All @@ -33,9 +35,9 @@ end

M.md2html = function(md)
local script = [[
<script defer src="/live-preview.nvim/static/markdown/marked.min.js"></script>
<script defer src='/live-preview.nvim/static/markdown/main.js'></script>
]]
<script defer src='/live-preview.nvim/static/markdown/markdown-it.min.js'></script>
<script defer src='/live-preview.nvim/static/markdown/main.js'></script>
]]
local stylesheet = [[
<link rel="stylesheet" href="/live-preview.nvim/static/markdown/github-markdown.min.css">
]]
Expand Down
15 changes: 15 additions & 0 deletions scripts/gen_vimdoc.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/usr/bin/env -S nvim -l
-- Copyright Neovim contributors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

--- Generates Nvim :help docs from Lua/C docstrings
---
--- The generated :help text for each function is formatted as follows:
Expand Down
Loading

0 comments on commit ab3e501

Please sign in to comment.