Skip to content

[api-documenter] Add a setting to remove the "do not edit" comment from the generated markdown #5176

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

Open
niming175 opened this issue Apr 2, 2025 · 2 comments
Labels
enhancement The issue is asking for a new feature or design change

Comments

@niming175
Copy link

Summary

在生产的md文档中,在每个文件的顶部都会有这么一句:

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

这个在使用docusaurus部署我的文档会有影响。
所以,我想去掉这个注释,我该如何做?

In the generated Markdown (.md) documents, there is a line at the top of each file:

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

This causes issues when deploying my documentation using Docusaurus.
So, I want to remove this comment. How can I do that?

Repro steps

Expected result:

Actual result:

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-documenter version? 7.26.3
Operating system? Linux
Documentation target? Markdown
Would you consider contributing a PR? No
TypeScript compiler version? 5.7.2
Node.js version (node -v)? 20.14.0
@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Apr 2, 2025
@octogonz octogonz changed the title [api-documenter] 如何去掉生成md文档后在文件顶部的注释 How to remove the comment at the top of the generated Markdown files? [api-documenter] Add a setting to remove the "do not edit" comment from the generated markdown Apr 2, 2025
@octogonz octogonz added the enhancement The issue is asking for a new feature or design change label Apr 2, 2025
@octogonz
Copy link
Collaborator

octogonz commented Apr 2, 2025

This is a good suggestion.

However, for Docusaurus specifically, the <!-- --> tag should not be a problem. Here is an example from our own docs which use Docusaurus:

websites/api.rushstack.io/docs/pages/api-documenter.iapidocumenterpluginmanifest.features.md

---
hide_title: true
custom_edit_url: null
pagination_prev: null
pagination_next: null
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@microsoft/api-documenter](./api-documenter.md) &gt; [IApiDocumenterPluginManifest](./api-documenter.iapidocumenterpluginmanifest.md) &gt; [features](./api-documenter.iapidocumenterpluginmanifest.features.md)

## IApiDocumenterPluginManifest.features property

The list of features provided by this plugin.

**Signature:**

```typescript
features: IFeatureDefinition[];
```

The purpose of the comment is to prevent people from accidentally modifying these machine-generated files.

@octogonz
Copy link
Collaborator

octogonz commented Apr 2, 2025

Here's a design proposal: #5178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is asking for a new feature or design change
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants