https://github.com/NimbusKit/markdown
A Markdown NSAttributedString parser.
https://github.com/NimbusKit/markdown
Last synced: about 1 year ago
JSON representation
A Markdown NSAttributedString parser.
- Host: GitHub
- URL: https://github.com/NimbusKit/markdown
- Owner: NimbusKit
- License: apache-2.0
- Created: 2013-04-30T01:35:48.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-09-09T11:36:46.000Z (over 10 years ago)
- Last Synced: 2025-04-04T21:40:22.150Z (about 1 year ago)
- Language: Objective-C
- Size: 1.01 MB
- Stars: 658
- Watchers: 17
- Forks: 63
- Open Issues: 19
-
Metadata Files:
- Readme: README.mdown
- License: LICENSE
Awesome Lists containing this project
- awesome - markdown - A Markdown NSAttributedString parser. (etc)
README
A Markdown NSAttributedString Parser
====================================
This is a Markdown => NSAttributedString parser built on top of a flex parser. It takes an NSString
and returns an NSAttributedString with markdown tags replaced by CoreText formatting attributes.
Adding it to your Project
-------------------------
1. Drag all of the files from the src/ directory into your project.
2. Import NSAttributedStringMarkdownParser.h in your project.
3. Create an instance of the parser object and pass it the string you wish to parse.
4. Plug the resulting NSAttributedString into your favorite NSAttributedString label implementation.
NSAttributedString Labels
-------------------------
Nimbus: https://github.com/jverkoey/nimbus
TTTAttributedLabel: https://github.com/mattt/TTTAttributedLabel
Supported Features
------------------
*italics*
**bold**
***bold italic***
~~strikethrough~~
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
Header 1
========
Header 2
--------
http://google.com urls
[Text] (http://google.com "alt text") urls
Example
-------
NSAttributedStringMarkdownParser* parser = [[NSAttributedStringMarkdownParser alloc] init];
NSAttributedString* string = [parser attributedStringFromMarkdownString:
@"This is __rad__."];
See the Catalog application included with the project for more examples.