Skip to content

Add support for Wordpress Shortcodes in a .NET application.

License

Notifications You must be signed in to change notification settings

johnboker/shortcoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortcoder

Build status

Add support for Wordpress Shortcodes in a .NET application.

Project Status

  • Parsing works in most cases, but more tests need to be added for edge cases.

Installation

Install through NuGet:

Install-Package Shortcoder -Pre

Follow steps below to get started.

Quick Sample Usage

  1. Create a Shortcode class.

    public class NowShortcode : Shortcode
    {
        public override string Generate(IShortcodeContext context)
        {
            return DateTime.Now.ToString();
        }
    }
  2. Register the shortcode.

    ShortcodeFactory.Provider.Add<NowShortcode>(tag: "now");
  3. Parse content using registered shortcodes

    var content = "The date and time is: [now].";
    var parsedContent = ShortcodeFactory.Parser.Parse(body);

    Result:

    parsedContent == "The date and time is: 2015-01-01 10:10:00."
    

License

See LICENSE

About

Add support for Wordpress Shortcodes in a .NET application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 96.7%
  • Boo 3.2%
  • Batchfile 0.1%