Skip to content
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

Broken link to github source file - missing . #47

Open
myosotisgit opened this issue Mar 14, 2022 · 8 comments
Open

Broken link to github source file - missing . #47

myosotisgit opened this issue Mar 14, 2022 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@myosotisgit
Copy link

I found Doctum while searching for an auto doc generator with Laravel in mind. I installed and and ran it on our existing app code.
It already picked up comments and made a nice static site. So the doc generator seems to work great. So far so good...

But when i try using the links to the github repo file, it wont work because the link is incorrect. It seems to miss the "." in the url.

image

Adding a "." before "php" will solve the issue and redirect to Github properly.

In the doctum config i have added the most common values, as mentioned in the Doctum doc sample
image

Any ideas how to solve the missing . problem ?

@williamdes
Copy link
Member

Hi @myosotisgit
Thank you so much for using Doctum and taking time to report this.
May you run tree app command to print out the tree or just take a screenshot or list of files so I can reproduce this issue ?

Reading the code and your description more than twice I am still puzzled about how there could be a mistake in the file path, so let's find out :)

@williamdes williamdes added the question Further information is requested label Mar 14, 2022
@williamdes williamdes self-assigned this Mar 14, 2022
@myosotisgit
Copy link
Author

@williamdes
Thank for the swift reply!
We were looking for a simple tool to auto generate documentation and noticed that Laravel is/has using/used your package. We tried it out and it works nicely. So thanks!

We, our programmers, are also stumped and dont know what to do with it. We tried it both on a local dev (windows) and on our test server (ubuntu) thinking it would be a windows/unix issues. But on both instances we get incorrect github links.

I did run a 'tree app' but the output is very large. It goes through all of our app and since it is a laravel/vue app it gets big.
Maybe you were looking for only the Doctum app tree? Not sure what to give you

@williamdes
Copy link
Member

Hi @myosotisgit

Would you mind sharing your full config file here in plain text so I can understand how you configured it?

Did you follow the readme example?

@myosotisgit
Copy link
Author

myosotisgit commented Mar 19, 2022

Here you go. Straight from the examples

use Doctum\Doctum;
use Doctum\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;
use Doctum\RemoteRepository\GitHubRemoteRepository;

$dir = 'app';
$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->in($dir);

// generate documentation for all v2.0.* tags, the 2.0 branch, and the main one
/*$version = GitVersionCollection::create($dir)
    // In a non case-sensitive way, tags containing "PR", "RC", "BETA" and "ALPHA" will be filtered out
    // To change this, use: `$versions->setFilter(static function (string $version): bool { // ... });`
    ->add('master', 'master branch');*/

return new Doctum($iterator, [
    'version'             => 'master',
    'title'                => 'Documentatie Test',
    'language'             => 'en', // Could be 'fr'
    'build_dir'            => __DIR__ . '/../public/doctum/%version%',
    'cache_dir'            => __DIR__ . '/../cache/%version%',
    'source_dir'           => dirname($dir) . '/',
    'remote_repository'    => new GitHubRemoteRepository('myosotisgit/webraap5', dirname($dir)),
    'default_opened_level' => 2, // optional, 2 is the default value
]);

PS
The repository is private btw

@williamdes
Copy link
Member

Hi @myosotisgit

I did not manage to reproduce this issue on my side, may you try to change $dir = 'app'; to one particular folder of your app so we can see if with just one folder you can reproduce this issue ?

Sorry for the big delay in my response time

@twouda
Copy link

twouda commented May 20, 2022

Hi @myosotisgit

I did not manage to reproduce this issue on my side, may you try to change $dir = 'app'; to one particular folder of your app so we can see if with just one folder you can reproduce this issue ?

Sorry for the big delay in my response time

Hi @williamdes
I am a @myosotisgit co-worker and had a look at this.

I changed the config to $dir = 'app/Logging'; A folder which contains a single class and generated the documentation files.

The following link was generated in the Doctum files:

{github_link}/blob/master/Logging/{class}.php#L20

This means the .php extension functions properly, but the 'app' folder is missing.
The correct github link would be:

{github_link}/blob/master/app/Logging/{class}.php#L20

I tried playing around with the config, but did not manage to produce an 'app' folder in the Github link.

Are we missing something in the config maybe?

@williamdes
Copy link
Member

Hi @twouda

Are we missing something in the config maybe?

I think there is maybe something specific that needs a full path from the start
You could maybe try to follow this example and let me know: https://github.com/code-lts/doctum/blob/main/tests/phar/data/doctum-absolute.conf.php

@williamdes
Copy link
Member

Do you have some news about this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

3 participants