Render local and remote markdown files inside your projects and games!
This project is in active development and not ready for production use.
- Breaking changes may happen at any time
- Features may be incomplete or unstable
- No guarantees of backward compatibility until a stable release (v1.0)
Feedback and contributions are welcome, but please don't rely on this in a production environment yet.
Install via Nuget: dotnet add package MonoBrowser
- Add component to your game or project Please, check the monobrowser-example for the latest options
var browserWindow = new Rectangle(10, 10, _graphics.PreferredBackBufferWidth - 20, _graphics.PreferredBackBufferHeight - 20);
var browser = new BrowserComponent(this, browserWindow)
{
EnableScrollbar = true, // shows the scrollbar
AllowWheelScroll = true,
AllowKeyScroll = true,
DisableImages = true,
EnableDebug = true,
SyntaxHighlight = "c#" // show colors in code blocks
};
browser.OnLinkClicked += (_, url) =>
{
// load new page or invoke method inside your game
Console.WriteLine($"User clicked on: {url}");
};
// in alpha version you need to wait component to download fonts and some loading logic
// or force Component.LoadContent()
browser.OnReady += (_, _) =>
{
// load remote document
browser.Navigate("https://raw.githubusercontent.com/romanov/monobrowser/refs/heads/main/README.md");
// load local document
// browser.LoadFile("path to your file");
// load local document from Content folder of your app
// browser.Navigate("content://TEST.md");
};
Components.Add(browser);
- Open remote markdown document with
browser.Navigate("https://yoursite/readme.md") - Close window with
browser.Close()
F5: Refresh remote document.
Tilda: Open debug menu (in debug mode).
You can load markdown content directly.
browser.FromString("""
# Game manual
My game is **awesome** and here you can
[read more](https://mygame.test) about it.
## How to play
- Run my game
- Click on a play button
- Enjoy!
""");
- MonoBrowser - a browser for markdown files (in development) based on MonoBrowser Core.
- MonoBrowser Core - a lightweight bare minimum browser component & markdown rendering engine written in F# for MonoGame, and adaptable to desktop, mobile, and embedded C#/F# applications.
Works in your C# or F# MonoGame projects. Library tested on Windows 11, and macOS 26 Tahoe Library tested on Linux (Elementary OS 8.1)
- Multiple windows.
ImageSharp - allows convert images to PNG and load it to the game
AngleSharp - HTML parser
Markdig - markdown parser
FontStashSharp - fonts and text rendering
Apos Input - events
Open Sans font - default font
ColorCode - Syntax Highlight