Code Monkey home page Code Monkey logo

Comments (9)

krisztianb avatar krisztianb commented on August 16, 2024

Hi. 👋

Currently the plugin supports replacing text in:

  • code comments
  • included Markdown files

It doesn't support replacing things that are directly taken from the source code.

May I ask what your use case is? Why are you not naming the variable the way to want it to be named in the documentation?

from typedoc-plugin-replace-text.

Kartanovicius avatar Kartanovicius commented on August 16, 2024

Hi,

We are using the same file in multiple places in our application, and we have been naming them this way because they are constants. Of course, we can rename them in the application or create some mapping from one name to another, but the easiest and most logical approach would be to only rename them in the documentation.

Kind regards,

from typedoc-plugin-replace-text.

krisztianb avatar krisztianb commented on August 16, 2024

Unfortunately I don't understand what you are doing. 😄 Why do you want the constants to be named differently than their real name? Doesn't that undermine the purpose of the documentation to reflect the code?

from typedoc-plugin-replace-text.

machaj avatar machaj commented on August 16, 2024

Hello,
I think that our use case is not very common probably.
In the example which @Kartanovicius mentioned, we have defined a constant with a value. The value is a name of function which can be used in code snippet. Usually something like:

export const crmAccountContextSet = async ({ payload, api: { notify }}) => {
  await notify.success('Triggered crmAccountContextSet');
  // another code
}

These snippets are written by other developers and they are not a part of our codebase. They use a documentation which is generated from our code, but for them is more relevant the value of the constant then the name.

For us is more relevant the name of the constant, but the generated documentation itself not.

So there are two groups of people with different needs, that is the reason why we are looking for something which will modify the generated documentation.

I hope that the use case makes more sense now :-)

from typedoc-plugin-replace-text.

krisztianb avatar krisztianb commented on August 16, 2024

That makes it clearer somewhat but I still don't see why this makes sense. In the documentation you have both the name of the constant and its value. If you rename the constant than all references to it must be renamed also or not? Then the documentation doesn't reflect the code which kind of goes against the point of having a documentation.

from typedoc-plugin-replace-text.

Kartanovicius avatar Kartanovicius commented on August 16, 2024

This documentation is not intended for developers but for those who need to configure our product using JavaScript code. For them we have changed constant name to function like to avoid confusion from their side.

If we decide to rename a constant, we aim to update it across all documentation pages.

Initially we were looking for @alias but it's not existing in TypeDoc and this plugin could do almost the same alias in JSDoc. :3

from typedoc-plugin-replace-text.

krisztianb avatar krisztianb commented on August 16, 2024

But you still want to replace the name everywhere in the documentation, right? So basically you want to rename the variable reflection.

from typedoc-plugin-replace-text.

Kartanovicius avatar Kartanovicius commented on August 16, 2024

Yes, exactly.

from typedoc-plugin-replace-text.

krisztianb avatar krisztianb commented on August 16, 2024

I've given this some thought and have to tell you that I don't see this fit into the intention of this plugin. The requested functionality (renaming reflections) should imho be implemented in a separate plugin. It will most certainly also need additional options/settings (eg. specifying where you want things to get renamed and where not).

from typedoc-plugin-replace-text.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.