8910export async function getHtmlFromUrl(url) {
11try {
12const response = await fetch(url);
2324// todo, pass in html optional, and skip fetch?
25export async function getMetadataFromUrl(url) {
26const response = await fetch(url, {
27method: "GET",
707172// Function to remove unwanted selectors from the HTML and return the cleaned HTML
73export function removeSelectorsFromHtml(html, removeSelectors = "style, script, link, noscript, frame, iframe, comment") {
74const $ = cheerio.load(html); // Load the HTML into Cheerio
75$(removeSelectors).remove(); // Remove unwanted tags
808182// Function to use Cheerio to select text from the html, and attempts to clean it a bit
83export function selectHtml(html, selector = "h1", removeSelectors = "style, script, link, noscript, frame, iframe, comment") {
84const $ = cheerio.load(html); // Load the cleaned HTML into Cheerio
85$(removeSelectors).remove(); // Remove unwanted tags
95}
9697export async function convertHtml(html, option = "semantic") {
98switch (option) {
99case "markdown":
108}
109110export async function convertHtmlToSemanticMarkdown(html, options = {}) {
111const dom = new JSDOM(html);
112return convertHtmlToMarkdown(html, {
126};
127128// Function to convert HTML to Pug using html2pug
129export function convertHtmlToPug(html, options = { tabs: true }) {
130const pug = html2pug(html, options);
131return pug;
password_authmain.tsx5 matches
11};
1213async function createSessionTable(tableName: string) {
14await sqlite.execute(`CREATE TABLE ${tableName} (
15id TEXT NOT NULL PRIMARY KEY,
19}
2021async function createSession(tableName: string, valSlug: string): Promise<Session> {
22try {
23const expires_at = new Date();
39}
4041async function getSession(tableName: string, sessionID: string, valSlug: string): Promise<Session> {
42try {
43const { rows, columns } = await sqlite.execute({
80</html>`;
8182export function redirect(location: string): Response {
83return new Response(null, {
84headers: {
98const cookieName = "auth_session";
99100export function passwordAuth(next, options?: PasswordAuthOptions) {
101const sessionTable = options?.sessionTable || "password_auth_session";
102return async (req: Request) => {
rainyAquamarineDonkeymain.tsx4 matches
27`;
2829function RedBall() {
30return <CentralDot />;
31}
3233function App() {
34return (
35<div style={{ position: "relative", height: "100vh", width: "100vw" }}>
47}
4849function client() {
50const root = document.getElementById("root");
51if (root) {
58if (typeof document !== "undefined") { client(); }
5960export default async function server(request: Request): Promise<Response> {
61return new Response(
62`
codemirror_demomain.tsx1 match
18`;
1920export default function() {
21return new Response(body, {
22headers: {
nationalPeachPeacockmain.tsx1 match
12};
1314export default async function(interval: Interval) {
15const response = await notion.databases.query({
16database_id: DATABASE_ID,
wetGrayQueleamain.tsx1 match
12};
1314export default async function(interval: Interval) {
15const response = await notion.databases.query({
16database_id: DATABASE_ID,
dailyPeachSalmonmain.tsx1 match
12};
1314export default async function(interval: Interval) {
15const response = await notion.databases.query({
16database_id: DATABASE_ID,
notionRecurringTasksmain.tsx1 match
12};
1314export default async function(interval: Interval) {
15const response = await notion.databases.query({
16database_id: DATABASE_ID,
redBallComponentmain.tsx2 matches
19`;
2021export default async function server(request: Request): Promise<Response> {
22return new Response(
23`
44<div id="root"></div>
45<script type="text/babel">
46function RedBall() {
47return (
48<div
1819- pie: Syntax Drawing a pie chart is really simple in mermaid. Start with pie keyword to begin the diagram showData to render the actual data values after the legend text. This is OPTIONAL Followed by title keyword and its value in string to give a title to the pie-chart. This is OPTIONAL Followed by dataSet. Pie slices will be ordered clockwise in the same order as the labels. label for a section in the pie diagram within " " quotes. Followed by : colon as separator Followed by positive numeric value (supported up to two decimal places) [pie] [showData] (OPTIONAL) [title] [titlevalue] (OPTIONAL) "[datakey1]" : [dataValue1] "[datakey2]" : [dataValue2] "[datakey3]" : [dataValue3]
20- xychart-beta: Syntax INFO All text values that contain only one word can be written without ". If a text value has many words in it, specifically if it contains spaces, enclose the value in " Orientations The chart can be drawn horizontal or vertical, default value is vertical. xychart-beta horizontal ... Title The title is a short description of the chart and it will always render on top of the chart. Example xychart-beta title "This is a simple example" ... INFO If the title is a single word one no need to use ", but if it has space " is needed x-axis The x-axis primarily serves as a categorical value, although it can also function as a numeric range value when needed. Example x-axis title min --> max x-axis will function as numeric with the given range x-axis "title with space" [cat1, "cat2 with space", cat3] x-axis if categorical, categories are text type y-axis The y-axis is employed to represent numerical range values, it cannot have categorical values. Example y-axis title min --> max y-axis title it will only add the title, the range will be auto generated from data. INFO Both x and y axis are optional if not provided we will try to create the range Line chart A line chart offers the capability to graphically depict lines. Example line [2.3, 45, .98, -3.4] it can have all valid numeric values. Bar chart A bar chart offers the capability to graphically depict bars. Example bar [2.3, 45, .98, -3.4] it can have all valid numeric values. Simplest example The only two things required are the chart name (xychart-beta) and one data set. So you will be able to draw a chart with a simple config like xychart-beta line [+1.3, .6, 2.4, -.34]
2122Some good examples for mermaid charts are: