Commit 03c8ee95 authored by Matthieu Le Corre's avatar Matthieu Le Corre
Browse files

add markdown-it plugins and fix internal image URL


Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent 8de75b23
## 1.0.4 NOT YET RELEASED
### Fixed
- Fix header and footer collision with searching
[#14](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/14#)
- Fix Header/Footer not always hidden if there is no HEADER/README file
[#16](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/16#)
- Fix README or ".README" md files will not display images
[#15](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/15#)
### Added
- Allow for both `.md` and `.markdown` file extensions
[#17](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/17#)
- Add Markdown-it plugins to handle image size, task list ....
[#13](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/13#)
## 1.0.3 26-04-2019
### Fix
### Fixed
- Fix scroll problem with long file list
[#12](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/12#)
- Fix Mindmap navigation break
[#10](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/10#)
- Fix ui bug when using table and selecting files
[#9](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/9#)
### Changed
- Do not hide HEADER.md anymore when selecting file.
......
......@@ -7,7 +7,7 @@
With this app you can add a header and a footer to your nextcloud directories.
This can be use to explain the goal of a directory, describe the content of a folder ...
It show README.md in the way gitlab does.]]></description>
<version>1.0.3</version>
<version>1.0.4</version>
<licence>agpl</licence>
<author mail="matthieu.lecorre@univ-nantes.fr" homepage="http://www.univ-nantes.fr">Matthieu Le Corre</author>
<namespace>ReadMeMd</namespace>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"name": "files_readmemd",
"version": "1.0.3",
"version": "1.0.4",
"description": "show README.md github style",
"main": "./js/script.js",
"repository": "https://gitlab.univ-nantes.fr/uncloud/files_readmemd.git",
......@@ -13,18 +13,16 @@
},
"dependencies": {
"github-markdown-css": "^3.0.1",
"jslint": "^0.12.1",
"lint": "^1.1.2",
"markdown-it": "^8.4.2",
"markdown-it-anchor": "^5.0.2",
"markdown-it-github-preamble": "^1.0.0",
"markdown-it-highlightjs": "^3.0.0",
"markdown-it-texmath": "^0.5.5"
"markdown-it-imsize": "^2.0.1",
"markdown-it-replace-link": "^1.0.1",
"markdown-it-task-lists": "^2.1.1"
},
"devDependencies": {
"css-loader": "^2.1.1",
"style-loader": "^0.23.1",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0"
"webpack": "^4.30.0",
"webpack-cli": "^3.3.1"
}
}
......@@ -182,21 +182,39 @@ OCA.ReadmeMD.App = {
**/
renderMD: function(zone) {
//render MD
var converter = require('markdown-it')() ;
//var self = this ;
var md = require('markdown-it') ;
var converter = md({
replaceLink: function(link,env){
if ( link.startsWith('http://') || link.startsWith('https://') ) {
return link ;
} else {
return OC.linkToRemoteBase('files') + '/' +link ;
}
}
})
.use(require('markdown-it-task-lists'), {enabled: true} )
.use(require('markdown-it-highlightjs'))
.use(require('markdown-it-replace-link'))
.use(require('markdown-it-imsize'))
zone.container.html(converter.render(zone.content)) ;
$("#filestable > tfoot > tr").height("auto") ;
},
};
OCA.ReadmeMD = OCA.ReadmeMD.App ;
$(document).ready(function () {
// Don't load if not in the files app
if ($('#content.app-files').length) {
if ($('#content.app-files').length) {
var mode = 'private';
} else {
if ($('#content.app-files_sharing').length) {
} else {
if ($('#content.app-files_sharing').length) {
var mode = 'public';
} else {
return ;
......
......@@ -11,7 +11,11 @@ module.exports = {
output: {
path: path.resolve(__dirname, "./js"),
filename: "[name]"
}
},
node: {
fs: 'empty'
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment