Skip to content

Commit

Permalink
Merge pull request #156 from SassDoc/backport-fix-found-at
Browse files Browse the repository at this point in the history
Backport, fixed `found-at` with absolute path
  • Loading branch information
pascalduez committed Aug 3, 2014
2 parents c44cf53 + 29dac59 commit dd308ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## 1.1.6

* Backport, fixed `found-at` with absolute path ([#155](https://github.com/SassDoc/sassdoc/pull/155))

## 1.1.5

* Fixed `@example` not being printed for variables ([#146](https://github.com/SassDoc/sassdoc/pull/146))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
{ "name": "Valérian Galliat", "url": "https://twitter.com/valeriangalliat" },
{ "name": "Pascal Duez", "url": "https://twitter.com/pascalduez" }
],
"version": "1.1.5",
"version": "1.1.6",
"license": {
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/file.js
Expand Up @@ -161,7 +161,7 @@ exports = module.exports = {
Object.keys(data).forEach(function (key) {
data[key].forEach(function (item) {
item.file = {
path: utils.getDisplayPath(file, exports.folder.base),
path: path.relative(exports.folder.base, file),
name: path.basename(file, '.scss')
};
});
Expand Down Expand Up @@ -209,7 +209,7 @@ exports = module.exports = {
* @param {String} folder - folder path
*/
getData: function (folder) {
exports.folder.base = path.basename(folder);
exports.folder.base = folder;

return exports.folder.parse(folder).then(function (response) {
response = response || [];
Expand Down
12 changes: 1 addition & 11 deletions src/utils.js
Expand Up @@ -7,22 +7,12 @@ exports = module.exports = {
/**
* Get file extension
* @param {string} filename - filename to retrieve extension from
* @return {string} extension
* @return {string} extension
*/
getExtension: function (filename) {
return path.extname(filename).substr(1);
},

/**
* Get file display path, relative to the project directory
* @param {string} filePath - file path
* @param {string} baseDir - project base directory
* @return {string} display path
*/
getDisplayPath: function (filePath, baseDir) {
return path.join(baseDir, filePath);
},

/**
* Get current date/time
* @return {string} Stringified date time
Expand Down

0 comments on commit dd308ec

Please sign in to comment.