Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LiquidProjectProcessor"/>
        /// </summary>
        /// <param name="configurationAction">the action used to configure <see cref="FluidParserFactory"/>. Custom filters should be registered in the configuration action.</param>
        public LiquidProjectProcessor(Action <FluidParserFactory> configurationAction)
        {
            var parserFactory = new FluidParserFactory();

            configurationAction?.Invoke(parserFactory);

            _parser = parserFactory.CreateParser();
        }
Exemplo n.º 2
0
        private static void ConfigureFluidParser(FluidParserFactory _liquidParseFactory)
        {
            _liquidParseFactory.RegisterTag <RenderBodyTag>("render_body");
            _liquidParseFactory.RegisterTag <RenderSectionTag>("render_section");
            _liquidParseFactory.RegisterTag <RenderTitleSegmentsTag>("page_title");
            _liquidParseFactory.RegisterTag <AntiForgeryTokenTag>("antiforgerytoken");
            _liquidParseFactory.RegisterTag <LayoutTag>("layout");

            _liquidParseFactory.RegisterTag <ClearAlternatesTag>("shape_clear_alternates");
            _liquidParseFactory.RegisterTag <AddAlternatesTag>("shape_add_alternates");
            _liquidParseFactory.RegisterTag <ClearWrappers>("shape_clear_wrappers");
            _liquidParseFactory.RegisterTag <AddWrappersTag>("shape_add_wrappers");
            _liquidParseFactory.RegisterTag <ClearClassesTag>("shape_clear_classes");
            _liquidParseFactory.RegisterTag <AddClassesTag>("shape_add_classes");
            _liquidParseFactory.RegisterTag <ClearAttributesTag>("shape_clear_attributes");
            _liquidParseFactory.RegisterTag <AddAttributesTag>("shape_add_attributes");
            _liquidParseFactory.RegisterTag <ShapeTypeTag>("shape_type");
            _liquidParseFactory.RegisterTag <ShapeDisplayTypeTag>("shape_display_type");
            _liquidParseFactory.RegisterTag <ShapePositionTag>("shape_position");
            _liquidParseFactory.RegisterTag <ShapeTabTag>("shape_tab");
            _liquidParseFactory.RegisterTag <ShapeRemoveItemTag>("shape_remove_item");
            _liquidParseFactory.RegisterTag <ShapePagerTag>("shape_pager");

            _liquidParseFactory.RegisterTag <HelperTag>("helper");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("shape");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("link");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("meta");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("resources");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("script");
            _liquidParseFactory.RegisterTag <NamedHelperTag>("style");

            _liquidParseFactory.RegisterBlock <HelperBlock>("block");
            _liquidParseFactory.RegisterBlock <NamedHelperBlock>("a");
            _liquidParseFactory.RegisterBlock <NamedHelperBlock>("zone");
            _liquidParseFactory.RegisterBlock <NamedHelperBlock>("scriptblock");

            _liquidParseFactory.RegisterBlock <CacheBlock>("cache");
            _liquidParseFactory.RegisterTag <CacheDependencyTag>("cache_dependency");
            _liquidParseFactory.RegisterTag <CacheExpiresOnTag>("cache_expires_on");
            _liquidParseFactory.RegisterTag <CacheExpiresAfterTag>("cache_expires_after");
            _liquidParseFactory.RegisterTag <CacheExpiresSlidingTag>("cache_expires_sliding");
        }
Exemplo n.º 3
0
 public void RegisterLanguageExtensions(FluidParserFactory factory)
 {
     factory.RegisterTag("asset", new AssetTag(serviceProvider));
 }
Exemplo n.º 4
0
 public void RegisterLanguageExtensions(FluidParserFactory factory)
 {
     factory.RegisterTag("reference", new ReferenceTag(serviceProvider));
 }