Add() public method

public Add ( string tagName ) : HtmlTag
tagName string
return HtmlTag
示例#1
0
        public string Generate(Topic topic)
        {
            if (topic.IsSplashPage())
            {
                return _transformer.Transform(topic, new FileSystem().ReadStringFromFile(topic.File));
            }

            try
            {
                return generate(topic);
            }
            catch (Exception e)
            {
                ConsoleWriter.Write(ConsoleColor.Yellow, "Failed to transform topic at " + topic.File);
                ConsoleWriter.Write(ConsoleColor.Red, e.ToString());

                var document = new HtmlDocument
                {
                    Title = "Error!"
                };

                document.Add("h1").Text("Error!");

                document.Add("pre").Text(e.ToString());


                return document.ToString();
            }
        }
示例#2
0
        public HtmlDocument get__todo()
        {
            var document = new HtmlDocument
            {
                Title = "TODO's"
            };

            document.Head.Add("link").Attr("rel", "stylesheet").Attr("type", "text/css")
                .Attr("href", "/content/bootstrap.min.css");

            document.Push("div").AddClass("container");

            document.Add("h1").Text("TODO's");

            var todos = TodoTask.FindAllTodos(_top.AllTopicsInOrder().ToArray());

            document.Add(new TodoTableTag(todos));

            return document;
        }
示例#3
0
        public static HtmlDocument BuildPage(IApplication application, OpenInput input)
        {
            var document = new HtmlDocument {Title = "Storyteller 4"};


            writeInitialDataIntoPage(document, application);

            document.Add("div").Id("header-container");
            document.Add("div").Id("body-pane").AddClass("container");
            document.Add("div").Id("main");

#if DEBUG
            WriteClientAssetsDebugMode(document, input.DevFlag);
#else

            writeClientSideAssetsFromEmbeds(document);
#endif


            return document;
        }