I'm currently working as a Clojure developer at Splash Finacial.
cfclrk / markdown-xwidget Goto Github PK
View Code? Open in Web Editor NEWEmacs package for markdown preview using xwidgets
License: GNU General Public License v3.0
Emacs package for markdown preview using xwidgets
License: GNU General Public License v3.0
I'm currently working as a Clojure developer at Splash Finacial.
GitHub recognizes a special syntax for some emojis. For example: :x:
is rendered as โ.
For a complete list, see the emoji cheat sheet.
Should markdown-xwidget
do the same? And how does GitHub accomplish this rendering?
EDIT: Some more info:
Ok, apparently these icons are called octicons. Hopefully this is just another javascript source to add. Perhaps its inclusion should be optional?
Given the .md file path /my/a.md
, with custom path prefix ~/tmp
, then the .html file path would be ~/tmp/my/a.md
.
This can make status of git repos containing .md files clean.
Otherwise, you end up with errors in the html.
When markdown-xwidget-preview-mode
is enabled and I kill the xwidget-webkit buffer (say, by just doing a C-x k
in that buffer), the xwidget-webkit buffer is killed, but markdown-xwidget-preview-mode
remains enabled.
So, if I make a change to the markdown file and save it, a new xwidget-webkit buffer pops up.
Ideally, explicitly killing the xwidget-webkit buffer should disable markdown-xwidget-preview-mode
in the corresponding markdown buffer.
I saw your post on Reddit and this package looks really interesting!
I built emacs 28.2 from source with xwidget support.
I normally use exwm, although I tried in i3 as well.
In both cases, when I enabled xwidget mode on a simple markdown file, emacs crashed immediately.
Let me know if I can provide any further information or logs.
Thanks @andykuszyk for noticing this issue! Continues discussion from #6.
Mermaid diagrams are blank when markdown-xwidget-command
is set to "pandoc". When run against example.md, pandoc creates some HTML that looks like this:
<pre class="mermaid"><code>graph LR
A --> B
B --> C</code></pre>
This doesn't work with mermaid, because the class
attribute needs to be on the element that directly contains the graph (so on the <code>
block).
In contrast, multimarkdown creates HTML like this, which does work with mermaid:
<pre><code class="mermaid">graph LR
A --> B
B --> C
</code></pre>
Every time I make a change to a markdown file and save it, the xwidget-webkit buffer refreshes with the new contents. And every time it refreshes, it starts at the top of the page again.
This is super duper annoying!
Is there a way to maintain the current position of the xwidget-webkit buffer when it refreshes?
Whenever I run M-x markdown-xwidget-preview-mode
I only get
Opening input file: No such file or directory, /home/pascal/.config/emacs/.local/straight/build-29.1/markdown-xwidget/resources/header.html
I am runnig emacs 29.1-r6 with Doom.
I installed markdown-xwidget with Doom straight package manager, if that matters.
I can use xwidgets fine with xwidget-webkit-browse-url
I have markdown-xwidget-command
set to pandoc and pandoc is installed (3.1.9)
Do I need to do anything else? I thought markdown-xwidget is going to generate that html page by itself.
GitHub recognizes a special blockquote syntax for notes and warnings, as discussed here: community/community#16925.
Example:
> **Warning**
> It's important to specify the `:files` directive! Without it, the non-elisp
> files (CSS and HTML) won't be copied to the right place.
Renders as:
Warning
It's important to specify the:files
directive! Without it, the non-elisp
files (CSS and HTML) won't be copied to the right place.
Should markdown-xwidget
do the same? And how does GitHub do that?
EDIT: Some more info:
<blockquote>
<p dir="auto">
<span class="color-fg-attention">
<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true">
<path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z">
</path>
</svg>Warning
</span>
<br>
It's important to specify the
<code class="notranslate">:files
</code> directive! Without it, the non-elisp
<br>
files (CSS and HTML) won't be copied to the right place.
</p>
</blockquote>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.