davidshimjs / jaguarjs-jsdoc

A Template of jsdoc for jaguar.js project
MIT License
218 stars 136 forks source link

Suppress tag-source element? #28

Open dotherightthing opened 9 years ago

dotherightthing commented 9 years ago

Is there a way to suppress the output of div.tag-source ?

I'm using jaguarjs-jsdoc via grunt-jsdoc, and the tag source is showing the file path all the way down to the root of my OS, eg:

<div class="tag-source">/Volumes/VRMiniBackup/Backups/Web/Bitbucket/ob/wp-content/themes/sitename/resources/dev/scripts/sitename.js, line 2787</div>

This makes the div.tag-source overlap the adjacent documentation at all but the widest viewport widths.

Thanks.

MultiThreadIsBad commented 9 years ago

I got the same problem and I think it is a bug of jaguarjs-jsdoc. Attach my fix for your refer:

jaguarjs-jsdoc/publish.js: exports.publish = function(){...} line 404: sourceFilePaths.push(resolvedSourcePath); change to: if (sourceFilePaths.indexOf(resolvedSourcePath) === -1) { sourceFilePaths.push(resolvedSourcePath); }

chiedo commented 8 years ago

Any update on this?

coolsp commented 8 years ago

I had the same problem when generating documentation for one single file. In publish.js, the array 'sourceFilePaths' is used to collect all source references (path+filename). This array is later used to find and remove the common part. When generating doc for one .js source-file, this path+filename is always the same so the process of removing the path fails (as it includes the filename padded with a path separator). The simple fix I found is to remove the filename from the path+filename before populating 'sourceFilePaths'. Change 'jaguarjs-jsdoc-master/publish.js': sourceFilePaths.push(resolvedSourcePath); To: sourceFilePaths.push(path.dirname(resolvedSourcePath));

Hyddan commented 8 years ago

I had a similar desire. While waiting for an official fix, if you just want to hide the div.tag-source element you could do so with a grunt task:

grunt.registerTask('docsPostProcessing', function () {
    var done = this.async();
    require('fs').appendFile('./[YourDocsDestination]/styles/jaguar.css', '.tag-source { display: none; }', function (err) {
        if (err) {
            grunt.fail.fatal(err);

            return;
        }

        done();
    });
});
grunt.registerTask('docs', ['jsdoc', 'docsPostProcessing']);
jbelien commented 7 years ago

Hi, I have the same issue.

It seems it was fixed in "jsdoc default template" : https://github.com/jsdoc3/jsdoc/issues/590 Could it be fixed here too ?

Thanks !