Code Monkey home page Code Monkey logo

markdown-xwidget's Introduction

markdown-xwidget's People

Contributors

aarchangel64 avatar cfclrk avatar hexmode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

markdown-xwidget's Issues

Render GitHub emojis

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?

Write .html file to custom path prefix

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.

Killing the xwidget buffer doesn't turn off minor mode

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.

Emacs crashes when xwidget mode is enabled

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.

Mermaid not working with pandoc

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 --&gt; B
  B --&gt; 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 --&gt; B
  B --&gt; C
</code></pre>

Xwidget buffer scrolls to top of page on refresh

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?

Can not find header.html

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.

Render GitHub note/warning blocks

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.