-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[RFC, DO NOT MERGE] Spec for generating machine-parseable .md files for AI agents #31181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jhgilbert
wants to merge
13
commits into
master
Choose a base branch
from
jen.gilbert/md-conversion-test-content
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
366af9c
Write .md generation spec
jhgilbert 707c0af
Use tags instead of start/stop strings to support OOTB machine parsea…
jhgilbert 5d128ec
Update plain_markdown.md
jhgilbert 5f72d63
Use a heading to introduce further reading, for machine parseability
jhgilbert e03dcd7
Use an alert tag for site-region, for machine parseability
jhgilbert fb0b6ad
Use a tag for the region param shortcode in copy, for machine parseab…
jhgilbert 7c98203
Add examples of underscore bolding/italicizing
jhgilbert 0c9f878
Delete README, so context isn't being updated in two places
jhgilbert 98af04a
Fix typo
jhgilbert 87a34ca
Merge branch 'master' into jen.gilbert/md-conversion-test-content
jhgilbert d3089d6
Use backticks for kbd contents instead of bold
jhgilbert cddc29e
Wrap any raw table HTML in a raw_html tag
jhgilbert 0bd2aeb
Output plain Markdown tables instead of structured data when handling…
jhgilbert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
content/en/md_conversion_test_files/common_components/alert.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Alert | ||
--- | ||
|
||
## Expected .md output | ||
|
||
Each alert is enclosed in `{% alert %}` and `{% /alert %}` tags, with a `level` attribute. | ||
jhgilbert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Info | ||
|
||
<div class="alert alert-info">This is an info alert.</div> | ||
|
||
This is a random sentence. | ||
|
||
### Warning | ||
|
||
<div class="alert alert-warning">This is a warning alert containing an <a href="https://google.com">HTML link.</a></div> | ||
|
||
This is a random sentence. | ||
|
||
### Danger | ||
|
||
<div class="alert alert-danger">This is a danger alert.</div> | ||
|
||
This is a random sentence. |
24 changes: 24 additions & 0 deletions
24
content/en/md_conversion_test_files/common_components/callouts.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Callouts | ||
--- | ||
|
||
## Expected .md output | ||
|
||
- Each callout is enclosed in `{% callout %}` and `{% /callout %}` tags. | ||
- Any attributes, such as the title or the URL, are also included in the box contents: | ||
- The title is a heading at the top of the box. | ||
- The URL is included with verbiage at the bottom like "Visit this URL: <URL>". | ||
|
||
## Example inputs | ||
|
||
### Callout (preview / beta) | ||
|
||
{{< callout url="https://www.datadoghq.com/">}} | ||
jhgilbert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Datadog Apps are in Preview. Request access by using this form. Once approved, you can start getting creative and develop your App for you, your organization, or for publishing to the entire Datadog community alongside our other great Datadog Apps! | ||
{{< /callout >}} | ||
|
||
### Learning center callout | ||
|
||
{{< learning-center-callout header="Try Foundations in the Learning Center" btn_title="Enroll Now" btn_url="https://learn.datadoghq.com/courses/datadog-foundation">}} | ||
The Datadog Learning Center is full of hands-on courses to help you learn about this topic. Enroll today to learn more about Datadog Foundations. | ||
{{< /learning-center-callout >}} |
60 changes: 60 additions & 0 deletions
60
content/en/md_conversion_test_files/common_components/code_blocks.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: Code Blocks | ||
--- | ||
|
||
## Scope | ||
|
||
This covers the `code-block` and `highlight` shortcodes. Plain fences are already covered in the "plain markdown" examples. | ||
|
||
## Expected .md output | ||
|
||
Each code block is wrapped in a fence, with the language included when available: | ||
|
||
```lang | ||
jhgilbert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Code contents here. | ||
``` | ||
|
||
### Filenames | ||
|
||
When a filename is present, it appears above the code block, like this: | ||
|
||
In the `block.java` file: | ||
|
||
```lang | ||
Code contents here. | ||
``` | ||
|
||
### Highlighted lines | ||
|
||
When a highlight is present, it appears above the code block, like this: | ||
|
||
See lines 2-3 below: | ||
|
||
```lang | ||
Code contents here. | ||
``` | ||
|
||
## Example inputs | ||
|
||
### Code block | ||
|
||
{{< code-block lang="java" filename="block.java" disable_copy="true" collapsible="true" >}} | ||
import com.datadoge.docs.SweetCodeBlock; | ||
import com.datadoge.docs.TryItOut; | ||
public class CodeBlocksForLife { | ||
... | ||
} | ||
{{< /code-block >}} | ||
|
||
### Highlighted code block | ||
|
||
{{< highlight yaml "hl_lines=6-8" >}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: springfront | ||
labels: | ||
tags.datadoghq.com/env: "dev" | ||
tags.datadoghq.com/service: "springfront" | ||
tags.datadoghq.com/version: "12" | ||
{{< /highlight >}} |
30 changes: 30 additions & 0 deletions
30
content/en/md_conversion_test_files/common_components/collapsible_sections.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Collapsible Sections | ||
--- | ||
|
||
## Expected .md output | ||
|
||
- Each section is enclosed in `{% collapsible-section %}` and `{% /collapsible-section %}` tags. Any attributes, like `title`, are included in the tag. | ||
|
||
## Example inputs | ||
|
||
### Details | ||
|
||
This content is outside the `details` tag. | ||
|
||
<details> | ||
<summary>Details</summary> | ||
This content would be hidden inside the details panel. | ||
</details> | ||
|
||
This content is outside the `details` tag. | ||
|
||
### Collapse content | ||
|
||
This content is outside the `content-collapse` block. | ||
|
||
{{% collapse-content title="Datadog Operator" level="h4" expanded=false id="id-for-anchoring" %}} | ||
This content is inside the `content-collapse` block. | ||
{{% /collapse-content %}} | ||
|
||
This content is outside the `content-collapse` block. |
20 changes: 20 additions & 0 deletions
20
content/en/md_conversion_test_files/common_components/further_reading.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Further Reading | ||
further_reading: | ||
- link: "logs/processing/pipelines" | ||
tag: "Documentation" | ||
text: "Log processing pipelines" | ||
- link: "some/blog/post" | ||
tag: "Blog" | ||
text: "Some blog post" | ||
--- | ||
|
||
## Expected .md output | ||
|
||
A list of links, introduced by the "Further Reading" heading. | ||
|
||
## Example input | ||
|
||
## Further reading | ||
|
||
{{< partial name="whats-next/whats-next.html" >}} |
17 changes: 17 additions & 0 deletions
17
content/en/md_conversion_test_files/common_components/images_and_videos.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Images and Videos | ||
--- | ||
|
||
## Expected .md output | ||
|
||
An easily readable tag is used for each one, such as `{% image src="path/to/image" %}`, with any available attributes. | ||
|
||
## Example inputs | ||
|
||
## Image | ||
|
||
{{< img src="path/to/your/image-name-here.png" alt="Your image description" caption="Your image description" style="width:100%;" >}} | ||
|
||
## Video | ||
|
||
{{< img src="path/to/your/video-name-here.mp4" alt="Your image description" video="true" width="100%" >}} |
79 changes: 79 additions & 0 deletions
79
content/en/md_conversion_test_files/common_components/plain_markdown.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: Plain Markdown Elements | ||
--- | ||
|
||
## Expected .md output | ||
|
||
- Most of this remains unchanged, or uses a format that does not meaningfully differ from the original. | ||
- Some spacing changes can be difficult to avoid. | ||
- OOTB Markdoc does not support description lists, but a similar structure can be used. (Longer term, Markdoc can be patched to support it, as we've already done with Cdocs, but it introduces complexity that we probably don't want to deal with at this stage.) | ||
- In some cases, content may be slightly optimized for agents (for example, links will become inline). | ||
|
||
## Headings | ||
|
||
### Heading level 3 | ||
|
||
Some text. | ||
|
||
#### Heading level 4 {#heading-level-4} | ||
|
||
Some text, with a custom heading ID. | ||
|
||
##### Heading level 5 | ||
|
||
Some text. | ||
|
||
###### Heading level 6 | ||
|
||
Some text. | ||
|
||
## Inline text formatting | ||
|
||
You can *italicize* text, or **bold** it. You can also use underscores to _italicize_ or __bold__ it. | ||
|
||
Text can also be formatted as a [plain link][1], **[bold link][1]**, or *[italic link][1]*. | ||
|
||
## Lists | ||
|
||
### Ordered | ||
|
||
Here's an ordered list of steps: | ||
|
||
1. Figure out how to migrate to [Astro][2]. | ||
2. Make some *incredible docs*. | ||
3. **Profit.** | ||
|
||
### Unordered | ||
|
||
Here's an unordered version of the same list, which doesn't make as much sense, but that's okay. | ||
|
||
- Figure out how to migrate to [Astro][2]. | ||
- Make some *incredible docs*. | ||
- **Profit.** | ||
|
||
## Code | ||
|
||
### Inline code | ||
|
||
Here's some `inline code`. | ||
|
||
### Code fence | ||
|
||
```javascript | ||
console.log("Hello, world!"); | ||
``` | ||
|
||
## Description list | ||
|
||
Service | ||
: Services are the building blocks of modern microservice architectures - broadly a service groups together endpoints, queries, or jobs for the purposes of building your application. | ||
|
||
Resource | ||
: Resources represent a particular domain of a customer application - they are typically an instrumented web endpoint, database query, or background job. | ||
|
||
`clusterChecksRunner.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution` | ||
: Required. A list of node selector terms. The terms are ORed. | ||
|
||
|
||
[1]: https://www.google.com | ||
[2]: https://astro.build/ |
36 changes: 36 additions & 0 deletions
36
content/en/md_conversion_test_files/common_components/programming_lang_wrapper.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: Programming lang wrapper | ||
--- | ||
|
||
## Expected .md output | ||
|
||
These are treated as tabs (see `tabs.md`). | ||
|
||
## Example input | ||
|
||
{{< programming-lang-wrapper langs="python,ruby,PHP" >}} | ||
|
||
{{< programming-lang lang="python" >}} | ||
Info about how to do this with Python. | ||
```python | ||
from datadog import initialize, statsd | ||
``` | ||
{{< /programming-lang >}} | ||
|
||
{{< programming-lang lang="ruby" >}} | ||
Info about how to do this with Ruby. | ||
```ruby | ||
require 'datadog/statsd' | ||
``` | ||
{{< /programming-lang >}} | ||
|
||
{{< programming-lang lang="PHP" >}} | ||
Info about how to do this with PHP. | ||
```php | ||
<?php | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
``` | ||
{{< /programming-lang >}} | ||
|
||
{{< /programming-lang-wrapper >}} |
37 changes: 37 additions & 0 deletions
37
content/en/md_conversion_test_files/common_components/region_shortcodes.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: Region Shortcodes | ||
--- | ||
|
||
## Site region shortcode | ||
|
||
### Expected .md output | ||
|
||
- The contents are enclosed in a `{% alert level="info" %}` tag. | ||
- The alert contents include a heading or similar content establishing the context of the alert (e.g., "Alert for users on `ap1.datadoghq.com`"). | ||
|
||
### Example input | ||
|
||
{{< site-region region="us,ap1" >}} | ||
This paragraph only appears if the user has selected US or AP1 from the Site Selector dropdown. | ||
{{< /site-region >}} | ||
|
||
## Region parameter shortcode | ||
|
||
### Expected .md output | ||
|
||
A placeholder: | ||
|
||
- `<YOUR_DATADOG_SITE>` in code. | ||
- `{% user-datadog-site /%}` in copy. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is tricky, we could also just say "your Datadog site" in plain text. But I wasn't sure if that would cause odd results sometimes in the content. |
||
|
||
### Example inputs | ||
|
||
#### In code | ||
|
||
```shell | ||
export DD_SITE={{< region-param key=dd_site code="true" >}} | ||
``` | ||
|
||
#### In copy | ||
|
||
Your Datadog site is {{< region-param key=dd_site >}}. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.