diff --git a/.gitignore b/.gitignore index ec0fb2754..d29115911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Zensical +Site/ + # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) [Bb]in/ [Oo]bj/ diff --git a/Documentation/demos.md b/Documentation/demos.md new file mode 100644 index 000000000..5790813ff --- /dev/null +++ b/Documentation/demos.md @@ -0,0 +1,41 @@ +# Demo Applications + +## Platforms + +### WinForms + +![WinForms Demo](images/demo_winforms.png) + +### WPF + +![WPF Demo](images/demo_wpf.png) + +### Mono + +![Mono Demo](images/demo_mono.png) + +## Capabilities + +### Showcase HTML support and features + +![Showcase HTML support and features](images/demo_showcase.png) + +### Live HTML source editing with immediate feedback + +![Live HTML source editing](images/demo_textEdit.png) + +### HtmlPanel/HtmlLabel controls playground + +![HtmlPanel/HtmlLabel controls playground](images/demo_sampleForm.png) + +### Image generation + +![Image generation](images/demo_generateImage.png) + +### PDF generation + +![PDF generation](images/demo_pdf.png) + +### HTML Tooltip + +![HTML Tooltip](images/demo_tooltip.png) diff --git a/Documentation/dev/html-css-support.md b/Documentation/dev/html-css-support.md new file mode 100644 index 000000000..893acbe85 --- /dev/null +++ b/Documentation/dev/html-css-support.md @@ -0,0 +1,23 @@ +# HTML and CSS Support + +## HTML and CSS specification + +* HTML 4.01 +* CSS level 2 + +## Additional features + +Jose took the liberty of adding a couple of features: + +* Background gradients +* Rounded corners + +These are achieved thru the following CSS properties: + +* `background-gradient: (color)` +* `background-gradient-angle: (number)` +* `corner-ne-radius: (length)` +* `corner-nw-radius: (length)` +* `corner-se-radius: (length)` +* `corner-se-radius: (length)` +* `corner-radius: (length){1,4} (shorthand for all corners)` diff --git a/Documentation/docs/image-generation.md b/Documentation/docs/image-generation.md new file mode 100644 index 000000000..fc63a61f1 --- /dev/null +++ b/Documentation/docs/image-generation.md @@ -0,0 +1,224 @@ +# Image Generation + +## Generate image from HTML markup + +HTML Renderer can be used to generate image (png, jpeg, bmp, etc.) from HTML markup snippet. +Because of technical limitations, rendering to image requires special handling, this page goal is to provide all the tools required for successful and high-quality HTML image generation. +For technical details see [GDI vs. GDI+ text rendering](#5-gdi-vs-gdi-text-rendering). + +When approaching image generation the most critical question is the generated image background, must the background have transparency (full or partial) or can it be completely filled by non-transparent color, be it solid color (like web-browsers white), gradient or existing image to render the HTML on it. +Therefor the page presents image rendering via 3 options: [solid color](#1-solid-color-background), [image](#2-image-background) and [transparent](#3-transparent-background) background. + +The second criteria is the generated image size: is it required to be of specific size, restricted by minimum and maximum values or free to be as large as the HTML requires. +In all cases, HTML layout is executed to find the rendered html desired size and to layout the HTML in the given restrictions. +Therefor each background rendering options has overloads to handle the different size restrictions. + +## 1. Solid color background + +* Render HTML with solid background color. +* Using GDI text rendering. +* Excellent performance. +* Sharp and excellent aligned text. +* Using "HtmlRender.RenderToImage" methods. +* See the [HTML used in examples](#4-html-used-in-examples). + +#### No size restrictions + +``` csharp +Image image = HtmlRender.RenderToImage(html); +``` + +* The default background color is used - white. +* Generated image size depends on HTML content greedy layout. + * Width will be set by the longest line without wrapping. + * Height will be set by exact height of the HTML. + +![html0.png](images/html0.png) + +#### Fixed size image + +``` csharp +Image image = HtmlRender.RenderToImage(html, new Size(400, 200), Color.Linen); +``` + +* Use `Color.Linen` solid background color. +* Generate image of fixed size - 400x200 pixels. +* HTML layout is restricted by max width - 400 pixels. + * Text is wrapped to fit into the restricted width. +* Image heights extend beyond the actual height of the HTML. + * If image height was smaller than actual HTML height the rendered HTML would be clipped. + +![html1.png](images/html1.png) + +#### Min/Max size restrictions + +``` csharp +Image image = HtmlRender.RenderToImage(html, new Size(650, 50), new Size(1400, 106), Color.SeaShell); +``` + +* Generate image with minimum and maximum size restrictions. +* Restricted max width is above the max required width to layout the longest text without wrapping so it has no effect. +* Restricted min width is also above the required layout width (`541px`) therefore the html is extended. +* the resulting image width is 650px and the html uses the full width to layout. +* Restricted max height is lower than the required height to fully render the html therefore it is clipped at the restricted height value: 106px. + +![html2.png](images/html2.png) + +## 2. Image background + +* Using GDI text rendering. +* Excellent performance. +* No new image object is created, the HTML is rendered on the given image object. +* Sharp and excellent aligned text. +* Using "HtmlRender.RenderToImage" methods. +* See the [HTML used in examples](#4-html-used-in-examples). + +#### No explicit size restrictions + +``` csharp +Image image = Image.FromFile("base.png"); +HtmlRender.RenderToImage(image, html, new Point(15,10)); +``` + +* HTML is rendered on top of the given background image. +* HTML is rendered at `(15, 10)` offset to better fit over the background image. +* HTML layout is restricted by image width. + * Text is wrapped to fit into the restricted width. +* If image height was smaller than actual HTML height the rendered HTML would be clipped. + +![html5.png](images/html5.png) + +#### Explicit max size restriction + +``` csharp +Image image = Image.FromFile("base.png"); +HtmlRender.RenderToImage(image, html, new Point(15, 10), new Size(550, 120)); +``` + +* HTML is rendered on top of the given background image. +* HTML is rendered at `(15, 10)` offset to better fit over the background image. +* HTML layout is restricted by given max-width. + * Actual max height\width is also restricted by image size. + * Text is wrapped to fit into the restricted width. +* HTML is clipped by the max height if cannot fit in. + +![html6.png](images/html6.png) + +## 3. Transparent background + +* Render HTML with transparent background. +* Using GDI+ text rendering. +* [TextRenderingHint](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.text.textrenderinghint) can be controlled, default: AntiAlias. +* Better used for high DPI devices like print. +* Less sharp and may have letter-symbols alignments small issues (font dependent). +* Slower than GDI (80%-150% slower, see [The wonders of text rendering and GDI](https://theartofdev.com/2013/08/12/the-wonders-of-text-rendering-and-gdi/)). +* Using `HtmlRender.RenderToImageGdiPlus` methods. +* See the [HTML used in examples](#4-html-used-in-examples). + +#### No size restrictions with `AntiAlias` [TextRenderingHint](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.text.textrenderinghint) + +``` csharp +Image image = HtmlRender.RenderToImageGdiPlus(html); +``` + +* The image background is fully transparent. +* The default TextRenderingHint is used - `AntiAlias`. +* Rendered text is blurred a little by Anti-Aliasing (compared to GDI text rendering). +* Generated image size depends on HTML content greedy layout. + * Width will be set by the longest line without wrapping. + * Height will be set by exact height of the HTML. + +![html3.png](images/html3.png) + +#### Fixed size image with `AntiAliasGridFit` [TextRenderingHint](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.text.textrenderinghint) + +``` csharp +Image image = HtmlRender.RenderToImageGdiPlus(html, new Size(400, 200), TextRenderingHint.AntiAliasGridFit); +``` + +* The image background is fully transparent. +* Rendered text is not as smooth as GDI or non GridFit text rendering. +* Generate image of fixed size - 400x200 pixels. +* HTML layout is restricted by max width - 400 pixels. + * Text is wrapped to fit into the restricted width. +* Image heights extend beyond the actual height of the HTML. + * If image height was smaller than actual HTML height the rendered HTML would be clipped. + +![html4.png](images/html4.png) + +#### Min/Max size restrictions with `SingleBitPerPixelGridFit` [TextRenderingHint](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.text.textrenderinghint) + +``` csharp +Image image = HtmlRender.RenderToImageGdiPlus(html, new Size(650, 50), new Size(1400, 106), TextRenderingHint.SingleBitPerPixelGridFit); +``` + +* The image background is fully transparent. +* Rendered text is not as smooth as GDI or non GridFit text rendering. +* Restricted max width is above the max required width to layout the longest text without wrapping so it has no effect. +* Restricted min width is also above the required layout width (541px) therefore the html is extended. +* the resulting image width is 650px and the html uses the full width to layout. +* Restricted max height is lower than the required height to fully render the html therefore it is clipped at the restricted height value: 106px. + +![html7.png](images/html7.png) + +## 4. HTML used in examples + +#### HTML snippet + +``` html + +

Render to Image

+
+ + + + + +
+ + This text is inside a table element.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. +
+ + +``` + +#### Referenced image in the HTML snippet + +![img.png](images/img.png) + +#### Background Image used in [Generate image with image background](#2-image-background) + +![Background image](images/base.png) + +#### Expected result (as rendered in Google Chrome): + +![Expected.png](images/Expected.png) + +## 5. GDI vs. GDI+ text rendering + +In a nutshell, GDI text rendering provides the best performance and visual quality. + +Reasons: + +1. GDI+ is resolution independent, it may cause glyphs to increase in width tightening up the text. +2. The font hinting of GDI+ has lower quality than GDI, especially for lower sizes. +3. GDI+ is stateless in nature casing it to set and reset its context multiple times. + +But GDI text rendering has two limitations: + +1. Direct rendering to image device results in corrupted pixels. +2. Text rendering with transparent background results in corrupted pixels. + +![result.png](images/result.png) + +The first issue can be addressed by [Why text appears different when drawn with GDIPlus versus GDI](https://theartofdev.com/2013/10/24/transparent-text-rendering-with-gdi/). + +* [ClearType](https://en.wikipedia.org/wiki/ClearType) on Wikipedia. +* [The wonders of text rendering and GDI](https://theartofdev.com/2013/08/12/the-wonders-of-text-rendering-and-gdi). +* [Text rendering methods comparison or GDI vs. GDI+ revised](https://theartofdev.com/2014/04/21/text-rendering-methods-comparison-or-gdi-vs-gdi-revised). +* [GDI text rendering to image](https://theartofdev.com/2014/01/12/gdi-text-rendering-to-image). +* [Transparent text rendering with GDI.](https://theartofdev.com/2013/10/24/transparent-text-rendering-with-gdi/) diff --git a/Documentation/docs/images/Expected.png b/Documentation/docs/images/Expected.png new file mode 100644 index 000000000..4d91dca4b Binary files /dev/null and b/Documentation/docs/images/Expected.png differ diff --git a/Documentation/docs/images/base.png b/Documentation/docs/images/base.png new file mode 100644 index 000000000..880cab3e0 Binary files /dev/null and b/Documentation/docs/images/base.png differ diff --git a/Documentation/docs/images/html.png b/Documentation/docs/images/html.png new file mode 100644 index 000000000..bb026da3b Binary files /dev/null and b/Documentation/docs/images/html.png differ diff --git a/Documentation/docs/images/html0.png b/Documentation/docs/images/html0.png new file mode 100644 index 000000000..0f38d4585 Binary files /dev/null and b/Documentation/docs/images/html0.png differ diff --git a/Documentation/docs/images/html1.png b/Documentation/docs/images/html1.png new file mode 100644 index 000000000..3471cdffc Binary files /dev/null and b/Documentation/docs/images/html1.png differ diff --git a/Documentation/docs/images/html2.png b/Documentation/docs/images/html2.png new file mode 100644 index 000000000..1d2656ce0 Binary files /dev/null and b/Documentation/docs/images/html2.png differ diff --git a/Documentation/docs/images/html3.png b/Documentation/docs/images/html3.png new file mode 100644 index 000000000..f0c943eb6 Binary files /dev/null and b/Documentation/docs/images/html3.png differ diff --git a/Documentation/docs/images/html4.png b/Documentation/docs/images/html4.png new file mode 100644 index 000000000..61e113ff5 Binary files /dev/null and b/Documentation/docs/images/html4.png differ diff --git a/Documentation/docs/images/html5.png b/Documentation/docs/images/html5.png new file mode 100644 index 000000000..f3e895d71 Binary files /dev/null and b/Documentation/docs/images/html5.png differ diff --git a/Documentation/docs/images/html6.png b/Documentation/docs/images/html6.png new file mode 100644 index 000000000..e429e6bdc Binary files /dev/null and b/Documentation/docs/images/html6.png differ diff --git a/Documentation/docs/images/html7.png b/Documentation/docs/images/html7.png new file mode 100644 index 000000000..d64c714a5 Binary files /dev/null and b/Documentation/docs/images/html7.png differ diff --git a/Documentation/docs/images/img.png b/Documentation/docs/images/img.png new file mode 100644 index 000000000..53774a91a Binary files /dev/null and b/Documentation/docs/images/img.png differ diff --git a/Documentation/docs/images/result.png b/Documentation/docs/images/result.png new file mode 100644 index 000000000..d3437f596 Binary files /dev/null and b/Documentation/docs/images/result.png differ diff --git a/Documentation/docs/pdf-generation.md b/Documentation/docs/pdf-generation.md new file mode 100644 index 000000000..a1dceaff2 --- /dev/null +++ b/Documentation/docs/pdf-generation.md @@ -0,0 +1,3 @@ +# PDF Generation + +coming soon diff --git a/Documentation/docs/rendering-svg-images.md b/Documentation/docs/rendering-svg-images.md new file mode 100644 index 000000000..af1b96a23 --- /dev/null +++ b/Documentation/docs/rendering-svg-images.md @@ -0,0 +1,34 @@ +# Rendering SVG Images + +## Rendering SVG images in HTML Renderer + +.NET framework doesn't support SVG format so HTML Renderer cannot natively load and render it. +To overcome this limitation a third-party library can be used to convert SVG formatted image to PNG formatted image that can be rendered by .NET. +It can be done using `ImageLoad` delegate/event that allows to intercept image loading and overwrite SVG image loading with converted PNG image. + +### Example + +Generate image from HTML containing SVG image +Using [SVG](https://github.com/vvvv/SVG) open-source project added using [NuGet](http://www.nuget.org/packages/Svg/) package. +Rendering this [SVG image](http://www.tuxpaint.org/stamps/stamps/animals/insects/cartoon/monarchbutterfly.svg). + +``` csharp +string html = "

Rendered SVG image


"; +CssData css = CssData.Parse("body { font:14pt Tahoma } h3 { color: navy; font-weight:normal; }"); +Image generatedImage = HtmlRender.RenderToImage(html, cssData: css, imageLoad: (sender, args) => +{ + var path = Path.GetExtension(args.Src); + if( path != null && path.Equals(".svg", StringComparison.OrdinalIgnoreCase) ) + { + SvgDocument svgDoc = SvgDocument.Open(args.Src); + Bitmap svgImg = new Bitmap((int)svgDoc.Width, (int)svgDoc.Height, PixelFormat.Format32bppArgb); + svgDoc.Draw(svgImg); + args.Callback(svgImg); + } +}); +generatedImage.Save(@"d:\html.png", ImageFormat.Png); +``` + +### Output + +![html.png](images/html.png "html.png") diff --git a/Documentation/faq.md b/Documentation/faq.md new file mode 100644 index 000000000..9dee91b1a --- /dev/null +++ b/Documentation/faq.md @@ -0,0 +1,70 @@ +# FAQ + +## Why Are SVG Images Not Working? + +.NET doesn't support SVG format. +A workaround is to convert SVG to PNG during rendering, see [Rendering SVG images](docs/rendering-svg-images). + +## Is WPF Supported? + +Yep, WPF is fully supported. + +## Is AvaloniaUI Supported? + +Not directly, but there's a separately maintained fork: https://github.com/AvaloniaUI/Avalonia.HtmlRenderer + +## Is SkiaSharp Supported? + +Not at the moment, some attempts [have been made](https://github.com/ArthurHub/HTML-Renderer/pull/200) in the past. +Care to contribute? + +## Are Metro, Xamarin, Unity, XNA or FNA Supported? + +Some of them are not as relevant at the used to be. +Is it something that enough people would like to see? + +## Is Mono Supported? + +It used to be supported, but since Mono has been largely merged into the .NET runtime, there's little point in maintaining this. + +Starting with HtmlRenderer 1.5.1, Mono support has been halted. + +## Is Silverlight Supported? + +Silverlight has been discontinued in 2019. +You may want to check your calendar. + +## What About JavaScript? + +JavaScript is extremely hard to support, so it is not really in scope. + +## Why Can't I Navigate to a URL? + +HTML Renderer is not a web-browser. + +## Can I Generate Image From HTML? + +Yep, see the [Image Generation](docs/image-generation) documentation. + +## Can I Generate PDF Document From HTML? + +Yep, see [PDF Generation](docs/pdf-generation) documentation. +Currently powered by [PDFsharp](https://www.pdfsharp.com/) but it is quite easy to add more frameworks like [iTextSharp](https://github.com/itext/itext-dotnet). + +## Can You Sign the Library With Strong-Name? + +Strong-Names [seems to have been](https://github.com/octokit/octokit.net/issues/405) quite the religious war some years ago. +These days, [Microsoft recommends](https://github.com/dotnet/runtime/blob/main/docs/project/strong-name-signing.md) to not strong-name assemblies. + +## Can You Sign the Library With a Certificate? + +While this would be awesome, it won't be happening anytime soon, because of two reasons: + +* Getting a certificate to sign assemblies costs money, which this open source project doesn't have +* To get a certificate, you need a legal entity, which this open source project doesn't have + +The only potential paths forward would be to either join the [Open Source Collective](https://oscollective.org/) or be adopted by the [.NET Foundation](https://dotnetfoundation.org/), both of which offer code signing. + +## Can I Contribute? + +Sure! go to [ArthurHub/HTML-Renderer](https://github.com/ArthurHub/HTML-Renderer) on GitHub and fork away. diff --git a/Documentation/images/demo_collage.png b/Documentation/images/demo_collage.png new file mode 100644 index 000000000..9b6286414 Binary files /dev/null and b/Documentation/images/demo_collage.png differ diff --git a/Documentation/images/demo_generateImage.png b/Documentation/images/demo_generateImage.png new file mode 100644 index 000000000..7d40e8a15 Binary files /dev/null and b/Documentation/images/demo_generateImage.png differ diff --git a/Documentation/images/demo_mono.png b/Documentation/images/demo_mono.png new file mode 100644 index 000000000..b9e4d71d9 Binary files /dev/null and b/Documentation/images/demo_mono.png differ diff --git a/Documentation/images/demo_pdf.png b/Documentation/images/demo_pdf.png new file mode 100644 index 000000000..77f506975 Binary files /dev/null and b/Documentation/images/demo_pdf.png differ diff --git a/Documentation/images/demo_sampleForm.png b/Documentation/images/demo_sampleForm.png new file mode 100644 index 000000000..9903767c1 Binary files /dev/null and b/Documentation/images/demo_sampleForm.png differ diff --git a/Documentation/images/demo_showcase.png b/Documentation/images/demo_showcase.png new file mode 100644 index 000000000..05aed85a7 Binary files /dev/null and b/Documentation/images/demo_showcase.png differ diff --git a/Documentation/images/demo_text.png b/Documentation/images/demo_text.png new file mode 100644 index 000000000..561022b05 Binary files /dev/null and b/Documentation/images/demo_text.png differ diff --git a/Documentation/images/demo_textEdit.png b/Documentation/images/demo_textEdit.png new file mode 100644 index 000000000..31f2c8aaa Binary files /dev/null and b/Documentation/images/demo_textEdit.png differ diff --git a/Documentation/images/demo_tooltip.png b/Documentation/images/demo_tooltip.png new file mode 100644 index 000000000..fd4eda111 Binary files /dev/null and b/Documentation/images/demo_tooltip.png differ diff --git a/Documentation/images/demo_winforms.png b/Documentation/images/demo_winforms.png new file mode 100644 index 000000000..6de0f4f76 Binary files /dev/null and b/Documentation/images/demo_winforms.png differ diff --git a/Documentation/images/demo_wpf.png b/Documentation/images/demo_wpf.png new file mode 100644 index 000000000..c2e77fa1b Binary files /dev/null and b/Documentation/images/demo_wpf.png differ diff --git a/Documentation/images/favicon.ico b/Documentation/images/favicon.ico new file mode 100644 index 000000000..fa09d9f9d Binary files /dev/null and b/Documentation/images/favicon.ico differ diff --git a/Documentation/images/logo.png b/Documentation/images/logo.png new file mode 100644 index 000000000..4e2eb38d5 Binary files /dev/null and b/Documentation/images/logo.png differ diff --git a/Documentation/index.md b/Documentation/index.md new file mode 100644 index 000000000..f12a71cc0 --- /dev/null +++ b/Documentation/index.md @@ -0,0 +1,7 @@ +# HTML Renderer + +Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library. + +The library is 100% managed C# code without any external dependencies (no WebBrowser control, ActiveX / COM or MSHTML dll), the only requirement is .NET Framework 4.6.2 or higher. + +![WinForms Demo](images/demo_winforms.png) diff --git a/Documentation/installation.md b/Documentation/installation.md new file mode 100644 index 000000000..e7aac2b05 --- /dev/null +++ b/Documentation/installation.md @@ -0,0 +1,5 @@ +# Installation + +## Manual + +## NuGet package diff --git a/Documentation/quickstart.md b/Documentation/quickstart.md new file mode 100644 index 000000000..b69620940 --- /dev/null +++ b/Documentation/quickstart.md @@ -0,0 +1,76 @@ +# Quickstart + +## Install + +Download the [latest release zip](https://github.com/ArthurHub/HTML-Renderer/releases), worth having around for the [Demo application](./Demo-application). +Either reference the proper DLL's from the downloaded release zip: HtmlRenderer.dll and one of: HtmlRenderer.WinForms.dll, HtmlRenderer.WPF.dll, HtmlRenderer.PdfSharp.dll. Note: add the targeted framework dlls you are targeting in your project, for PdfSharp you will also need to download [PdfSharp dll](https://github.com/empira/PDFsharp). Or, simply install the proper NuGet package using Visual Studio or command line: + +* HTML WinForms ([HtmlRenderer.WinForms](https://www.nuget.org/packages/HtmlRenderer.WinForms)) +* HTML WPF ([HtmlRenderer.WPF](https://www.nuget.org/packages/HtmlRenderer.WPF)) +* Mono ([HtmlRenderer.Mono](https://www.nuget.org/packages/HtmlRenderer.Mono)) +* PDF using PdfSharp ([HtmlRenderer.PdfSharp](https://www.nuget.org/packages/HtmlRenderer.PdfSharp)) + +## WinForms HtmlPanel + +In form (Form1) add the following: + +``` csharp +public partial class Form1 : Form +{ + public Form1() + { + InitializeComponent(); + + TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); + htmlPanel.Text = "

Hello World

This is html rendered text

"; + htmlPanel.Dock = DockStyle.Fill; + Controls.Add(htmlPanel); + } +} +``` + +## WPF HtmlPanel + +In window (Window1) XAML add the following: + +``` xml + + + + + +``` + +## Generate Image + +Add the following snippet in your main method: (for more advance usage see [Image generation](image-generation)) + +``` csharp +class Program +{ + private static void Main(string[] args) + { + Image image = TheArtOfDev.HtmlRenderer.WinForms.HtmlRender.RenderToImage("

Hello World

This is html rendered text

"); + image.Save("image.png", ImageFormat.Png); + } +} +``` + +## Generate PDF + +Add the following snippet in your main method: (for more advance usage see [PDF generation](pdf-generation)) + +``` csharp +class Program +{ + private static void Main(string[] args) + { + PdfDocument pdf = PdfGenerator.GeneratePdf("

Hello World

This is html rendered text

", PageSize.A4); + pdf.Save("document.pdf"); + } +} +``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..2a61de429 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +zensical==0.0.* \ No newline at end of file diff --git a/zensical.toml b/zensical.toml new file mode 100644 index 000000000..7ff84f443 --- /dev/null +++ b/zensical.toml @@ -0,0 +1,44 @@ +[project] +site_name = "HTML Renderer" +site_description = "" +docs_dir = "Documentation" +site_dir = "Site" +copyright = "© 2025 Arthur" +nav = [ + {"Home" = [ + "index.md", + "quickstart.md", + "demos.md", + "installation.md", + "faq.md", + ]}, + {"Documentation" = [ + "docs/image-generation.md", + "docs/pdf-generation.md", + "docs/rendering-svg-images.md", + ]}, + {"Development" = [ + "dev/html-css-support.md" + ]} +] + +[project.theme] +logo = "images/logo.png" +favicon = "images/favicon.ico" +features = [ + "navigation.tabs" +] + +# Palette toggle for light mode +[[project.theme.palette]] +media = "(prefers-color-scheme: light)" +scheme = "default" +toggle.icon = "lucide/sun" +toggle.name = "Switch to dark mode" + +# Palette toggle for dark mode +[[project.theme.palette]] +media = "(prefers-color-scheme: dark)" +scheme = "slate" +toggle.icon = "lucide/moon" +toggle.name = "Switch to light mode" \ No newline at end of file