johnxnguyen / down Goto Github PK
View Code? Open in Web Editor NEWBlazing fast Markdown / CommonMark rendering in Swift, built upon cmark.
License: Other
Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark.
License: Other
i tried to get height in WKWebview's delegate: didFinish Navigation, but get the wrong height, much heigher than correct.
How can i get then corret DownView height?
I have to cache the images in the markdown for offline usage. Is there any way to achieve this?
I create an attributedString with your lib. How can I change the font-size?
An example in your doc would be very helpful.
Just installed via CocoaPods.
No warnings or errors.
Don't know how but there are 4 non-compilable sources in the Compile Sources list. I forked the Down project and see that there are not in the Compile Sources list. Odd.
latex.c
line 185: realurllen = url_len;
gives warning:
Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int'
A type casting solves the issue.
realurllen = (int) url_len;
P.S: Thank you for this great spec! It saved a life!
How to disable zoom in/out in this view?
Hi!
Can be Down a better and faster substitute to render html inside a textview?
For example, is possible to use Down to improve the rendering of complex html inside a table view cell?
Actually i'm using an attributed string with this option [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]
but the rendering is too slow.
Thanks
-Paolo
Please help prevent duplicate issues before submitting a new one:
It's just me or everyone also have 5 warnings in the new Xcode 8.3? All of them apparently are in the cmark code btw.
The first 4 apparently can be fixed by removing this 4 files from the build phase, the other one is a type problem
Please help prevent duplicate issues before submitting a new one:
The framework installation through Carthage failed
carthage update
Install and being able to use the framework
Failed!
This is the command output:
❯ carthage update ✭
*** Fetching Down
*** Checking out Down at "v0.4.2"
*** xcodebuild output can be found in /var/folders/kg/qvgj2__s63d29ykthhcm5wd0000276/T/carthage-xcodebuild.as0dwq.log
*** Building scheme "Down" in Down.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Down.xcodeproj -scheme Down -configuration Release -derivedDataPath /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2 -sdk watchos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/kg/qvgj2__s63d29ykthhcm5wd0000276/T/carthage-xcodebuild.as0dwq.log
And this is the log:
/usr/bin/xcrun xcodebuild -project /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Down.xcodeproj -scheme Down -configuration Release -derivedDataPath /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2 -sdk watchos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down)User defaults from command line:
IDEArchivePathOverride = /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
IDEDerivedDataPathOverride = /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2
Build settings from command line:
BITCODE_GENERATION_MODE = bitcode
CARTHAGE = YES
CLANG_ENABLE_CODE_COVERAGE = NO
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = watchos4.0
SKIP_INSTALL = YES
=== BUILD TARGET Down OF PROJECT Down WITH CONFIGURATION Release ===
Check dependencies
Write auxiliary files
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-all-non-framework-target-headers.hmap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-project-headers.hmap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/module.modulemap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/all-product-headers.yaml
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-generated-files.hmap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-all-target-headers.hmap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down.hmap
/bin/mkdir -p /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down-OutputFileMap.json
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down.LinkFileList
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-own-target-headers.hmap
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/swift-overrides.hmap
/bin/mkdir -p /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources
write-file /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources/Down_vers.c
Create product structure
/bin/mkdir -p /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework/Modules
/bin/mkdir -p /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework/Headers
ProcessInfoPlistFile /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework/Info.plist Resources/Down-Info.plist
cd /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/username/.rvm/gems/ruby-2.3.0/bin:/Users/username/.rvm/gems/ruby-2.3.0@global/bin:/Users/username/.rvm/rubies/ruby-2.3.0/bin:/usr/local/opt/libxml2/bin:/Users/username/.swiftenv/shims:/Users/username/.nvm/versions/node/v8.7.0/bin:/opt/local/bin:/opt/local/sbin:/Users/username/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/username/.rvm/bin"
builtin-infoPlistUtility /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Resources/Down-Info.plist -expandbuildsettings -format binary -platform watchos -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework/Info.plist
SymLink /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos/Down.framework /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework
cd /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/username/.rvm/gems/ruby-2.3.0/bin:/Users/username/.rvm/gems/ruby-2.3.0@global/bin:/Users/username/.rvm/rubies/ruby-2.3.0/bin:/usr/local/opt/libxml2/bin:/Users/username/.swiftenv/shims:/Users/username/.nvm/versions/node/v8.7.0/bin:/opt/local/bin:/opt/local/sbin:/Users/username/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/username/.rvm/bin"
/bin/ln -sfh /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/UninstalledProducts/watchos/Down.framework /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos/Down.framework
CompileSwiftSources normal armv7k com.apple.xcode.tools.swift.compiler
cd /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/username/.rvm/gems/ruby-2.3.0/bin:/Users/username/.rvm/gems/ruby-2.3.0@global/bin:/Users/username/.rvm/rubies/ruby-2.3.0/bin:/usr/local/opt/libxml2/bin:/Users/username/.swiftenv/shims:/Users/username/.nvm/versions/node/v8.7.0/bin:/opt/local/bin:/opt/local/sbin:/Users/username/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/username/.rvm/bin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS4.0.sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Down -O -whole-module-optimization -Xfrontend -disable-swift3-objc-inference -sdk /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS4.0.sdk -target armv7k-apple-watchos3.0 -g -module-cache-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/ModuleCache -Xfrontend -serialize-debugging-options -embed-bitcode -swift-version 4 -I /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos -I /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/cmark -F /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos -c -num-threads 8 /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Extensions/NSAttributedString+HTML.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Views/DownView.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownAttributedStringRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownHTMLRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Extensions/String+ToHTML.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownXMLRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Enums\ &\ Options/DownOptions.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownGroffRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownCommonMarkRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Down.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownLaTeXRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Enums\ &\ Options/DownErrors.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownASTRenderable.swift -output-file-map /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down.swiftmodule -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-generated-files.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-own-target-headers.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-project-headers.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos/include -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources/armv7k -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources -emit-objc-header -emit-objc-header-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down-Swift.h -Xcc -working-directory/Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
CompileSwift normal armv7k
cd /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-bc /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Extensions/NSAttributedString+HTML.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Views/DownView.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownAttributedStringRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownHTMLRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Extensions/String+ToHTML.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownXMLRenderable.swift "/Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Enums & Options/DownOptions.swift" /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownGroffRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownCommonMarkRenderable.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Down.swift /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownLaTeXRenderable.swift "/Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Enums & Options/DownErrors.swift" /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Renderers/DownASTRenderable.swift -target armv7k-apple-watchos3.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS4.0.sdk -I /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos -I /Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/cmark -F /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos -g -module-cache-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/ModuleCache -swift-version 4 -disable-swift3-objc-inference -serialize-debugging-options -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-generated-files.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-own-target-headers.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Down-project-headers.hmap -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-watchos/include -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources/armv7k -Xcc -I/Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/DerivedSources -Xcc -working-directory/Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down -emit-module-doc-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down.swiftdoc -serialize-diagnostics-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/NSAttributedString+HTML.dia -O -module-name Down -emit-module-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down.swiftmodule -emit-objc-header-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down-Swift.h -emit-dependencies-path /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/NSAttributedString+HTML.d -num-threads 8 -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/NSAttributedString+HTML.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownView.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownAttributedStringRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownHTMLRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/String+ToHTML.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownXMLRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownOptions.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownGroffRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownCommonMarkRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/Down.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownLaTeXRenderable.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownErrors.bc -o /Users/username/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0.1_9A1004/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/IntermediateBuildFilesPath/Down.build/Release-watchos/Down.build/Objects-normal/armv7k/DownASTRenderable.bc
/Users/username/Development/personal/DownTesting/Carthage/Checkouts/Down/Source/Views/DownView.swift:12:8: error: no such module 'WebKit'
import WebKit
^
** ARCHIVE FAILED **
The following build commands failed:
CompileSwift normal armv7k
CompileSwiftSources normal armv7k com.apple.xcode.tools.swift.compiler
(2 failures)
env: XCode9/swift4
crashed on ios8/iphone6
dyld: Symbol not found: _NSCharacterEncodingDocumentOption
Download, open in Xcode, build, locate Down.framework folder, drag to target Xcode project.
However, "Use of unresolved identifier 'Down' " so I've missed a step somewhere.
Don't want to use carthage or pods, so how to install?
Thanks.
This is more of a question than an issue.
Does this library support markdown tables conversion to HTML? It doesn't work as far I checked.
How can i convert \n
in paragraphs into <br>
?
In other words, is there any options that can make markdown newline (\n
) between paragraphs to line break?
For example if the markdown looks like below:
Hi,<br>\n\ndadsaadsdsada<br>\n\n1\\. dsadsad\n2\\. ea2eqwewqewq\n3\\. dewacxzcxczxcxczc\n4\\. dasfdfdsfdfsdfsfs
How to show the output like
dadsaadsdsada
1. dsadsad
2. ea2eqwewqewq
3. dewacxzcxczxcxczc
4. dasfdfdsfdfsdfsfs```
Is there any way to define custom fonts to use for the output?
I'd need attributed strings where I can define which base-font to use, also which font for h1, h2, ...
Is that anyhow possible? I've seen you basically just give the input to cmark, but couldn't find any possibility to customize any font :(
Am I just missing something here?
Please help prevent duplicate issues before submitting a new one:
ℹ Please replace this with what you did.
ℹ Please replace this with what you expected to happen.
ℹ Please replace this with what happened instead (e.g. the issue).
While installing pod file getting error "DocumentReadingOptionKey is unavailable in Swift"
Welcoming any pull requests to add OS X support for those who need it.
Please help prevent duplicate issues before submitting a new one:
When using Down, all of the non-type identifiers (funcs, vars, etc.) follow the Swift 3+ convention of starting with a lower-case letter, except in the case of struct DownOptions
. It still uses the Swift 2 convention of UpperCase identifiers:
public static let SourcePos = DownOptions(rawValue: CMARK_OPT_SOURCEPOS)
I think Down should use the newer convention and call these symbols sourcePos
, hardBreaks
, etc.
Down still uses the Swift 1/2 convention here: SourcePos
, HardBreaks
, etc.
This is a change to the public interface, but the project version number is still 0.x, so according to semver, breaking changes are allowed. Alternatively, it could define both capitalizations in the struct (like SourcePos
and sourcePos
), to allow users time to update their code.
Please help prevent duplicate issues before submitting a new one:
Clone the repo and run example project.
Running successfully.
Compiling error "Missing required module 'libcmark'"
This is a feature request.
Can you guys create any more themes.
It would be nice to Choose from a light or a dark theme for syntax highlighting
Hi, as I use this module it overrides the font of the textView. Is there any way to set the font when initialising Down?
let down = Down(markdownString: markup) self.messageLabel.attributedText = try! down.toAttributedString()
Help needed. For either DownView or a hint how to implement this.
Alternatively, the example could perhaps get a bit extended.
Loading a local .md file that has a link to another local .md file. E.g. you have
## In markdown file number one (one.md)
[To markdown file number two](two.md)
Tapping on the link should load the other markdown file.
Nothing. Also no exception or else in the console.
Please help prevent duplicate issues before submitting a new one:
Added Down to my Cartfile
and ran carthage update --platform iOS
. I'm using the latest version of Carthage (0.25.0). Xcode version 8.3.3
I expected the installation to complete successfully
The carthage update failed when it got to Down:
Build Failed
Task failed with exit code 65:
I checked the build logs, and noticed the error:
error: no such module 'libcmark'
Seeing error:
MyProject/Pods/Down/Source/Views/DownView.swift:9:8: Module file was created by an older version of the compiler; rebuild 'WebKit' and try again: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/WebKit.swiftmodule
Please help prevent duplicate issues before submitting a new one:
The application would (still) build.
Xcode refused to build the application, because Down.framework has MACOSX_DEPLOYMENT_TARGET = 10.12
.
Down doesn't use any 10.12 APIs, though, so there doesn't appear to be any downside to changing it to MACOSX_DEPLOYMENT_TARGET = 10.11
.
An older macOS target isn't out of line with the other supported platforms. Down.framework still claims to support iOS 8, for example, which is roughly the age of macOS 10.10.
Please help prevent duplicate issues before submitting a new one:
I tried installing Down using Carthage 0.28.0. However, it errors out with the following
Failed to write to /Users/georgemp/TestProject/Carthage/Build/Mac/Down.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “Down.framework” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Users/georgemp/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-iphoneos/Down.framework, NSFilePath=/Users/georgemp/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/Down/v0.4.2/Build/Intermediates.noindex/ArchiveIntermediates/Down/BuildProductsPath/Release-iphoneos/Down.framework, NSUnderlyingError=0x7fd250923f10 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Tried installing Down with the following commands
carthage update Down --platform Mac
carthage update Down --platform Mac --no-use-binaries
Expected to get a built Down.framework in Carthage/Build/Mac
The build errored with the error message pasted in the report section
Please help prevent duplicate issues before submitting a new one:
I'd like WatchKit support for Down.
I tried manually adding the Framework, however, this caused too many issues.
I didn't expect it to work, but I would like it to
It didn't work
I can add a DownView
to my view (use code below) but how can I update the content inside it?
let cardFrontStr = "Use chained optional to simplify code below,\n\n```\nvar display: UILabel?\nif let label = display {\n if let text = label.text {\n let x = text.hasValue\n // ...\n }\n}\n```"
let cardfrontView = try? DownView(frame: cardfront.bounds, markdownString: cardFrontStr)
cardfront.addSubview(cardfrontView!)
Since the DownView is extended from WebView
, I can update the content and loadHTMLString
; however, the DownView style is gone after I have done so.
let down = Down(markdownString: "`test`")
let newStr = try? down.toHTML()
cardbackView?.loadHTMLString(newStr!, baseURL: nil)
This is one of the best frameworks for Markdown I've ever used. There aren't that many alternatives for Objective-C and I have to resort to HTML or WebViews.
Please add Objective-C support if it is possible.
*[x] I've searched other open/closed issues for duplicates before opening up this new issue.
I've inserted a markdown string with some emojis into it and used Down(markdownString: str).toHTML()
The markdown string was something like:
markdownString = """
# Header 01
## header 02
**some bold text 0**
*some italic text 0*
> Blockquote text
> multilined
text with emojis: 👍😀🔞😈🤢🤖
"""
Expected the toHTML()
function parsed the emojis, so it would appear inside the WebView
.
The emojis unicode weren't parsed as expected, instead, for the emojis inserted (see above) the output inside the WebView
after using the toHTML()
function was the following:
(I'm reducing the unnecessary text)
text with emojis: �😀🔞😈🤢🤖
I've tried to render a long markdown format string with Down
, but it can't be recognised, the only way to do it is rendering one line by one line, like this
let inputArray = ["## Hello World", "- list1", "- list2"]
var output: String = ""
for input in inputArray {
let down = Down(markdownString: input)
// Convert to HTML
let html = try? down.toHTML()
output = "\(output)\(html!)"
}
self.webview.loadHTMLString(output, baseURL: nil)
wondering is there a better way to do it?
Hi,
I wanted to try out this package (as it seems to be the only Swift package to provide access to a Markdown AST for custom transforms), but hadn't yet set up CocoaPods or Carthage on my sample CLI application.
I was wondering whether there was anything preventing this project to provide a Package.swift
configuration to be installable via SPM and if not whether you have any objections to providing that option.
Thanks!
I want to load local image and link to local .md file in .md file. So, I want to know subclasses that I have to edit. Could you please tell me?, thank you
Can this be done?
due to different size of devices, can't just give a fixed size to image in markdown, is there a way to custom text font and image size after it been converted to NSAttributedString
, or is there a markdown standard to make this happens?
this is a sample text and image
![](https://s3.atom2ueki.com/images/app_s_3.jpg)
...
let output:NSAttributedString = try! down.toAttributedString()
DispatchQueue.main.async {
self.uitextview.attributedText = output
}
...
thanks!
Is it possible to create a raw string from an NSAttributedString
?
I'm thinking of something like
Down(attributedString: "bold, italic, regular").rawString // –> "**bold**, *italic*, regular"
Reason:
I want my users to be able to style a text (using the regular BIU
) and then convert it to a raw string which I can store in the database to later convert that string back to a rendered NSAttributedString
.
Thanks!
Please help prevent duplicate issues before submitting a new one:
I'm usually looking for an Example project that shows how it looks on iOS or on macOS.
There was no Example project, so I created this issue.
Building my OS X project with Down under Xcode 9 Beta 6 failed due to framework built with previous version of swift error. I then changed my local Down to be swift 4, updated the source, ran the few tests. Removed the existing Down framework and added the newly built one.
That my project would build.
It still complains that the framework is built with an older version of Swift. I ensured the only copy is the one I built. Is there anything odd about the Down build settings?
How can i show render progress?
Your framework seems to be really great!
I tried it with http://www.unexpected-vortices.com/sw/rippledoc/quick-markdown-example.html and everything seems to be working except images. Is this possible?
Please help prevent duplicate issues before submitting a new one:
I downloaded the repo and ran xcodebuild
to build the framework.
I expected to be able to run the function.
I got this error message: 'DownView' is unavailable: cannot find Swift declaration for this class
when I used the DownView() function.
Can you give an example how to custom the parser?
I added Down to my current project to display markdown on different views in different layouts.
For me it seems the text ist a little bit too small to be good readable.
I made some changes to the css file to display a bigger font size.
I am not sure if there is another way, like a config file, but that worked for me and could be an addition to the project.
Sn0wfreezeDev@c0d3f51
Please help prevent duplicate issues before submitting a new one:
I tried to install 0.4.1
via cocoapods
I expected that cocoapods would be aware of 0.4.1
No such version could be found, latest cocoapods version is 0.3.4
. I was able to install by pointing to the v0.4.1
tag
It would be great to get the new version pushed to cocoapods so i can reference by version
Can probably be done as a renderable protocol
See #132
Hi,
paragraphSpacingAfter
to 0 but I still have spacing between each li
.This is my Custom styler for your reference:
struct BodyStyler: XMLStyler {
func style(forElement name: String, attributes: [String: String], currentStyle: StringStyle) -> StringStyle? {
let heading = StringStyle(
.font(UIFont(brand: .regular, size: 18)),
.color(.black),
.lineSpacing(7),
.adapt(.body)
)
let body = StringStyle(
.font(UIFont(titillium: .regular, size: 17)),
.color(.black),
.adapt(.body)
)
switch name {
case "h1", "h2", "h3":
return heading
case "b", "strong":
return body.byAdding(
.font(UIFont(titillium: .bold, size: 17))
)
case "i", "em":
return body.byAdding(
.font(UIFont(titillium: .italic, size: 17))
)
case "ul", "ol":
let bulletStyle = body.byAdding(
.font(UIFont(titillium: .regular, size: 20)),
.color(.grayTint3),
.adapt(.body)
)
let bulletString = NSAttributedString.composed(of: ["◦", Tab.headIndent(4.0)], baseStyle: bulletStyle, separator: nil)
return body.byAdding(
.xmlRules([
.style("li", StringStyle(
.paragraphSpacingAfter(0)
)),
.enter(element: "li", insert: bulletString),
.exit(element: "li", insert: "\n")
])
)
case "a":
guard let href = attributes["href"],
let url = URL(string: href) else {
return body
}
return body.byAdding(
.link(url),
.color(.warmRed),
.underline(.styleNone, .red)
)
default:
return body
}
}
func prefix(forElement name: String, attributes: [String: String]) -> Composable? {
return nil
}
func suffix(forElement name: String) -> Composable? {
return nil
}
}
hello, i installed with pod, but when i build i got a error in XCode9/swift4/ios:
"""
DocumentReadingOptionKey' is unavailable in Swift
"'"
Could you tell me how can i fix this? 😶
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.