Commit e9de5f91 authored by Matthieu Le Corre's avatar Matthieu Le Corre
Browse files

Update for production


Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent 03c8ee95
## 1.0.4 NOT YET RELEASED
## 1.0.4 03-05-2019
### 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#)
[#15](https://gitlab.univ-nantes.fr/uncloud/files_readmemd/issues/15#)
- Fix public view failed to show images in 1.0.3
### 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 ....
- 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
......
......@@ -17,6 +17,7 @@ It show README.md in the way gitlab does.
* You can do the same with the HEADER.md file.
* It's rendered using the same markdown engine as the app. Before file list for the HEADER.md, after file list for the README.md
* You can now use .README.md & .HEADER.md .It means that you can now hide those files.
* You can also use .markdown extention.
* It render now in public shared !
Now you can use template to customize the README.md/HEADER.md rendering.
......@@ -24,4 +25,14 @@ Now you can use template to customize the README.md/HEADER.md rendering.
* Create your own theme and use your own content.css (see css/content.css file)
* Rendering is done inside a div contenair with headermd or readmemd class.
# Markdow enabled plugins
The following markdown plugins are available, more to come, fill a issue if you need more.
* Image sizing : [markdown-it-imsize](https://www.npmjs.com/package/markdown-it-imsize)
* Task list : [markdown-it-task-lists
](https://www.npmjs.com/package/markdown-it-task-lists)
* Code highlight : [markdown-it-highlightjs](https://www.npmjs.com/package/markdown-it-highlightjs)
This diff is collapsed.
This diff is collapsed.
......@@ -39,13 +39,17 @@ OCA.ReadmeMD.App = {
var hideContainerOnShowObserver = new MutationObserver(function(mutations) { self._callBackToggleContainer(mutations,"show") }) ;
//hide on showing trash / favorite / recent / share ...
hideContainerOnHideObserver.observe($('#app-content-files')[0],{attributes: true}) ;
if (this.mode == 'private') {
hideContainerOnHideObserver.observe($('#app-content-files')[0],{attributes: true}) ;
// this is a different for search as we doesn't toogle on hide but on show
hideContainerOnShowObserver.observe($('#searchresults')[0],{attributes: true}) ;
} ;
// this one is for mindmap or all other "fullscreen" apps
hideContainerOnHideObserver.observe($('#filestable')[0],{attributes: true }) ;
// this is a different for search as we doesn't toogle on hide but on show
hideContainerOnShowObserver.observe($('#searchresults')[0],{attributes: true}) ;
},
......@@ -146,11 +150,16 @@ OCA.ReadmeMD.App = {
*/
createContainer: function(zone) {
if (zone.position == "before")
{ $('#filestable').before(zone.container) ; }
if (zone.position == "after")
{ $('#app-content-files').after(zone.container) ; }
if (zone.position == "before")
{ $('#filestable').before(zone.container) ; }
if (zone.position == "after")
{ if (this.mode == 'private') {
$('#app-content-files').after(zone.container) ;
} else {
$('#files-public-content').after(zone.container) ;
}
}
},
/**
......@@ -166,7 +175,7 @@ OCA.ReadmeMD.App = {
var URL = OC.generateUrl('/s/{token}/download?path={path}&files={file}', {token: token, path: dir, file: zone.filename});
}else{
var dir = OCA.Files.App.fileList._currentDirectory ;
var URL = OC.linkToRemoteBase('files'+ dir +"/" +zone.filename)
var URL = OC.linkToRemoteBase('files'+ dir + '/' + zone.filename)
} ;
//load header file via remote call apps
$.get(URL)
......@@ -183,24 +192,31 @@ OCA.ReadmeMD.App = {
renderMD: function(zone) {
//render MD
//var self = this ;
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'))
replaceLink: function(link,env){
if ( link.startsWith('http://') || link.startsWith('https://') ) {
return link ;
} else {
if (self.mode == 'public') {
var token = $('#sharingToken').val()
var dir = OCA.Sharing.PublicApp.fileList._currentDirectory ;
return OC.generateUrl('/s/{token}/download?path={path}&files={file}', {token: token, path: dir, file: link}) ;
} else {
var dir = OCA.Files.App.fileList._currentDirectory ;
return OC.linkToRemoteBase('files') + dir + '/' + 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") ;
......
......@@ -11,8 +11,10 @@ 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