Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #26

Merged
merged 1 commit into from
May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider
["hello"] = (args, content, ctx) => new ValueTask<string>("Hello world!")
});

Console.WriteLine(await process.EvaluateAsync("This is an [hello]"));
Console.WriteLine(await processor.EvaluateAsync("This is an [hello]"));
```

Which results in
Expand All @@ -59,7 +59,7 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider
}
});

Console.WriteLine(await process.EvaluateAsync("[bold text='bold text' 1234]"));
Console.WriteLine(await processor.EvaluateAsync("[bold text='bold text' 1234]"));
```

### Content arguments
Expand All @@ -75,7 +75,7 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider
}
});

Console.WriteLine(await process.EvaluateAsync("[bold]bold text[/bold]"));
Console.WriteLine(await processor.EvaluateAsync("[bold]bold text[/bold]"));
```

For single tags, the content is `null`. It means that you can detect if a shortcode was
Expand All @@ -96,7 +96,7 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider
}
});

Console.WriteLine(await process.EvaluateAsync("[bold 'bold text']"));
Console.WriteLine(await processor.EvaluateAsync("[bold 'bold text']"));
```

```
Expand All @@ -118,7 +118,7 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider
}
});

Console.WriteLine(await process.EvaluateAsync("[bold id='a' 'some text']"));
Console.WriteLine(await processor.EvaluateAsync("[bold id='a' 'some text']"));
```

```
Expand Down Expand Up @@ -202,8 +202,8 @@ var processor = new ShortcodesProcessor(new NamedShortcodeProvider

app.Run((httpContext) =>
{
var context = new Context({ ["HttpContext"] = httpContext });
var result = await process.EvaluateAsync("The current user is [username]", context);
var context = new Context(){ ["HttpContext"] = httpContext };
var result = await processor.EvaluateAsync("The current user is [username]", context);
return context.Response.WriteAsync(result);
});
```
Expand Down