# The path to structured content with Markdown

DevFeed: [The path to structured content with Markdown](<https://devfeed.tech/articles/the-path-to-structured-content-with-markdown-30949.md>)

Original publisher: [Read original article](<https://www.doctave.com/blog/path-to-structured-markdown>)

Author: Niklas Begley

Published: 2024-06-06T07:00:00Z

Content type: tutorial

Language: en

Sources: [Doctave - Build beautiful developer portals with docs-as-code](<https://devfeed.tech/sources/doctave-build-beautiful-developer-portals-with-docs-as-code.md>)

Topics: [Markdown](<https://devfeed.tech/topics/markdown.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>)

Tags: [authoring](<https://devfeed.tech/tags/authoring.md>), [blog](<https://devfeed.tech/tags/blog.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [markdown](<https://devfeed.tech/tags/markdown.md>), [structure](<https://devfeed.tech/tags/structure.md>), [structured](<https://devfeed.tech/tags/structured.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [technical](<https://devfeed.tech/tags/technical.md>), [technical-documentation](<https://devfeed.tech/tags/technical-documentation.md>)

## AI overview

The article argues that Markdown has an underlying structure that is often hidden from authors, making it more similar to XML-based structured authoring than commonly assumed. It demonstrates how Markdown is transformed into an abstract syntax tree and represented as a tree-shaped JSON structure.

## Source excerpt

This post was inspired by the Pros and Cons of Using Markdown for Technical Documentation Panel Discussion with Ed Marsh, Eric Holscher, and Fabrizio Ferri-Benedetti. Around the ~40 minute mark the discussion moves onto how to maintain a consistent style with Markdown documentation, especially in larger teams. The panel agrees that currently there are no clear ways to enforce a specific document structure when using Markdown. Fabrizzio then on goes on to say (54:15): Some day, someone is going to figure out a way to seamlessly grow Markdown into something that can mature into structured content I've been thinking about this a lot, and my claim is that Markdown and XML (which is traditionally used for structured authoring) are more similar than you would initially expect, and that the dream of adding validations and structure to Markdown is perhaps not too far away. The structure behind Markdown There's a commonly held belief that Markdown is not structured. There is some truth to this, but I'd argue it's more the case that the structure is hidden. While with most XML-based authoring tools you are manipulating the structure directly (or through a WYSIWYG editor), with Markdown we are one level removed from the actual underlying structure. To demonstrate, let's take a look at a quick example at how Markdown is actually almost equivalent to XML, if you squint a little. Let's take this Markdown content. 1 2 3 4 5 # Hello, world This is a paragraph **with some bold text** and this is an image When this Markdown is processed into HTML, it goes through a number of transformations. The first thing that happens is that the Markdown is converted into an Abstract Syntax Tree. This means taking the raw text of the Markdown, and converting into something more structured that a program can manipulate. Each Markdown parser does this a little bit differently, but we can see this in action with, for example, the AST Explorer tool. Let's take Markdown above, and paste it