dio.la

Dani Guardiola’s blog

Jan 1, 1970January 1st, 1970 · 3 minute read · tweet

Test article

Nothing to see here, keep walking.

This article's main image
ts
// @filename: maths.tsexport function function absolute(num: number): numberabsolute(num: numbernum: number) { if (num: numbernum < 0) return num: numbernum * -1; return num: numbernum;}// @filename: index.tsimport { function absolute(num: number): numberabsolute } from "./maths";const const value: numbervalue = function absolute(num: number): numberabsolute(-1);Open in playground
ts
function function compact(arr: any): anycompact(arr: anyarr) { if (orr.length > 10) return arr: anyarr.trim(0, 10);
Cannot find name 'orr'.
return arr: anyarr;}
test
Open in playground

hello

ts
import * as import solidsolid from "solid-js";import solidsolid.cre
  • createComponent
  • createContext
  • createEffect
  • createMemo
  • createOptimistic
  • createOptimisticStore
  • createOwner
  • createProjection
  • createReaction
  • createRenderEffect
  • createRoot
  • createSignal
  • createStore
  • createUniqueId
  • createTrackedEffect
;
Open in playground
ts
const const words: anywords = const welcome: "Tudo bem gente?"welcome.contains(" ");
Property 'contains' does not exist on type '"Tudo bem gente?"'.
const const welcome2: "Tudo bem gente?"welcome2 = "Tudo bem gente?";
Open in playground
ts
function function greet(person: string): voidgreet(person: stringperson: string) { var console: Consoleconsole.Console.log(...data: any[]): void

The console.log() static method outputs a message to the console.

MDN Reference

log
(`Hello ${person: stringperson},`);
var console: Consoleconsole.Console.log(...data: any[]): void

The console.log() static method outputs a message to the console.

MDN Reference

log
(`How do?`);
}function greet(person: string): voidgreet("Maddison");
Open in playground

Let's talk a bit about a:

ts
const const a: 1a = 1;Open in playground

a can be added to anosther number

ts
const const nextA: numbernextA = const a: 1a + 13;Open in playground

Look what happens when you add a + b

ts
const result = const a: 1a + const b: "2"b;
const result: string
const const someMoreCode: "just to test"someMoreCode = "just to test";
Open in playground

Finally here is c:

ts
const c: "string"c.String.toString(): string

Returns a string representation of a string.

toString
();
Open in playground

Good one!!

image alt lol

link test

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc finibus eget urna a dictum. Donec ac dui et dui cursus ullamcorper. Aenean consectetur cursus tristique. Nullam vehicula eros eget aliquet consequat. Nunc dictum odio vel pulvinar posuere. Fusce semper odio eget pharetra facilisis. Ut at nunc neque. Vivamus ullamcorper libero vel porttitor aliquet.

ts
function function createLabel<T extends number | string>(idOrName: T): NameOrId<T>createLabel<function (type parameter) T in createLabel<T extends number | string>(idOrName: T): NameOrId<T>T extends number | string>(idOrName: T extends number | stringidOrName: function (type parameter) T in createLabel<T extends number | string>(idOrName: T): NameOrId<T>T): type NameOrId<T extends number | string> = T extends number ? IdLabel : NameLabelNameOrId<function (type parameter) T in createLabel<T extends number | string>(idOrName: T): NameOrId<T>T> { throw "unimplemented";}let let a: NameLabela = function createLabel<"typescript">(idOrName: "typescript"): NameLabelcreateLabel("typescript");Open in playground

Heading 1

Note: you can also achieve this by doing this and that!

Even with this and that:

  • Hello
    • I'm just a list
    • Bruh

Heading 2

Heading 3

Hello

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc finibus eget urna a dictum. Donec ac dui et dui cursus ullamcorper. Aenean consectetur cursus tristique. Nullam vehicula eros eget aliquet consequat. Nunc dictum odio vel pulvinar posuere. Fusce semper odio eget pharetra facilisis. Ut at nunc neque. Vivamus ullamcorper libero vel porttitor aliquet.

Curabitur pharetra metus id ligula consectetur, eu imperdiet justo venenatis. Mauris vel diam in massa molestie dictum. Vestibulum sit amet aliquam justo. In in velit sit amet mi euismod imperdiet. Aliquam consequat elementum dolor, sed sagittis mauris gravida sed. Suspendisse luctus justo dignissim mollis rhoncus. Cras metus velit, vulputate nec massa vel, imperdiet molestie tellus. Phasellus vitae sagittis quam, rhoncus facilisis lacus. Nulla facilisis orci consectetur neque laoreet, vitae malesuada nibh finibus. Nulla leo lectus, pharetra ut lacus vulputate, pharetra porttitor metus.

Yoo

Mauris mattis mattis elit, ultricies porttitor augue ullamcorper vitae. Donec aliquam sagittis eros, consequat convallis lorem posuere vestibulum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in egestas purus. Aliquam euismod lorem et porttitor finibus. Quisque vitae magna dolor. Aliquam nec lacus non urna facilisis porttitor ut nec ligula.

Bruh

Phasellus varius purus tortor, ut tempor lectus dignissim et. Vivamus facilisis leo orci, eu fermentum mi finibus id. Integer et eleifend arcu. Aliquam ut lobortis diam. Nullam vestibulum vitae erat eget viverra. Proin id quam ligula. Pellentesque lorem enim, varius id vulputate eu, imperdiet id augue. Quisque ac est mi. Aliquam molestie ultricies lectus, ac consequat ipsum convallis molestie. Cras a nibh vitae nibh varius maximus nec vitae massa. Fusce eget rutrum odio. Sed non tortor pharetra, facilisis enim eget, consectetur turpis.

Hi there!

Mauris mattis mattis elit, ultricies porttitor augue ullamcorper vitae. Donec aliquam sagittis eros, consequat convallis lorem posuere vestibulum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in egestas purus. Aliquam euismod lorem et porttitor finibus. Quisque vitae magna dolor. Aliquam nec lacus non urna facilisis porttitor ut nec ligula.

Markdown test

This a test of all markdown possibilities:


Headings

h1 Heading 1

h2 Heading 2

h3 Heading 3

h4 Heading 4

h5 Heading 5
h6 Heading 6

Horizontal Rules





Emphasis

This is bold text

This is bold text

This is italic text

This is italic text

Strikethrough


link text

link with title

This is an example inline link.

This link has no title attribute.


Blockquotes

Blockquotes can also be nested...

...by using additional greater-than signs right next to each other...

...or with spaces between arrows.

...hello.

bruh


Indentation

indentation 1-1

indentation 1-2 indentation 2-1


Lists

Unordered

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!

Ordered

Numers in sequence

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa

Numers not in sequence

  1. You can use sequential numbers...
  2. ...or keep all the numbers as 1.

Images

Minion Stormtroopocat

Like links, Images also have a footnote style syntax

Alt text

With a reference later in the document defining the URL location:


Tables

OptionDescription
datapath to data files to supply the data that will be passed into templates.
engineengine to be used for processing templates. Handlebars is the default.
extextension to be used for dest files.

Right aligned columns

OptionDescription
datapath to data files to supply the data that will be passed into templates.
engineengine to be used for processing templates. Handlebars is the default.
extextension to be used for dest files.

Code

Inline code

Indented code

// Some comments line 1 of code line 2 of code line 3 of code

Block code "fences"

Sample text here...

Syntax highlighting

json
{ "json": true }

Code annotations

Matching brackets use nesting colors in every code block. Shiki comments below mark changes, focus a line and highlight a word; the directives are hidden from readers.

ts
const previous = { count: 1 }; const updated = { count: 2 }; console.log(updated.count); console.log("Done");

Rich types and horizontal scrolling

Hover a property before and after scrolling this deliberately wide example. The query below the code should remain visible without overlapping other lines.

ts
/** A value used to verify rich hover documentation and long code lines. */const
const example: {
    count: number;
    description: string;
}

A value used to verify rich hover documentation and long code lines.

example
= { count: numbercount: 42, description: stringdescription: "This deliberately long description keeps the code wider than a narrow viewport so horizontal scrolling and tooltip positioning can be checked together." };
const example: {
    count: number;
    description: string;
}

A value used to verify rich hover documentation and long code lines.

example
.count;
count: number
Open in playground

Keep up with my stuff. Zero spam.

You're looking at my drafts!

Visit the main site: dio.la