Comments (14)
Just FYI I will still get to this, but my needs for a project changed and I'm not actively blocked by this anymore so it'll be a little later on. That said this is the best-looking GUI-based Markdown renderer I've seen and I'd like to help tune it up for possible future use!
from notepad.
This was a red herring, since CocoaPods provides an umbrella header file and creates all pods as frameworks.
The real problem is that per http://stackoverflow.com/a/37089794/977220 the Notepad
class isn't public by default outside of the framework. Again, it works in your example since the Notepad.swift
file is present in the same module as the app.
I'll submit a PR for this. It gets complicated when you try to use a Notepad
in IB, since you can't later set the themeFile
in code. Making Storage
also public is one fix, but that requires a bunch of other stuff be made public as well.
One idea I have here is to introduce a safe setter for themeFile
on Notepad
so we don't have to expose Storage
, but that introduces concurrency issues with setting the themeFile
on a Notepad
after it's already been rendered once.
¯\_(ツ)_/¯
coding
from notepad.
Hey, thanks for the note! Can you link me to an example of a framework header, and I can create one? Or, alternatively you could open up a pull request?
from notepad.
Sure, it should just be as simple as something like this:
https://github.com/mapbox/MapboxGeocoder.swift/blob/master/MapboxGeocoder/MapboxGeocoder.h
In this project's case, maybe:
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double NotepadVersionNumber;
FOUNDATION_EXPORT const unsigned char NotepadVersionString[];
All of the Swift files should be included automatically since they are part of the module.
I'm not 100% positive this will solve the problem, but I think it should. I will try to experiment more.
from notepad.
Great, thanks! Let me know what you find, and happy to merge anything in — it doesn't hurt to have a framework header regardless!
from notepad.
Another issue here is that Theme
refers to Bundle.main.path
to find its JSON resources, yet the main bundle is actually the user's app, not the Notepad.framework
. I have a fix for this as well.
from notepad.
Awesome, thanks. Yeah — I definitely am going to implement something with IBInspectables/IBDesignables
going forward, but feel free to hack away! Looking to build this out so it's extra flexible (roadmap may include loading themes from online, who knows what the future holds).
Regarding exposing Storage
, I agree with you. I found it difficult to work with NSTextStorage
and the safety of Swift, in terms of the order of initialization in classes. I used a different approach in RFMarkdownTextView that I could get away with as it was Objective-C.
from notepad.
Also, debating between themeFile
and theme
as the variable. Thoughts?
from notepad.
theme
implies a Theme
will be passed, which you might also prefer to keep private. themeFile
, themeName
, or themePath
implies a String
(in the latter case, allowing you to pass your own full JSON path).
from notepad.
I agree - just checking because I hate camel case ¯\_(ツ)_/¯
.
from notepad.
@incanus do you have the header for CocoaPods in git already? Because if not I have some time on my hands now and can clean some stuff up. Just let me know!
from notepad.
The header isn’t necessary—CocoaPods makes one for you when it packages your project as a dynamic framework.
from notepad.
Ah - so just adding public
should work. Great, I'll do that now!
from notepad.
Fixed by 6a9e702.
from notepad.
Related Issues (20)
- Suggestion box is too big HOT 4
- Align text in the centre HOT 2
- Carthage & Swift Package Manager support HOT 6
- Swift 4 support (on CocoaPods)? HOT 3
- 3 spaces make it not working HOT 3
- Internal Protection Level HOT 9
- Line break inside bold or italic markup leaves first part marked up HOT 1
- attribute run ranges are in inconsistent state HOT 2
- Please add the possibility to change the syntax color and clickable links. HOT 4
- macOS pod installation HOT 3
- Issue with Xcode 10.2 HOT 2
- Style boldItalics not rendered correctly HOT 9
- Unable to load your theme file. HOT 11
- Storyboard support HOT 8
- Objective C support HOT 1
- Use System Font HOT 2
- Custom attributes HOT 1
- Placeholder support
- Hide markdown syntax as cursor leaves the position? HOT 4
- New release version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notepad.