toland / qlmarkdown Goto Github PK
View Code? Open in Web Editor NEWQuickLook generator for Markdown files.
QuickLook generator for Markdown files.
Ok, I thought that this project would be gone by now, because
Since people are still around, I'm going to recompile it. However, I'm on Yosemite, and I want to know how many versions back I need to support. Please send me your infos and I'll start setting up a Travis build system.
# Get the infos
system_profiler SPSoftwareDataType
# --or--
# Directly into clipboard (pasteboard)
system_profiler SPSoftwareDataType | pbcopy
Here's mine:
System Software Overview:
System Version: OS X 10.10.3 (14D136)
Kernel Version: Darwin 14.3.0
When MacVim is installed it registers an org.vim.markdown-file
UTI to handle .markdown
filename extension (not net.daringfireball.markdown
). Subsequently the system treats .markdown
files as that, which breaks QLMarkdown for these files (the system Text.qlgenerator is getting the files instead).
Can easily be fixed by appending the above UTI to LSItemContentTypes
in the bundle's Info.plist
.
Bug originally noticed when installing QLColorCode [http://code.google.com/p/qlcolorcode/issues/detail?id=50] and traced back here with the help of the person responsible for it. He also says that only public.plain-text
is necessary in the UTTypeConformsTo
section of the Info.plist
.
Currently updating discount dirties up the tree pretty badly. Can we either change it to be a real submodule (now that git submodules are friendlier) or add it to the .gitignore
?
Please +1 π if you agree. I'm hoping to generate conversation that will eventually result in cleaning up the git status
output.
@toland I'm very curious if you still stand by your original idea of making it a fake submodule.
First, thanks for the neat plugin!
Currently the plugin renders a .md file and up to one modification of that .md file. After watching the render window for five minutes, no more re-rendering occurs. Any file-modifications (like if I edit the .md file) are not propagated to the QuickLook window.
I desire for the QuickLook window to refresh upon each change (forward in time, backwards in time) to the file modification date.
OSX 10.10.5. QLMarkdown version:
~/frameworks/qlmarkdown (master)$ brew cask info qlmarkdown
qlmarkdown: 1.3.3
QLMarkdown
https://github.com/toland/qlmarkdown
/opt/homebrew-cask/Caskroom/qlmarkdown/1.3.3 (9 files, 196K)
https://github.com/caskroom/homebrew-cask/blob/master/Casks/qlmarkdown.rb
==> Contents
QLMarkdown.qlgenerator (qlplugin)
Q: Is this something handled by the plugin or by QuickLook framework itself?
Hi, I'd love to have this plugin. I've tried
but QuickLook still shows the plaintext *.md
I would love to be able to copy text directly from QuickLook.
I used defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder
to be able to select the text inside QuickLook, but I am not able to copy it by using β + C.
Currently this is working for native files like .rft
only. Markdown previews generated by this plugin are not responding to the shortcut.
Hi guys,
I just stumbled across this issue and have a fix for it. However I have no idea how to push pull request, so here it is in plain text.
In Info.plist
add <string>net.multimarkdown.text</string>
to the LSItemContentTypes
array.
So:
<array>
<string>net.daringfireball.markdown</string>
<string>org.vim.markdown-file</string>
</array>
Becomes:
<array>
<string>net.daringfireball.markdown</string>
<string>net.multimarkdown.text</string>
<string>org.vim.markdown-file</string>
</array>
I reinstalled Mavericks, and now my UTI for .md
files (as reported by mdls
) is dyn.ah62d4rv4ge8043a
. According to this article on UTIs, that translates to ?0=6:1=md
, which means UTTypeConformsTo= public.data:public.filename-extension=md
.
Long story short, adding dyn.ah62d4rv4ge8043a
to the Info.plist makes it work.
For example:
# Some Document
My password is: 0^pjKQA*diu.Me
In qlmarkdown this renders nonsensically as the number 0 with an exponent of pjKQA multiplied by diu.Me.
This is an edge-case, but... I like to use QuickLook from the Terminal. This is "qlmanage -p", but there's a handy alias for both .bashrc and .zshrc:
ql () { qlmanage -p "$*" >& /dev/null; }
(no preceding "alias" required for either).
qlmarkdown definitely adds QuickLook support for MD files from the Finder (thanks!), but this seems to break from the command line... Causes both zsh and bash to hang, in both Terminal and iTerm2.
Being able to QuickLook an MD file from the terminal immediately after having pulled down a git repo would be nirvana!
Any way to get this working, some config setting I might be missing? Thanks!
When using Finder in column view and you have a file selected, a column is shown to the right with a preview of the file and some metadata (if enabled, which it is by default). Currently QLMarkdown causes this to be an image of a page, on which actual text is rendered at an unreadably small size. It would be very nice if, instead, the content of the preview column were the same as the content of the popup that shows when you hit space.
This is currently the behavior of QLStephen, if you want a reference.
I hate to sound dense but how do you actually use this to view a .md file? I installed it on MacOS 10.12 but there's no executable in /usr/local/Caskroom/qlmarkdown. And if I right-click a .md file, and select "Open with...", it's not an option.
$ brew cask install qlmarkdown
==> Downloading https://github.com/toland/qlmarkdown/releases/download/v1.3.3/QLMarkdown.qlgenerator.zip
######################################################################## 100.0%
==> Note: running "brew update" may fix sha256 checksum errors
Error: sha256 mismatch
Expected: 045712562665673924397bbbef1ee1157b44e23c9744feda6feda27e107802d3
Actual: acbc1b10fc571643058129ffcb6888f2cf3d0641fe04be5b304d1324d8754f76
File: /Library/Caches/Homebrew/qlmarkdown-1.3.3.zip
To retry an incomplete download, remove the file above.
I've tried brew update
and deleting the temp file+retrying, same thing
Dear Philip,
thank you for qlmarkdown. I would like to use it but I seem to be too dumb to install it. The readme.markdown tells me that I should copy directory QLMarkdown.qlgenerator into ~/Library/QuickLook, but QLMarkdown.qlgenerator does not exist in the repository, It seems that I should compile something but I have no idea how to do that. Would it be an idea eg. to provide a link to an explanation of how to compile things like qlmarkdown?
Thanks,
Paul Huygen
I attempted to run
./discount-config/update-discount.sh
as per the readme and it failed with:
./discount-config/update-discount.sh: line 17: ./update.sh: No such file or directory
However, the following worked:
cd ./discount-config
./update-discount.sh
cd ../
Mach kernel version:
Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 16.00 gigabytes
Default processor set: 161 tasks, 898 threads, 8 processors
Load average: 0.22, Mach factor: 7.77
zsh 4.3.11 (i386-apple-darwin12.0)
Hello
Pandoc is a really cool markdown converter. Is it possible to use it as the default converter in qlmarkdown?
Thank you.
This is not the usual markdown behaviour and breaks links like http://localhost/~xyz/
as they are converted to http://localhost/%7Exyz/
.
workaround: using html.
instead of: <http://localhost/~xyz/>
this will work: <a href="http://localhost/~xyz/">http://localhost/~xyz/</a>
@duozmo had a good point. We need to ensure that we're updating the spotlight index.
RE: #52 (comment)
Iβm trying this on macOS 10.12.4:
brew update && brew cask install qlmarkdown
But getting this:
warning: unable to unlink .travis.yml: Permission denied
warning: unable to unlink .yardopts: Permission denied
warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
fatal: cannot create directory at '.github': Permission denied
Error: Failure while executing: git pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master
Any ideas?
Currently the YAML front matter is ignored and looks kind of ugly in the quick view window.
It would be nice if qlmarkdown could strip it or display it nicely like MacDown does.
markdown.m
"<base href=\"%@\"/>"
styles, url, [NSString stringWithUTF8String:output]];
base tag print "<base href=\"http://localhost/Users/.../sample.md\"/>"
it is make problem not print image
i fix it source
"<base href='file:///%@/' />"
styles, [url.path stringByDeletingLastPathComponent], [NSString stringWithUTF8String:output]];
I would love to be able to select and copy text from the quicklook preview.
While the Markdown specs say we should write reference links followed by empty brackets if the reference word is the same as the linked word, like
Google is a search engine
Gruberg writes them without the empty brackets, just like:
Yahoo is another search engine
Like in this article (seach for [previously]).
His Markdown Dingus and other markdown parsers such as WMD-Editor do behave this way.
Self-explanatory text snipped formatted with markdown
----start
This is a normal paragraph.
This is a quote
Here is a list:
This is a quote insde a list item.
This is a normal paragraph.
This is a quote
Here is a list:
This is a quote insde a list item.
----eof
The second set of quotes is not rendered as quotes, and the > character gets rendered (which should not).
Gruberg formats his quotes preceded by spaces, as can be seen for example in http://daringfireball.net/2009/05/verizon_iphone_rumors.text, and his Markdown Dingus do render them as quotes, so I guess it's on specs.
Though code blocks display nicely with gray background wrapped around them, the inline code spans do not get wrapped in a similar grayed background. Though the text surrounded in backticks does get converted to a monospace font, it still doesn't really pop out compared to the rest of the text. This sentence is wrapped in backticks and you can easily see it because of the gray background.
Would it be possible to enhance the inline code spans in this way to make them more noticeable?
More details about this syntax feature can be found on DaringFireball's Markdown Syntax Explanation.
Given a codeblock like:
```cs
public void Foo()
{
}
```
Then the code block is not formatted, and you see the fence marks. Remove the cs
bit and it all renders correctly. I'm using 1.3.0 and OSX 10.9.3
In #75 we gained the ability to have our markdown look like GitHub, which was a huge win. However, it opens the door for debate on whether a user should be able to choose their style of markdown. Perhaps we should have a way of choosing the "theme" that will be applied to the markdown previewer.
Coffeescript has a "Literate Programming" mode that is based on Markdown.
http://coffeescript.org/#literate
It uses the extension .litcoffee. Would be nice if this plugin could support that, too.
Is there a way for me to manually add this somehow?
The styling looks a little dated. As many of us ultimately put our markdown files up on GitHub, I would love to see this use the same engine and styling as GitHub for rendering the markdown. Perhaps using @sindresorhus's repo would help with the styling? https://github.com/sindresorhus/github-markdown-css
When trying to quicklook this markdown file, QLMarkdown crashes. I have the feeling it's an encoding issue. The file is encoded in ISO Latin-1, not UTF-8.
Didn't find an issue mentioning a Yosemite version so I'm creating this one. Please feel free to add or correct if there already is one. :-)
thx
Iβm not sure whether this is a bug or if I did something wrong but the QL works only for files ending with .markdown
. I took a look at the Info.plist
and fount several other suffixes that should work, but they donβt:
file QL result program
βββββββββββββββββββββββββββββββββββββββββββ
test.markdown works TextWrangler
test.md plain TextEdit
test.mdml nothing none
test.mdown nothing TextWrangler
test.mdwn nothing none
test.mkd nothing Brackets
test.mmd nothing none
test.text plain TextEdit
This is how it looks, when it β¦
β¦ works
β¦ is plain text
β¦ doesnβt work
I have no plugins installed in ~/Library/QuickLook
and in /Library/QuickLook
I have iBooksAuthor.qlgenerator
, iWork.qlgenerator
and QuickLookEyeTV.qlgenerator
. I restarted my mac, the Finder and tried qlmanage -r
without success.
If it is a bug I hope you can fix it if not you might can help anyways ;-)
I had a file encoded in MacRoman (TextEdit's default default) that had an ellipsis (β¦) in the middle of it. Trying to view this file with QLMarkdown 1.2 crashed QuickLook.
As it turns out, a file containing a single MacRoman-encoded ellipsis will crash QLMarkdown 1.2.
I'll see if I can't change the relevant bits to use +[NSString stringWithContentsOfURL:usedEncoding:error:] or its -init⦠counterpart.
hi, could you also add support for mmd files?
cheers! jens-a-e
diff --git a/Info.plist b/Info.plist
index fcf8426..7cc5cb2 100644
--- a/Info.plist
+++ b/Info.plist
@@ -27,6 +27,8 @@
<string>mdml</string>
<string>text</string>
<string>mdwn</string>
+ <string>mmd</string>
+ <string>multimarkdown</string>
</array>
</dict>
</dict>
<hr>
breaks code blocks
#### Code
This is using markdown mixed with HTML.
```markdown
footnotes<sup>[1](#1)</sup>
```
And in your Footnotes section
```markdown
<hr />
###### Footnotes:
1. <a name="1">*Lorem Ipsum*</a>
```
Code
This is using markdown mixed with HTML.
footnotes<sup>[1](#1)</sup>And in your Footnotes section
<hr /> ###### Footnotes: 1. <a name="1">*Lorem Ipsum*</a>
I found a .md
or .markdown
file is work, but it will not be preview when I move it to a app bundle .
I check some other quick look plugin, and they work in the bundle.
I installed QLMarkdown on OS X 10.8.4 (Mountain Lion), but it didn't work for other extensions than .markdown.
Tried putting it in either /Library/QuickLook/
or ~/Library/QuickLook/
did not solve the problem.
Removing QLStephen
and QLColorCode
qlgenerators to avoid interference didn't either.
I have Mou
installed, which exports the UTI. I also tried Texts
, which has a QuickLook plugin, but for it only the extension .text
was recognized and associated with net.daringfireball.markdown
. I removed it to avoid interference with QuickLook priorities.
debugging with qlmanage -p -d 1 file.md
shows that there is no UTI type associated to the extension .md
, because I get: Content type UTI: com.unknown.md
.
Eventually I used LookDown, which didn't work either as it shipped. To make it work I had to relocate its QuickLook generator QuickLookDown.qlgenerator
from LookDown.app/Contents/Library/QuickLook/
to ~/Library/QuickLook/
and then add <string>com.unknown.md</string>
in its:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>QLGenerator</string>
<key>LSItemContentTypes</key>
<array>
<string>net.daringfireball.markdown</string>
<string>com.unknown.md</string>
</array>
</dict>
</array>
Although this eventually solved my problem, since it is clearly a hack (the UTI remains undefined/unexported for that extension, despite Mou.app
exporting it) I would much appreciate a proper solution.
I am new to UTIs and so I hope the above description isn't too messy.
In GitHub there is the option to define TODO lists in this format:
- [ ] foo
- [X] bar
It would be nice to render the brackets like checkboxes. See this gist to see how it's rendered in GitHub.
In the zip file that you offer, I can not find the QLMarkdown.qlgenerator. Should I using Xcode to compile the QLMarkdown.xcodeproj in the Xcode? Thank you very much!
On one of my machines, QLMarkdown works perfectly. On another, it doesn't preview .markdown
files as I'd expect; instead I just get the standard text preview.
The difference between the two machines seems to be that on the machine on which things work a copy of Mac Vim is installed; the machine on which things don't work doesn't have that installed.
That wasn't a great workround so I looked into this a bit harder with the qlmanage
tool. I found that the issue was the UTI determined for the file. On the machine with Vim installed, it was resolved to net.daringfireball.markdown
while on the other it resolved to net.multimarkdown.text
.
Adding net.multimarkdown.text
manually to the Info.plist
file in the QLMarkdown bundle alongside the other two types fixed things for me.
It would be nice to add a link automatically whenever an URL is found.
Is it possible to provide brew support for your awesome extension?
Hi. Is there any chance of a new release? Looks like there have been quite a few changes since the last release, including GitHub styles, which would be really cool.
the previous release (v1.3.2) was bundle properly in *.qlgenerator format, why the files in v1.3.3 isn't bundle properly.
I am finding that QuickLook is showing only the raw marked-up text and not the rendered html when using QLMarkdown in OS 10.12
Would it be possible to add support .md.txt
and .markdown.txt
? I use and see them used elsewhere sometimes.
Reloaded QL via ZSH and still nothing. Wondering if I'm missing something lower-level.
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.