Skip to content

Instantly share code, notes, and snippets.

@gtm19
Last active September 16, 2025 19:06
Show Gist options
  • Select an option

  • Save gtm19/1ac34be12b6fda4d2a965985b675a868 to your computer and use it in GitHub Desktop.

Select an option

Save gtm19/1ac34be12b6fda4d2a965985b675a868 to your computer and use it in GitHub Desktop.

Hello there!

Introduction

You should know that this markdown is being pulled from a GitHub gist - which means you can edit your docs outside your model and update them without having to re-release the model 🎉

This is a custom UI component with renders markdown (albeit, markdown horribly written into a JavaScript file) as HTML in the UI only.

This means no assigning big chunks of text to nodes in your hxd in order to see docs!

Credit where credit is due

This CUIC uses:

  1. marked.js to render the markdown to HTML
  2. DOMPurify for HTML sanitation
  3. PrismJS for syntax highlighting

Features

Code blocks!

With syntax highlighting, and copy to clipboard buttons.

# Simple list comprehension and function
numbers = [1, 2, 3, 4, 5]
squares = [x**2 for x in numbers]

def greet(name):
    return f"Hello, {name}!"

print(greet("World"))
print(squares)
function Welcome({ name }) {
  const [count, setCount] = useState(0);
  
  return (
    <div>
      <h1>Hello, {name}!</h1>
      <button onClick={() => setCount(count + 1)}>Count: {count}</button>
    </div>
  );
}

Tables!

City Country Population (metro area) Founded Notable Feature
Tokyo Japan ~37 million 1457 (as Edo) World's largest metropolitan area
Paris France ~12 million 3rd century BC Home to the Eiffel Tower and Louvre Museum
Cairo Egypt ~20 million 969 AD Nearby ancient pyramids of Giza
Canberra Australia ~460,000 1913 Purpose-built capital city designed by Walter Burley Griffin

Blockquotes

I am slightly indented and more important than the things around me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment