Skip to content

Commit

Permalink
Merge pull request #485 from cplr/master
Browse files Browse the repository at this point in the history
Fixes issue 293, provides menu item to create custom html/css & open folder.
  • Loading branch information
ttscoff authored Jul 27, 2021
2 parents 845bdbf + 6369d2c commit 59bc665
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void outletObjectAwoke(id sender);
- (IBAction)togglePreview:(id)sender;
- (IBAction)toggleSourceView:(id)sender;
- (IBAction)savePreview:(id)sender;
- (IBAction)openCustomPreviewFolder:(id)sender;
- (IBAction)sharePreview:(id)sender;
- (IBAction)lockPreview:(id)sender;
- (IBAction)printPreview:(id)sender;
Expand Down
8 changes: 7 additions & 1 deletion AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,13 @@ - (IBAction)savePreview:(id)sender
[self ensurePreviewIsVisible];
[previewController saveHTML:self];
}


- (IBAction)openCustomPreviewFolder:(id)sender
{
[PreviewController createCustomFiles];
[[NSWorkspace sharedWorkspace] openFile:[[NSFileManager defaultManager] applicationSupportDirectory]];
}

- (IBAction)sharePreview:(id)sender
{
[self ensurePreviewIsVisible];
Expand Down
1 change: 1 addition & 0 deletions PreviewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "ETTransparentButton.h"
#import "BTTransparentScroller.h"
#import "NSFileManager_NV.h"
#import "NSFileManager+DirectoryLocations.h"

#define kDefaultMarkupPreviewVisible @"markupPreviewVisible"

Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ nvALT adds:

## Customization

After the first time you run the Preview window, look in `~/Library/Application Support/Notational Velocity` and you'll find two files:` template.html` and `custom.css`. If you're handy with HTML and CSS, feel free to customize these in whatever way you like. You can add Javascript as well, but you'll need to load external scripts from a url or using a full file:// path. If worst comes to worst, you can just delete or rename your customizations and the default files will be put back in place automatically.
Select "Open Custom CSS Folder" within the Preview menu, and the application's supprt folder will open. You will find two files:` template.html` and `custom.css`. If you're handy with HTML and CSS, feel free to customize these in whatever way you like. You can add Javascript as well, but you'll need to load external scripts from a url or using a full file:// path. If worst comes to worst, you can just delete or rename your customizations and the default files will be put back in place automatically when you select the menu item again.

## Download

Expand Down
6 changes: 6 additions & 0 deletions en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@ CA
<action selector="savePreview:" target="213" id="1247"/>
</connections>
</menuItem>
<menuItem title="Open Custom CSS Folder" id="CkP-Bv-IbF" userLabel="Open Custom CSS Folder">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openCustomPreviewFolder:" target="213" id="0MZ-vd-gxk"/>
</connections>
</menuItem>
<menuItem title="Enable Markdown Completion" keyEquivalent="M" id="1385">
<connections>
<binding destination="1258" name="value" keyPath="values.UsesMarkdownCompletions" id="1391">
Expand Down

0 comments on commit 59bc665

Please sign in to comment.