Markdoc is a Markdown-based syntax and toolchain for creating custom documentation sites and experiences.

Overview


Markdoc

A powerful, flexible, Markdown-based authoring framework.

Markdoc is a Markdown-based syntax and toolchain for creating custom documentation sites and experiences.
We designed Markdoc to power Stripe's public docs, our largest and most complex content site.

Installation

To get started with Markdoc, first install the library:

npm install @markdoc/markdoc

or

yarn add @markdoc/markdoc

and import it in your app:

const Markdoc = require('@markdoc/markdoc');

or if you are using ESM

import Markdoc from '@markdoc/markdoc';

then use Markdoc in your app or tool:

const doc = `
# Markdoc README

{% image src="/logo.svg" /%}
`;

const ast = Markdoc.parse(doc);
const content = Markdoc.transform(ast);
return Markdoc.renderers.react(content, React);

Check out our docs for more guidance on how to use Markdoc.

Contributing

Contributions and feedback are welcome and encouraged. Check out our contributing guidelines on how to do so.

Development

  1. Run npm install
  2. Run npm run build
  3. Run the tests using npm test

Code of conduct

This project has adopted the Stripe Code of conduct.

License

This project uses the MIT license.

Credits

Shout out to @marcioAlmada for providing us with the @markdoc GitHub org.

Comments
  • Unable to add custom tags in Next.js app on Windows

    Unable to add custom tags in Next.js app on Windows

    What happened?

    When running a new NextJS app on a Windows machine running Node v14.19.3 using the markdoc example, the app fails to load, throwing a failed to compile error:

    image

    After some tinkering - I found that by removing the tags, the app / page would finally render.

    To reproduce

    • run npx create-next-app --example https://github.com/markdoc/markdoc-starter
    • run npm run dev
    • App will fail to load and show the error above.

    Version

    0.1.2

    Additional context

    I tried setting up the project on a M1 Mac running node v16.13.0 and the app was able to compile and render. So I'm wondering if this is related to the OS or possibly the node version.

    bug os:windows 
    opened by SamuelQuinones 24
  • Confusing error on multiple markdoc sites

    Confusing error on multiple markdoc sites

    What happened?

    @benguz and I need set up a markdoc site for a nonprofit.

    We are getting this cryptic error, and the error message text cuts off strangely:

    C:UsersenjaOneDriveDocumentsGitHub eactjs.orgeta ode_modules@markdoc ext.jssrc untime.js is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "c:" URIs.

    To reproduce

    @benguz followed the quick start docs.

    Version

    Latest

    Additional context

    Deploying on GitHub pages.

    bug docs next.js os:windows 
    opened by altosaar 18
  • Hot reloading breaks after one minute with the Next.js starter

    Hot reloading breaks after one minute with the Next.js starter

    What happened?

    Whenever I run npm run dev and leave the page untouched in the browser and editor for about a minute, hot reloading doesn't have an effect anymore. The Next.js reload indicator in the lower right corner still shows up but the page does not update when I change something in my sources. Refreshing the page or performing any sort of page navigation (without a full reload) fixes hot reloading until it breaks again after one minute.

    To reproduce

    1. Clone the Next.js starter project and install dependencies using npm install
    2. Start npm run dev
    3. Load the page in a browser
    4. Wait for one minute
    5. Change something in a page file
    6. The Next.js reloading indicator shows up but the page is not updated

    Version

    0.1.4

    Additional context

    The exact commit of the starter repository used is cf36368f405a41499aded8b61b136c0bda44c0e3.

    This problem doesn't occur with a Next.js starter project without Markdoc, so it doesn't seem to be a Next.js issue.

    I'm also not seeing any errors or warnings in the browser console or network tab.

    bug good first issue help wanted next.js 
    opened by symmb 16
  • Footnote support?

    Footnote support?

    Currently there's no way to inject markdown-it plugins down to the tokenizer, so we can't just pass markdown-it-footnotes here, but I can't see any facility for supporting Footnote syntax (which are common in GFM). Any current workarounds?

    enhancement 
    opened by matildepark 11
  • Can not build more than 101 pages with Next.js

    Can not build more than 101 pages with Next.js

    What happened?

    I clone markdoc's Next.js starter demo, randomly add 97 markdom files to pages/docs/ folder, then run npm run build, and Next.js will stuck on info - Creating an optimized production build ... forever.

    To reproduce

    1. git clone https://github.com/markdoc/markdoc-starter
    2. Add random markdown files to pages/docs/ folder like below:
    const fs = require("fs");
    for (let i = 0; i < 98; i++) {
      fs.writeFileSync(`./pages/docs/${i}.md`, `##${i}`);
    }
    
    1. npm run build
    2. It will stuck on info - Creating an optimized production build ... forever.
    3. Delete one markdown file from pages/docs/, and it will build successfully.
    4. And then, without deleting .next folder, add some more markdown files to pages/docs/, will build successfully. But if you delete .next before adding more files, it will hang forever.

    I try to refactor my blog using markdoc, then found this issue. Had tried several next versions and markdoc versions, no luck. I think it's more likely markdoc related? Looking for help, thanks!

    Version

    try latest and older versions

    Additional context

    No response

    bug next.js 
    opened by kejiweixun 7
  • Nextjs MUI doesn't work properly

    Nextjs MUI doesn't work properly

    What happened?

    Nextjs and markdoc works fine but there is an issue when tried to use @MUI components in the tags

    // Button.tsx
    import { Button as MuiButton } from "@mui/material";
    
    export const Button = (props) => <MuiButton {...props} variant="contained" />;
    
    // markdoc/tags/index.tsx
    import { Button } from "../../components/Button";
    
    export const button = {
      render: Button
    };
    
    
    // pages/docs/index.md
    ---
    title: Get started with Markdoc
    description: How to get started with Markdoc
    ---
    
    # Get started with Markdoc
    
    - test markdoc
    {% button %}custom button{% /button %}
    
    
    • package.json
    {
      "name": "nextjs-markdoc",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start",
        "lint": "next lint"
      },
      "dependencies": {
        "@emotion/react": "^11.10.4",
        "@emotion/styled": "^11.10.4",
        "@markdoc/next.js": "^0.1.8",
        "@mui/material": "^5.10.7",
        "next": "12.3.1",
        "react": "18.2.0",
        "react-dom": "18.2.0"
      },
      "devDependencies": {
        "eslint": "8.24.0",
        "eslint-config-next": "12.3.1"
      }
    }
    
    

    I got this error

    
    wait  - compiling /docs (client and server)...
    Undefined tag: 'button'
    Error: Undefined tag: 'button'
    - test markdoc
    {% button %}custom button{% /button %}
    
        at Object.load (/Users/my-user/Documents/projects/nextjs-markdoc/node_modules/@markdoc/next.js/src/loader.js:150:13)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async Object.loader (/Users/my-user/Documents/projects/nextjs-markdoc/node_modules/@markdoc/next.js/src/loader.js:297:20)
    error - ./pages/docs/index.md
    Error: Undefined tag: 'button'
    - test markdoc
    {% button %}custom button{% /button %}
    error - TypeError: document.querySelectorAll is not a function
        at createCache (/Users/my-user/Documents/projects/nextjs-markdoc/node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js:267:30)
        at Object.<anonymous> (/Users/my-user/Documents/projects/nextjs-markdoc/node_modules/@mui/styled-engine/node/StyledEngineProvider/StyledEngineProvider.js:26:34)
        at Module._compile (node:internal/modules/cjs/loader:1112:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
        at Module.load (node:internal/modules/cjs/loader:988:32)
        at Module._load (node:internal/modules/cjs/loader:834:12)
        at Module.require (node:internal/modules/cjs/loader:1012:19)
        at require (node:internal/modules/cjs/helpers:102:18)
        at Object.<anonymous> (/Users/my-user/Documents/projects/nextjs-markdoc/node_modules/@mui/styled-engine/node/StyledEngineProvider/index.js:15:52)
        at Module._compile (node:internal/modules/cjs/loader:1112:14) {
      page: '/docs'
    

    To reproduce

    1. create a nextjs app
    2. install markdoc and MUI
    3. add tags with MUI components

    Version

    @markdoc/next.js@^0.1.8

    Additional context

    No response

    bug next.js 
    opened by juanvargas-pax 7
  • Replacing Existing Node with Next.js Fails to Pass Attributes

    Replacing Existing Node with Next.js Fails to Pass Attributes

    What happened?

    Following the docs on nodes and next js nodes is confusing.

    Goal: replace the default heading node as the nodes doc demonstrates.

    Following the examples in the nodes seems to lead to either the render function being called with no props other than children, or only the transform step being called and not the render step.

    Suggestion

    Provide more details on the way the nextjs integration interacts with the described transform and render steps, and provide more complete examples for nextjs.

    To reproduce

    1. Create a markdoc file with a h1, h2, h3.
    2. Try this basic example (as implied by the combination of nextjs and non-nextjs docs)
    import { Title } from '../title';
    import { Tag } from '@markdoc/markdoc';
    
    
    const TitleWrapper = ({ level, id, children }) => {
        console.log('Wrapper called')
        return (
            <Title level={level} id={id}>{children}</Title>
        )
    }
    
    export const heading = {
        render: TitleWrapper,
        children: ['inline'],
        attibutes: {
            id: { type: String },
            level: {type: Number, required: true, default: 1}
        }
    }
    
    1. This does render the component however it is never passed any value for level other than the default.

    2. Attempt #2 Try the following

    import { Title } from '../title';
    import { Tag } from '@markdoc/markdoc';
    
    const TitleWrapper = ({ level, id, children }) => {
        console.log('wrapper')
        const order = Math.min((level || 1) +1, 6) as TitleOrder;
        return (
        
            <Title order={order} id={id}>{children}</Title>
        )
    }
    
    
    function generateID(children, attributes) {
     //... skipped for brevity as not relevant
    }
    
    export const heading = {
        render: TitleWrapper,
        children: ['inline'],
        attibutes: {
            id: { type: String },
            level: {type: Number, required: true, default: 1}
        },
        transform(node, config) {
            const attributes = node.transformAttributes(config);
            const children = node.transformChildren(config);
    
            const id = generateID(children, attributes);
    
            return new Tag(
            `h${node.attributes['level']}`,
            { ...attributes, id },
            children
            );
      }
    }
    

    This does allow for multi-level headings however the render function is never called (no log lines printed or component rendered).

    Version

    @markdoc/markdoc": 0.1.2, @markdoc/next.js: 0.1.4

    Additional context

    No response

    bug 
    opened by arranf 7
  • Invalid TS config for `@markdoc/markdoc@0.1.7`

    Invalid TS config for `@markdoc/[email protected]`

    What happened?

    Importing @markdoc/markdoc in a fresh TypeScript projects shows multiple errors:

    node_modules/@markdoc/markdoc/dist/index.d.ts:15:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.                                                     
                                                                                                                                                                                                               
    15 import type Token from 'markdown-it/lib/token';                                                                                                                                                         
                              ~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                          
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/index.d.ts:98:35 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?                                                                               
                                                                                                                                                                                                               
    98         getAstValues(value: any): Generator<import("./src/types").AstType, void, unknown>;                                                                                                              
                                         ~~~~~~~~~                                                                                                                                                             
                                                                                                                                                                                                               
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13                                                                                                                                                   
        271 declare var Enumerator: EnumeratorConstructor;                                                                                                                                                     
                        ~~~~~~~~~~                                                                                                                                                                             
        'Enumerator' is declared here.                                                                                                                                                                         
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/ast/index.d.ts:11:31 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?                                                                       
                                                                                                                                                                                                               
    11     getAstValues(value: any): Generator<AstType, void, unknown>;                                                                                                                                        
                                     ~~~~~~~~~                                                                                                                                                                 
                                                                                                                                                                                                               
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13                                                                                                                                                   
        271 declare var Enumerator: EnumeratorConstructor;                                                                                                                                                     
                        ~~~~~~~~~~                                                                                                                                                                             
        'Enumerator' is declared here.                                                                                                                                                                         
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/ast/node.d.ts:14:13 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?                                                                        
                                                                                                                                                                                                               
    14     walk(): Generator<Node, void, unknown>;                                                                                                                                                             
                   ~~~~~~~~~                                                                                                                                                                                   
                                                                                                                                                                                                               
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13                                                                                                                                                   
        271 declare var Enumerator: EnumeratorConstructor;                                                                                                                                                     
                        ~~~~~~~~~~                                                                                                                                                                             
        'Enumerator' is declared here.                                                                                                                                                                         
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/renderers/react/react.d.ts:1:57 - error TS2307: Cannot find module 'react' or its corresponding type declarations.                                                  
                                                                                                                                                                                                               
    1 import type { createElement, Fragment, ReactNode } from 'react';                                                                                                                                         
                                                              ~~~~~~~                                                                                                                                          
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/tokenizer/index.d.ts:1:24 - error TS2307: Cannot find module 'markdown-it/lib' or its corresponding type declarations.                                              
                                                                                                                                                                                                               
    1 import MarkdownIt from 'markdown-it/lib';                                                                                                                                                                
                             ~~~~~~~~~~~~~~~~~                                                                                                                                                                 
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/tokenizer/index.d.ts:2:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.                                        
                                                                                                                                                                                                               
    2 import type Token from 'markdown-it/lib/token';                                                                                                                                                          
                             ~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                           
                                                                                                                                                                                                               
    node_modules/@markdoc/markdoc/dist/src/utils.d.ts:1:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.                                                  
                                                                                                         
    1 import type Token from 'markdown-it/lib/token';                                                    
                             ~~~~~~~~~~~~~~~~~~~~~~~                                                     
    

    Some of these errors are due to missing dependencies @types/react and @types/markdown-it

    To reproduce

    1. Download or clone https://gist.github.com/alunny-stripe/ed7e03f7a6fd712a8ea93eee36af8dbb
    2. Run npm install
    3. Run npm run types

    Version

    0.1.7

    Additional context

    I ran into slightly different errors on my project, which is using TypeScript 4.5.4 and pnpm. Here are the [email protected] errors:

    node_modules/@markdoc/markdoc/dist/index.d.ts:15:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.                                                     
    
    15 import type Token from 'markdown-it/lib/token';
                              ~~~~~~~~~~~~~~~~~~~~~~~
    
    node_modules/@markdoc/markdoc/dist/index.d.ts:98:35 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?
    
    98         getAstValues(value: any): Generator<import("./src/types").AstType, void, unknown>;
                                         ~~~~~~~~~
    
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13
        271 declare var Enumerator: EnumeratorConstructor;
                        ~~~~~~~~~~
        'Enumerator' is declared here.
    
    node_modules/@markdoc/markdoc/dist/index.d.ts:111:48 - error TS2694: Namespace '"/Users/alunny/dev/markdoc-ts/node_modules/@markdoc/markdoc/dist/src/types"' has no exported member 'Variable'.
    
    111         Variable: typeof import("./src/types").Variable;
                                                       ~~~~~~~~
    
    node_modules/@markdoc/markdoc/dist/src/ast/index.d.ts:11:31 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?
    
    11     getAstValues(value: any): Generator<AstType, void, unknown>;
                                     ~~~~~~~~~
    
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13
        271 declare var Enumerator: EnumeratorConstructor;
                        ~~~~~~~~~~
        'Enumerator' is declared here.
    
    node_modules/@markdoc/markdoc/dist/src/ast/node.d.ts:14:13 - error TS2552: Cannot find name 'Generator'. Did you mean 'Enumerator'?
    
    14     walk(): Generator<Node, void, unknown>;
                   ~~~~~~~~~
    
      node_modules/typescript/lib/lib.scripthost.d.ts:271:13
        271 declare var Enumerator: EnumeratorConstructor;
                        ~~~~~~~~~~
        'Enumerator' is declared here.
    
    node_modules/@markdoc/markdoc/dist/src/renderers/react/react.d.ts:1:57 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
    
    1 import type { createElement, Fragment, ReactNode } from 'react';
                                                              ~~~~~~~
    
    node_modules/@markdoc/markdoc/dist/src/tokenizer/index.d.ts:1:24 - error TS2307: Cannot find module 'markdown-it/lib' or its corresponding type declarations.
    
    1 import MarkdownIt from 'markdown-it/lib';
                             ~~~~~~~~~~~~~~~~~
    
    node_modules/@markdoc/markdoc/dist/src/tokenizer/index.d.ts:2:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.
    
    2 import type Token from 'markdown-it/lib/token';
                             ~~~~~~~~~~~~~~~~~~~~~~~
    
    node_modules/@markdoc/markdoc/dist/src/utils.d.ts:1:24 - error TS2307: Cannot find module 'markdown-it/lib/token' or its corresponding type declarations.
    
    1 import type Token from 'markdown-it/lib/token';
    
    bug 
    opened by alunny-stripe 6
  • Markdoc formatter

    Markdoc formatter

    I need to write a script that modifies Markdoc files. Specifically, it will add an id attribute to nodes that do not yet have one. For example, given the file:

    # Debugging
    
    # Running {% #running %}
    

    I want to modify the file to:

    # Debugging {% #d3adb33f %}
    
    # Running {% #running %}
    

    (Where d3adb33f is some fresh identifier, e.g. a UUID.)

    I want to do this transform with a pipeline like

    input --[Markdoc.parse]--> AST -> --[custom logic]--> AST --[Markdown.stringify]--> output
    

    However, I don't see a Markdoc.stringify, or a Node.toString, or a Markdoc renderer, or anything like that.

    Has anyone written a Markdown.stringify or similar? Or could you recommend some other way to achieve my goals?

    enhancement 
    opened by jameshfisher 6
  • Can't create custom Image Node for Next.js

    Can't create custom Image Node for Next.js

    What happened?

    Markdown automatically wraps a <p> around the whole image component. This results in a Hydration mismatch

    Hydration failed because the initial UI does not match what was rendered on the server.
    
    `Expected server HTML to contain a matching <div> in <p>` because I need a `div` in my component to make it work with `next/image`.
    
    import * as React from 'react'
    import NextImage from 'next/image'
    
    export function Image({ src, alt }: { src: string; alt: string }) {
      return (
        <div style={{ position: 'relative', width: '300px', height: '500px' }}>
          <NextImage
            src={src}
            alt={alt}
            layout="fill"
            objectFit="contain"
            className="rounded object-cover shadow"
          />
        </div>
      )
    }
    
    

    To reproduce

    See above.

    Version

    No response

    Additional context

    No response

    bug 
    opened by StarpTech 6
  • Fast Refresh in Next.js doesn't work

    Fast Refresh in Next.js doesn't work

    What happened?

    Fast Refresh does not work when using the Next.js plugin. You can reproduce it on your own docs.

    To reproduce

    1. Checkout https://github.com/markdoc/docs
    2. Start npm run dev
    3. Go to http://localhost:3002/docs/getting-started
    4. Edit text in pages/docs/getting-started.md
    5. No effect unless you reload the page.

    Version

    0.1.3

    Additional context

    @markdoc/next.js": "^0.1.4"

    bug next.js 
    opened by StarpTech 6
  • Fence blocks can result in invalid nodes missing a name that breaks react rendering

    Fence blocks can result in invalid nodes missing a name that breaks react rendering

    What happened?

    When using a custom Fence node with a definition of:

    {
     ...
     fence: {
        render: 'Fence',
        attributes: {
          language: { type: String },
          process: { type: Boolean, render: false, default: true },
        }
      },
      ...
    }
    

    And a (simplified) component being passed like:

      const r = Markdoc.renderers.react(markdoc.content, React, {
        components: (name) => {
          return componentLibrary[name]
        },
      })
    

    Where component library has a component like:

    export const componentLibrary = {
      ...
      Fence: Fence,
      ...
    

    Can result an AST representation like:

    {
      "$$mdtype": "Node",
      "errors": [], 
      "lines": [
        21, 
        35  
      ],  
      "inline": false,
      "attributes": {
        "content": "int main() {...}\n",
        "language": "cpp"
      },  
      "children": [
        {   
          "$$mdtype": "Node",
          "errors": [], 
          "lines": [default
            21, 
            35  
          ],  
          "inline": true,
          "attributes": {
            "content": "int main() {...}\n"
          },
          "children": [], 
          "type": "text",
          "annotations": [], 
          "location": {
            "file": "4 - Connect/2 - Clients & Tools/3 - Client - C++.md",
            "start": {
              "line": 21
            },  
            "end": {
              "line": 35
            }   
          }   
        }   
      ],  
      "type": "fence",
      "annotations": [], 
      "location": {
        "file": "4 - Connect/2 - Clients & Tools/3 - Client - C++.md",
        "start": {
          "line": 21
        },  
        "end": {
          "line": 35
        }   
      }
    }
    

    And an output node of

    {
      "$$mdtype": "Tag",
      "attributes": {
        "language": "cpp"
      },  
      "children": [
        "int main() {...}\n"
      ]
    }
    

    This results in an error in an error:

    Error occurred prerendering page "/docs/connect-cpp". Read more: https://nextjs.org/docs/messages/prerender-error
    Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    

    I have traced this down to https://github.com/markdoc/markdoc/blob/main/src/renderers/react/react.ts#L53

    Where the name property is undefined, which results in us being unable to resolve to the proper component.

    I have been unable to see where this happens.

    If I take the default transform function for fence node and add it to my fence defintion, this fixes the error (but breaks the rendering of my component)

    To reproduce

    I don't have a minimal reproduce yet....

    Version

    0.2.1

    Additional context

    This is using a custom integration, but it is a pretty straight forward in it's usage of transforms and react

    bug 
    opened by addisonj 1
  • Prevent wrapping of nodes in HTML paragraphs

    Prevent wrapping of nodes in HTML paragraphs

    I've been trying out markdoc and I noticed that when I write an image node, it will get wrapped in a <p>, which can be a bit problematic when trying to customise it.

    Is there any way to disable this automatic wrapping of certain nodes? I can't immediately find anything about this in the documentation.

    One workaround seems to be to use tags instead, but I would like to avoid this as much as possible as I want to write regular markdown as much as possible. Especially for the basic stuff like images and headers I don't want to have to create a custom tag.

    opened by DanielBalog86 0
  • Invalid DOM property `colspan`. Did you mean `colSpan`

    Invalid DOM property `colspan`. Did you mean `colSpan`

    What happened?

    When using {% colspan=2 %} or {% rowspan=2 %} this warning or equivalent is logged serverside.

    To reproduce

    {% table %}
    
    - 1
    - 2
    - 3
    
    ---
    
    - 1
    - 2 & 3 {% colspan=2 %}
    
    ---
    
    - 1
    - 2 & 3 {% colspan=2 %}
    
    {% /table %}
    

    Version

    0.2.1

    Additional context

    @markdoc/next.js

    bug 
    opened by lemcii 1
  • Typescript build error in utils.ts

    Typescript build error in utils.ts

    What happened?

    After adding markdoc to my typescript project, running yarn run build gives me this error:

    ./node_modules/@markdoc/markdoc/src/utils.ts:134:3
    Type error: Type '({ type: string; start: number; end: number; content: string; } | { type: string; tag: string; attrs: [string, string][] | null; map: [number, number] | null; nesting: 0 | 1 | -1; level: number; ... 9 more ...; end: number; } | { ...; })[]' is not assignable to type 'Token[]'.
      Type '{ type: string; start: number; end: number; content: string; } | { type: string; tag: string; attrs: [string, string][] | null; map: [number, number] | null; nesting: 0 | 1 | -1; level: number; ... 9 more ...; end: number; } | { ...; }' is not assignable to type 'Token'.
        Type '{ type: string; start: number; end: number; content: string; }' is missing the following properties from type 'Token': tag, attrs, map, nesting, and 12 more.
    
      132 |   });
      133 |
    > 134 |   return output;
          |   ^
      135 | }
      136 |
    

    To reproduce

    1. Add markdoc to a new next.js project using Typescript
    2. run yarn run build

    Version

    No response

    Additional context

    No response

    bug 
    opened by zhangela 4
  • Generate typedoc docs for @markdoc/markdoc and serve them at markdoc.dev/types

    Generate typedoc docs for @markdoc/markdoc and serve them at markdoc.dev/types

    • [ ] Run typedoc index.ts --includeVersion --readme none --excludePrivate --excludeExternals --excludeInternal --sort source-order --out types against latest ./node_modules/@markdoc/markdoc/index.ts
    • [ ] Add Next.js write from /types -> /types/index.html
    docs help wanted 
    opened by mfix-stripe 1
  • Next.js build time schema validation

    Next.js build time schema validation

    Run Markdoc.validate at build time: https://markdoc.dev/docs/validation

    • [ ] Ensure it works with https://github.com/markdoc/markdoc/issues/250
    • [ ] Support validation without needing __webpack_require__ hacks
    enhancement next.js 
    opened by mfix-stripe 0
Releases(0.2.1)
  • 0.2.1(Nov 2, 2022)

    What's Changed

    • Fix Tag.isTag by @mfix-stripe in https://github.com/markdoc/markdoc/pull/285

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.2.0...0.2.1

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 31, 2022)

    What's Changed

    • Rename __EXPERIMENTAL_FORMAT__ as format to make it public by @mfix-stripe in https://github.com/markdoc/markdoc/pull/284
    • Updates RenderableTreeNode type by @rpaul-stripe in https://github.com/markdoc/markdoc/pull/251, https://github.com/markdoc/markdoc/pull/249
    • Forward React.forwardRef react nodes by @mfix-stripe in https://github.com/markdoc/markdoc/pull/263
    • Fix up dependencies to use optional and peer correctly by @mfix-stripe in https://github.com/markdoc/markdoc/pull/281

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.13...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.13(Oct 13, 2022)

    What's Changed

    • Dont wrap tags within inline parents by @mfix-stripe in https://github.com/markdoc/markdoc/pull/230
    • Fix formatter bug w/ fences by @mfix-stripe in https://github.com/markdoc/markdoc/pull/228
    • Fix bug in fence parsing by @mfix-stripe in https://github.com/markdoc/markdoc/pull/234
    • Fix direct inline children within lists by @mfix-stripe in https://github.com/markdoc/markdoc/pull/233
    • Simplify td/th formatting implementation by @mfix-stripe in https://github.com/markdoc/markdoc/pull/236
    • Validation improvements by @rpaul-stripe in https://github.com/markdoc/markdoc/pull/237
    • Render numbers in html renderer by @mfix-stripe in https://github.com/markdoc/markdoc/pull/244

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.12...0.1.13

    Source code(tar.gz)
    Source code(zip)
  • 0.1.12(Sep 29, 2022)

    What's Changed

    • Format titles for images and links by @mfix-stripe in https://github.com/markdoc/markdoc/pull/222
    • Update tests to test links too by @mfix-stripe in https://github.com/markdoc/markdoc/pull/225
    • Format indented code blocks correctly by @mfix-stripe in https://github.com/markdoc/markdoc/pull/224
    • Format list item annotations correctly by @mfix-stripe in https://github.com/markdoc/markdoc/pull/223

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.11...0.1.12

    Source code(tar.gz)
    Source code(zip)
  • 0.1.11(Sep 26, 2022)

    What's Changed

    • Wrap json object keys with "" if non-identifier by @mfix-stripe in https://github.com/markdoc/markdoc/pull/215
    • Remove console.error from formatter by @mfix-stripe in https://github.com/markdoc/markdoc/pull/217
    • Format comments by @mfix-stripe in https://github.com/markdoc/markdoc/pull/216

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.10...0.1.11

    Source code(tar.gz)
    Source code(zip)
  • 0.1.10(Sep 22, 2022)

    What's Changed

    • Fix formatter bugs by @mfix-stripe in https://github.com/markdoc/markdoc/pull/213

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.9...0.1.10

    Source code(tar.gz)
    Source code(zip)
  • 0.1.9(Sep 21, 2022)

    What's Changed

    • Fix trimStart is undefined bug by @mfix-stripe in https://github.com/markdoc/markdoc/pull/208
    • Fix conflicting React types by @mfix-stripe in https://github.com/markdoc/markdoc/pull/209
    • Fix formatting for tags within fences by @mfix-stripe in https://github.com/markdoc/markdoc/pull/210

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.8...0.1.9

    Source code(tar.gz)
    Source code(zip)
  • 0.1.8(Sep 20, 2022)

    What's Changed

    • Update @types deps by @mfix-stripe in https://github.com/markdoc/markdoc/pull/197
    • [Experimental] async validation support by @mfix-stripe in https://github.com/markdoc/markdoc/pull/177
    • Try using export declare type for Variable by @mfix-stripe in https://github.com/markdoc/markdoc/pull/201
    • Adds comment syntax to Markdoc by @rpaul-stripe in https://github.com/markdoc/markdoc/pull/198

    New Contributors

    • @rpaul-stripe made their first contribution in https://github.com/markdoc/markdoc/pull/198

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.7...0.1.8

    Source code(tar.gz)
    Source code(zip)
  • 0.1.7(Aug 30, 2022)

    What's Changed

    • Add test for auto-closing tags by @mfix-stripe in https://github.com/markdoc/markdoc/pull/174
    • Improve formatter tests by @mfix-stripe in https://github.com/markdoc/markdoc/pull/178
    • Improve error message for invalid attribute and add test by @matv-stripe in https://github.com/markdoc/markdoc/pull/182
    • 2 bug fixes in formatter by @mfix-stripe in https://github.com/markdoc/markdoc/pull/189

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.6...0.1.7

    Source code(tar.gz)
    Source code(zip)
  • 0.1.6(Aug 16, 2022)

    What's Changed

    • Fix TODO in formatter by @mfix-stripe in https://github.com/markdoc/markdoc/pull/168
    • Make Tag a generic class by @mfix-stripe in https://github.com/markdoc/markdoc/pull/170
    • Test for format(null) by @mfix-stripe in https://github.com/markdoc/markdoc/pull/172

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.5...0.1.6

    Source code(tar.gz)
    Source code(zip)
  • 0.1.5(Aug 12, 2022)

    What's Changed

    • [RFC] Add node, tag, and error to NodeType by @mfix-stripe in https://github.com/markdoc/markdoc/pull/120
    • Add validation for functions existing by @mfix-stripe in https://github.com/markdoc/markdoc/pull/134
    • [Unstable] [Experimental] formatter by @mfix-stripe in https://github.com/markdoc/markdoc/pull/163

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.4...0.1.5

    Source code(tar.gz)
    Source code(zip)
  • 0.1.4(Jul 15, 2022)

    What's Changed

    • Refactor transformer types by @mfix-stripe in https://github.com/markdoc/markdoc/pull/91
    • Disable indented code_block by @mfix-stripe in https://github.com/markdoc/markdoc/pull/105
    • Make default export a Markdoc class component by @mfix-stripe in https://github.com/markdoc/markdoc/pull/104
    • [Experimental] Async transform support by @mfix-stripe in https://github.com/markdoc/markdoc/pull/109
    • Store annotations as [] in AST by @mfix-stripe in https://github.com/markdoc/markdoc/pull/117
    • Add Partial file attribute validation by @mfix-stripe in https://github.com/markdoc/markdoc/pull/124

    New Contributors

    • @MarcusSorealheis made their first contribution in https://github.com/markdoc/markdoc/pull/100

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.3...0.1.4

    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Jun 16, 2022)

    What's Changed

    • Fix delimiters bug by @mfix-stripe in https://github.com/markdoc/markdoc/pull/48
    • Fix link attribute by @nvanexan in https://github.com/markdoc/markdoc/pull/38
    • Add support for table alignment by @thcyron in https://github.com/markdoc/markdoc/pull/49
    • Patch parseTags to avoid crashing on unopened tag by @matv-stripe in https://github.com/markdoc/markdoc/pull/94
    • Add link title attribute to parser by @fzn0x in https://github.com/markdoc/markdoc/pull/32
    • Add support for image titles by @nvanexan in https://github.com/markdoc/markdoc/pull/45

    New Contributors

    • @xiaoyang-sde made their first contribution in https://github.com/markdoc/markdoc/pull/18
    • @fzn0x made their first contribution in https://github.com/markdoc/markdoc/pull/30
    • @nvanexan made their first contribution in https://github.com/markdoc/markdoc/pull/38
    • @thcyron made their first contribution in https://github.com/markdoc/markdoc/pull/49
    • @matv-stripe made their first contribution in https://github.com/markdoc/markdoc/pull/94

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.2...0.1.3

    Source code(tar.gz)
    Source code(zip)
  • 0.1.2(May 12, 2022)

    What's Changed

    • Expose truthy by @mfix-stripe in https://github.com/markdoc/markdoc/pull/7
    • Update TypeScript types for function by @mfix-stripe in https://github.com/markdoc/markdoc/pull/12
    • Match Development Instructions (README.mdCONTRIBUTING.md) by @TechSolomon in https://github.com/markdoc/markdoc/pull/17

    Full Changelog: https://github.com/markdoc/markdoc/compare/0.1.1...0.1.2

    Source code(tar.gz)
    Source code(zip)
Owner
Markdoc
The Markdoc toolchain
Markdoc
Minecraft modpack that port Create: Above and Beyond to Fabric Toolchain.

English Cabricality Create: Above and Beyond but for Fabric 1.18.2 using Create 0.5. Cabricality aims to port the CAB experience to Fabric, but not 1:

DM Earth 43 Dec 23, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Markdoc plugin for Next.js

@markdoc/next.js Note: this plugin will be treated as a beta version until v1.0.0 is released. Using the @markdoc/next.js plugin allows you to create

Markdoc 105 Nov 30, 2022
Starter repo for quickly deploying a Markdoc app with Next.js

Full Next.js example This is a full-featured boilerplate for a creating a documentation website using Markdoc and Next.js. Setup First, clone this rep

Markdoc 46 Dec 16, 2022
Starter repo for quickly deploying a Markdoc app with Next.js

Full Next.js example This is a full-featured boilerplate for a creating a documentation website using Markdoc and Next.js. Setup First, clone this rep

Markdoc 9 May 29, 2022
Kuldeep 2 Jun 21, 2022
This repo has demos, content and documentation of javascript concepts and syntax, in their simplest form. Contribute by sharing your understanding of javascript! Hacktoberfest Accepted!

javascript-documentation open-source hacktoberfest2022 Submit your PR to this javascript-documentation repo ?? ?? ❗ This repo has some of my javascrip

Austin Lynch 7 Nov 2, 2022
... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.

Salesforce B2C Commerce / Customer 360 Platform Integration Introduction Salesforce B2C Commerce / CRM Sync is an enablement solution designed by Sale

Salesforce CommerceCloud 45 Dec 9, 2022
A framework for building collaborative Microsoft Teams and M365 experiences.

Live Share SDK The Live Share SDK is in preview. You will need to be part of the Developer Preview Program for Microsoft Teams to use this feature. Th

Microsoft 65 Jan 1, 2023
The front-end CSS framework for building experiences for Office and Microsoft 365.

Office UI Fabric Core The front-end framework for building experiences for Office and Office 365. Fabric is a responsive, mobile-first collection of s

Office Developer 3.7k Dec 20, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

?? Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Frontend Masters 167 Dec 9, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.

?? Remix Fundamentals Build Better websites with Remix Remix enables you to build fantastic user experiences for the web and feel happy with the code

Frontend Masters 204 Dec 25, 2022
Demo for my talk "Stream Away the Wait" – a talk about making excellent pending experiences.

?? Stream Away the Wait When implementing the design of a user interface, we often finish before remembering that not everyone's running the app's ser

Kent C. Dodds 25 Nov 1, 2022
Easy, lightweight multi-step experiences.

Steppp Steppp is a small library for quickly creating multi-step forms, carousels, and other experiences. It emphasizes a flexible developer experienc

Ramsey Solutions 22 Dec 7, 2022
A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

Ink codebase browser, "Kin" ?? The Ink codebase browser is a tool to explore open-source code on GitHub, especially my side projects written in the In

Linus Lee 20 Oct 30, 2022
Render (GitHub Flavoured with syntax highlighting) Markdown, and generate CSS for each of GitHub’s themes.

render-gfm Render (GitHub Flavoured with syntax highlighting) Markdown, and generate CSS for each of GitHub’s themes. GitHub Repository npm Package Do

Shaun Bharat 12 Oct 10, 2022
MySQL meets Jupyter notebooks. Grasp provides a new way to learn and write SQL, by providing a coding-notebook style with runnable blocks, markdown documentation, and shareable notebooks. ✨

A New Way to Write & Learn SQL Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Prerequisites Installation

Lakshya 7 Sep 1, 2022