Comments (14)
有进展了。 虽然不是当初预想的那种方式。
现在默认不是创建到<body>
, 而是创建到<div id="mdp-container">
。
<div id="mdp-container">
的位置可以随意放置, 大小可以通过css控制。
比如: <div id="mdp-container" style="height: 300px;">
。
from markdown-plus.
layout 是借助 这个项目实现的: http://layout.jquery-dev.com/index.cfm
根据这里,你的需求是可以实现的:http://stackoverflow.com/questions/20557091/jquery-ui-layout-on-a-container-div-instead-of-body
这里是一个非全屏非body节点layout的例子: http://jsfiddle.net/JPEaa/223/
这个项目最起初是为App服务的,很多地方写得比较死。接下来会改进一下,提供一些容易使用的api。将来可以通过这样的方式一行代码搞定:
mdp.create('id-of-div');
等上述API可用了再关闭这个issue。
from markdown-plus.
貌似没用啊,还是和上面一样的提示。
我在外面套了一层:
<div id="mydiv">
...//index.html样例中<div class="ui-layout-north">开始的代码
</div>
然后是js:
<style>
#mydiv {
position:relative;
width:700px;
height:700px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$('#mydiv').layout({ applyDefaultStyles: true });
});
</script>
from markdown-plus.
要改这里的源码: https://github.com/tylingsoft/markdown-plus/blob/master/markdown-plus.js#L104
我建议你等等看。 我接下来会改进API的通用性。 目前的版本确实没有考虑到在其它各种环境中使用的情况。
from markdown-plus.
感谢!:+1:
另外问问,从数据库读取出md文本后,在html页面上怎么显示?
from markdown-plus.
https://github.com/tylingsoft/markdown-plus/blob/master/index.js#L3
from markdown-plus.
我的意思是如何将md文本渲染成html代码
from markdown-plus.
两种方法:
一种是先设置左侧编辑器的值,再读取右侧的html:
editor.session.setValue(markdown, -1);
setTimeout(function(){ console.log($('article#preview').html()); }, 1000); // 等待1000毫秒,页面渲染完毕
还有一种是直接调用api:
var html = mdc.render(markdown);
第二种方式又快又简单,可以纯server端搞定。但是不支持mermaid图表,因为mermaid必须得借助客户端浏览器。
from markdown-plus.
纯server端搞定是用nodejs吗?
php这种能处理么?
from markdown-plus.
node.js.
php的话还得借助客户端浏览器执行那条语句.
from markdown-plus.
ok,谢谢
from markdown-plus.
mdp.create('id-of-div');
希望这种方式的api快点出来
不然考虑在iframe里使用了
from markdown-plus.
这样的api啥时候能出来?
mdp.create('id-of-div');
from markdown-plus.
不好意思,最近事情很多,虽然更新了很多内容,但是这个一直没有做。 有时间的请贡献代码。 我尽量抽空。
from markdown-plus.
Related Issues (20)
- 执行安装失败 HOT 1
- Flow chart arrows huge in windows version
- 请问怎么把代码弄成index.bundle.js,yarn watch时报这个错
- MDP Registered Last Versión Failed to Save As
- Include license as a file
- A vulnerablity on the website
- Online real-time collaborative edition?
- windows 10上没法用
- XSS via Markdown
- [[a,b],[c,d]] is not rendered
- Paginated PDF import contains only empty pages HOT 3
- 询问授权问题 HOT 1
- Visual code extension
- IE浏览器不可以使用预览功能吗?
- '\tag{num}' is not work
- Windows MDP 2.3.0: Window Maximized Improperly
- Windows MDP 2.3.0: Missing Exit Menu and Minimize to Systray option
- Commonmark conformance
- Standalone rendering engine
- flowchart arrows missing when export to html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown-plus.