# MarkupOC
**Repository Path**: alibaba/MarkupOC
## Basic Information
- **Project Name**: MarkupOC
- **Description**: Markup is simple and useful Markup Language。it was wirtten by Js and widely used in web. We alse can use it in Native code, So we rewrite it by Objective C . When you write iOS App , you can think about it .
- **Primary Language**: Unknown
- **License**: LGPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-10-31
- **Last Updated**: 2026-01-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Markup for Objective C
Markup is simple and useful Markup Language。it was wirtten by Js and widely used in web. We alse can use it in Native code, So I rewrite it by Objective C . When you write iOS App , you can think about it .
# Why use markup
1.markup is powerful,simple, and lightly
2.markup can combine temple and data,which help you merge data to view. you need not write hard code in your project.
3.lots of project use markup ,such as vue.js.
# How to use
1. import WKMarkup.h and WKMarkup.m
2. use the interface.
``` -(NSString*) markupWithTemp:(id)tpContent withContent:(id)context withOption:(id)options;```
```
NSDictionary *reDic = [NSJSONSerialization JSONObjectWithData:[self.dataContent dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableLeaves error:&err];
value = [markup markupWithTemp:self.templateStr withContent:reDic withOption:nil];
```
# example
#### value
template:
Hi, {{name.first}}!
data:
{
name: {
first: "John",
last: "Doe"
}
}
```output:"Hi, John!"```
#### Array
template:Favorite color: {{colors.0}}
data:{
name: "John Doe",
colors: ["Red", "Blue", "Green"]
}
```output:"Favorite color: Red"```
#### Loops
* template:```