This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Markdoc from "@markdoc/markdoc"; | |
import {Parser} from "htmlparser2"; | |
const mappings = { | |
p: 'paragraph', | |
li: 'item', | |
table: 'table', | |
tr: 'tr', | |
td: 'td', | |
tbody: 'tbody', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Markdoc from "@markdoc/markdoc"; | |
const config = { | |
tags: { | |
table: { | |
slots: { | |
caption: { render: false }, | |
}, | |
transform(node, config) { | |
if (node.children[0]?.type !== "table") return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Markdoc = require('@markdoc/markdoc'); | |
const example = ` | |
{% definition-list %} | |
{% definition term="this is the term" %} | |
This is the definition | |
{% /definition %} | |
{% definition term="another term" %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Checkout Example</title> | |
</head> | |
<body> | |
<form action="/charge" method="post" class="payment"> | |
<article> | |
<label class="amount"> | |
<span>Amount: $5.00</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keyPublishable = process.env.PUBLISHABLE_KEY; | |
const keySecret = process.env.SECRET_KEY; | |
const app = require("express")(); | |
const stripe = require("stripe")(keySecret); | |
app.set("view engine", "pug"); | |
app.use(require("body-parser").urlencoded({extended: false})); | |
app.get("/", (req, res) => |