Giter Club home page Giter Club logo

Comments (15)

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

I've seen some doc tools that copy over the source code to the documentation, while others like TypeDoc don't do this. I'm personally not a big fan of this as it seems to me some kind of illogical to ship the source code with the documentation, but I'm pretty sure there are more guys who think like you.

I would like to focus on the new template and your other issues before starting on this one, so please give me some time before investigating this one.

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

As long as I know github (maybe other hubs do as well) supports highlighting part of the file. typedoc could generate automatic link to github published repository. In that case no copying is necessary. Of course this feature should be optional.

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Clever. I like this idea!

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

I've added support for automatic GitHub discovery with this commit. If TypeDoc detects a GitHub repository, the file names in the documentation are linked to the related GitHub pages.

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

It somehow doesn't work for me. I guess your pattern for matching urls is not valid in my case.

$ git ls-remote --get-url
https://github.com/Evgenus/bigint-typescript-definitions

I'm hosting it at http://evgenus.github.io/bigint-typescript-definitions/

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Hmpf, I actually tested it against your repository but I did not take HTTP urls into concern. I've changed the regular expression for detecting GitHup repositories to this one:

/github\.com[:\/]([^\/]+)\/(.*?)\.git/

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Why is your url not ending on .git?

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

I don't know. Somehow it works that way too. I'm using SourceTree to manage my repositories.
Try https://www.debuggex.com/ it helps me a lot with regexes.

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Okay, haven't been aware of this either. But I think we can just hardcode this one...

url = /github\.com[:\/]([^\/]+)\/(.*)/.exec(remotes[i]);
if (url) {
  this.gitHubProject = url[2];
  if (this.gitHubProject.substr(-4) == '.git') {
    this.gitHubProject = this.gitHubProject.substr(0, this.gitHubProject.length - 4);
  }
}

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

now it works. thanks

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Cool! I really like this new feature, I've already used it on TypeDoc and it is a great improvement. Thank you very much for this idea!

By the way, did you try --theme minimal?

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

Minimal theme is even better for single module projects (and for definitions as well), because it leads directly into documentation. I will use it from now on. Default theme have a bit confusing main page.

I guess you can close this issue.

from typedoc.

Evgenus avatar Evgenus commented on May 22, 2024

About github url. I've recently mentioned that a lot of people taking this as a problem. Check out this list https://www.npmjs.org/search?q=github%20url .

from typedoc.

sebastian-lenz avatar sebastian-lenz commented on May 22, 2024

Interesting, thanks for sharing this. I've looked over the first modules but they don't seem to do what we need. Anyway, as the current solutions seems to work lets stick to that one. If any other problems arise, I'll check back on those modules.

As you suggested, I'll close this issue. The feature will be available with the next release.

from typedoc.

Spiralis avatar Spiralis commented on May 22, 2024

Is there a way to force the documentation links to use i.e. master instead of the commit-id? The thing is that this means that for every github commit-change I have to include the docs in the commit too, even if all the docs are otherwise identical.

For example, this link: https://github.com/IntelliSearch/search-client/blob/f912698/src/AllCategories/AllCategories.ts#L19
depends on that commit to have been executed. Now, if I was hosting live docs for every version, then that would be fine. But, I am only hosting live docs for the latest version. Meaning that if the link instead was to master (which is my, and probably others' main branch too), then it would work and regenerating docs for newer commits could have the same results.

Actually, right now, the above blob/f912698/ link doesn't work as I dropped updating the source, since there were no changes. I since then realised that doing so meant that the links will not work.

But, this link using master works fine: https://github.com/IntelliSearch/search-client/blob/master/src/AllCategories/AllCategories.ts#L19

So, all I am asking is if there is a way to tell the typedoc generator to use the branch name instead of the commit when generating the paths?

from typedoc.

Related Issues (20)

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.