Components

Modifiers

Video Player

Paragraph Component

Как создать новый компонент

En

Ru

STATIC SHARP

Component oriented static-site generator extendable with C#

CODE

Welcome to StaticSharp! We believe in getting right to the point, so here is the code from this very page.

"coDe".ToLandingSectionHeader(Color.Red), /*$"This is {new Inline("Red text"){ ForegroundColor = Color.Red}}", $"Here is {Bold("bold")} text. This is {Node.Root.ContactUs:internal link}. And an icon : {new SvgIconInline(SvgIcons.SimpleIcons.GitHub)}", $"This is compile time error {new Block{ BackgroundColor = Color.Red}}",*/ "Welcome to StaticSharp! We believe in getting right to the point, so here is the code from this very page.", CodeBlockScrollable(LoadFile(ThisFilePath()).GetCodeRegion("codeExample").Highlight(new CSharpHighlighter())), Separator(), "COMPONENT-based\ncontent development".ToLandingSectionHeader(Color.GreenYellow * 0.75), """ Component-based development is like a Lego set for your website! You get to use pre-made blocks (components) and snap them together, or even create your own custom bricks to build the site of your dreams. Plus, it's super scalable and easy to update. Bye-bye, clunky websites - hello, sleek and modern web creations! """, Separator(), new LinearLayout(){ Vertical = new(e=>e.Width<950), Reverse = new(e=>e.Vertical), MarginLeft = new(e=>e.Parent.PaddingLeft), MarginRight = new(e=>e.Parent.PaddingRight), MarginsVertical = 75, Children = { new LinearLayout(){ ItemGrow = 0, Width = new(e=>e.Parent.Width * 0.5), MarginLeft = 10, MarginRight = 10, MarginTop = 60, Children = { "copypasteable from\nSTACKOVERFLOW".ToLandingSectionHeader(new Color("#F58025")) , """ Copy-pasteability is the superpower of code - it allows developers to reuse and share code like a boss, saving time and effort in the software development process. No-code or low-code platforms might have their own superpowers, but when it comes to flexibility and customization, code-based approaches reign supreme. So go forth, dear developer, and copy-paste to your heart's content! """, } }, new Image("StackoverflowKeyboard.svg"){ Width = new(e=>e.Parent.Width * 0.5), Height = new(e=>Js.Num.Min(e.Width/e.Aspect, 400)), Margins = 75, Embed = Image.TEmbed.Image, Fit = Fit.Inside } } }, Separator(), "create your own SHORTCUTS".ToLandingSectionHeader(Color.Red), """ For example, on this page, there are colored words in the headings. You can write full formatting in each case or you can create a function that highlights all capital letters with a given color and makes all lowercase letters capitalized. """, CodeBlock("\"create your own SHORTCUTS\".ToLandingSectionHeader(Color.Red)".Highlight(new ColorCodeHighlighter("cs"))), $"In this case it is an extension method for type {Code("string")}", Separator(), "bring it with NUGET".ToLandingSectionHeader(new Color("#004880") * 1.7), "All of these shortcuts and components can be wrapped in NuGet packages, so that everyone (including you in the future) can add them to their new site with a few clicks.", Separator(), "TURING complete text writing".ToLandingSectionHeader(Color.DeepPink), $""" Yo dawg, we put programming in the text-writing so you can code while you write. By the way, did you know that at the time this page was generated on {DateTime.Now.Date.ToString("MMMM dd, yyyy")}, the StaticSharp repository had { JObject.Parse(new HttpRequestGenome("https://api.github.com/repos/StaticSharp/StaticSharp").Result.Text).Value<int>("stargazers_count") } stars on { new Uri("https://github.com/StaticSharp/StaticSharp"):GitHub}? """,

COMPONENT-BASED CONTENT DEVELOPMENT

Component-based development is like a Lego set for your website! You get to use pre-made blocks (components) and snap them together, or even create your own custom bricks to build the site of your dreams. Plus, it's super scalable and easy to update. Bye-bye, clunky websites - hello, sleek and modern web creations!

COPYPASTEABLE FROM STACKOVERFLOW

Copy-pasteability is the superpower of code - it allows developers to reuse and share code like a boss, saving time and effort in the software development process. No-code or low-code platforms might have their own superpowers, but when it comes to flexibility and customization, code-based approaches reign supreme. So go forth, dear developer, and copy-paste to your heart's content!

CREATE YOUR OWN SHORTCUTS

For example, on this page, there are colored words in the headings. You can write full formatting in each case or you can create a function that highlights all capital letters with a given color and makes all lowercase letters capitalized.

"create your own SHORTCUTS".ToLandingSectionHeader(Color.Red)

In this case it is an extension method for type string

BRING IT WITH NUGET

All of these shortcuts and components can be wrapped in NuGet packages, so that everyone (including you in the future) can add them to their new site with a few clicks.

TURING COMPLETE TEXT WRITING

Yo dawg, we put programming in the text-writing so you can code while you write. By the way, did you know that at the time this page was generated on May 03, 2023, the StaticSharp repository had 3 stars on GitHub?

AUTOCOMPLETE FOR EVERYTHING

C# is a strongly-typed language, so the IDE has access to information about the available types and their members in compile-time. With the introduction of Source Generators in .NET 6, we can even provide IntelliSense for internal links. Example: This link -> Components is made by {Node.Components} using interpolated string syntax.

Modern IDEs are like supercharged text editors, making it a breeze to develop a website using the most powerful framework at your fingertips.

DEVELOPER MODE

Like any static site generator, StaticSharp has a web server mode that allows you to see the site in a browser while you work on it. One feature we want to show of is the source code navigation directly from your browser. You can ctrl+click on an element in the browser and StaticSharp will highlight the corresponding line in Visual Studio.

HOT-RELOAD FOR EVERYTHING

Essentially, your content is part of the code that is executed to create an HTML file. To make changes reflected on the page, the code must be recompiled. However, thanks to the hot-reload feature in .NET, such changes are applied instantly and do not require full recompilation.

In addition, StaticSharp in developer mode provides hot reloading of all resources used on the page. All images, videos, JavaScript, text files, and code examples will be reloaded when they are modified.

ANY QUESTIONS?

MessengerFacebook

TelegramTelegram

DiscordDiscord

This website has been created using StaticSharp