FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
qlmarkdown/GeneratePreviewForURL.m at master · fabgithub/qlmarkdown · GitHub
fabgithub
/
qlmarkdown
Public
forked from
toland/qlmarkdown
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
qlmarkdown
/
GeneratePreviewForURL.m
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (22 loc) · 888 Bytes
Breadcrumbs
qlmarkdown
/
GeneratePreviewForURL.m
Copy path
File metadata and controls
28 lines (22 loc) · 888 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
import
<
QuickLook/QuickLook.h
>
#
import
<
Cocoa/Cocoa.h
>
#
include
"
markdown.h
"
/*
-----------------------------------------------------------------------------
Generate a preview for file
This function's job is to create preview for designated file
--------------------------------------------------------------------------
*/
OSStatus
GeneratePreviewForURL
(
void
*thisInterface, QLPreviewRequestRef preview,
CFURLRef url, CFStringRef contentTypeUTI,
CFDictionaryRef options)
{
CFDataRef data = (CFDataRef)
renderMarkdown
((
NSURL
*) url);
if
(data) {
CFDictionaryRef props = (CFDictionaryRef) [
NSDictionary
dictionary
];
QLPreviewRequestSetDataRepresentation
(preview, data,
kUTTypeHTML
, props);
}
return
noErr;
}
void
CancelPreviewGeneration
(
void
* thisInterface, QLPreviewRequestRef preview)
{
//
implement only if supported
}
Back
|
FazBrowse Home
|
New Git URL