Support for replacing parts of a readme
Closed this issue · 9 comments
A recent request on the typedoc repo indicated it would be nice to be able to replace parts of the readme, which seemed appropriate for this plugin.
If it replaces in any file the plugin should be renamed accordingly too as it's no longer replacing in just comments.
I'd like to make this optional as some users might not want their replacements applied on other parts of the documentation.
This means that I have to rework how the plugin is configured.
Renaming the plugin makes sense but is not possible on NPM. So it all boils down to deprecating this plugin in favour of another one.
yeah, you can rename git repo, but npm just leave abandoned
What other parts of the documentation would you also replace text in?
Currently the plugin would do this for:
- Code comments
- README.md
I don't currently plan replace other than [[TOC]]
.
Un fact, for my problem, I created a separate readme because typedoc inability to render markdown:
I understand. It was more like a general question. So that I can make the new plugin even more useful.
Sorry, I'm unable to give you any useful feedback. I'm new to typedoc project and neither I know what are the choices, i.e how the plugin system works.
The broad answer would be: replace everywhere everything ;)
New plugin is released: https://www.npmjs.com/package/typedoc-plugin-replace-text
If you only want to remove [[[TOC]]]
from your README and do nothing else. This config should do the job:
"replaceText": {
"inCodeCommentText": false,
"inCodeCommentTags": false,
"inIncludedFiles": true,
"replacements": [
{
"pattern": "\\[\\[\\[TOC\\]\\]\\]",
"replace": ""
}
]
}
super!
btw, it's [[TOC]]
not [[[TOC]]]
.