Simple doc
Is a simple document publishing management tools, why write Simple doc
it? The main reason github
is wiki
not easy to use; no directory structure, the article did not Hx
label the index, the most tragic is that when editing the article can not be directly paste the picture and file upload; in order to meet their own needs incidentally also helped Beetlex
write a complete web
example so I spent some time to write Simple doc
. Although Simple doc
the function is simple but the documents show is better than github
the wiki
lot, so after the completion also put on Hao github
's wiki
move came on top of this (after all, are based on the markdown so move over too simple).
Features
-
Based on markdown
(If not
markdown
then this tool is not used) -
Support upload pictures and attachments
The default implementation only supports
jpa
,png
,zip
andrar
file upload (maximum 2MB, this limitation can modify), uploading support: drag and drop, paste and so on. -
Supports various code theme
Support dozens of code theme, choose your favorite theme from the viewer
-
Two-layer directory listing
Two directories can meet most needs in most cases, there is no support more hierarchical directory structure on the realization
-
Support structure tags article
As long as the article more than three h2, h3, h4 tag will generate a list of the corresponding directory files to facilitate the positioning of the article content
Operating Environment
Support linux
, windows
etc. equipped .net core 2.2
or higher version of the service environment.
Compile the project
From https://github.com/IKende/SimpleDoc download the latest source code, or a later version vs2017 open and then post it; there is complete after the release directory run.bat
and run.sh
two run file run. To run the windows service
needs of their own package, like the background may be used in the linux nohup &
to run commands.
HTTP Configuration
Items HttpConfig.json
are configuration-related services, mainly used to configure the service port, address, and HTTPs
so on. Details can be viewed http://doc.ikende.com/#c6d82c8e677f43cfa1127f32c308caa1
running result
You can view http://doc.ikende.com actual deployment effect, which is beetlex
the official document address.
Select the code theme
Simple doc
Code theme is the viewer to choose their own, select View other articles in the code is the theme to show.
management
Since it is a simple version, of course, that the management function directly rude, functionality and interface are quite simple there are three main functions:! Category management, article management and configuration (Note: The login user name admin
, password 123456
).
However, the article still has a content classification, classification if the content of the case when browsing content will show up, if not the first article under the classification will take to show. In addition to the basic information is also provided if the order set publishing and sort of, if there is no release of classified or article is not to show up.
Post Editor
Let you look at what is the most simple edit page of the document ......
Edit preview mode can be switched as required
不要惊讶你看到http://doc.ikende.com上的所有文档就是这样编辑出来的;其实markdown
还真不需要什么多功能的文本编辑器, 有一个文档输入框就足够了。但上面的输入框还有一个很重要的功能,就是支持图片粘贴和拖放,再结合下面的上传按钮就足可以完成附件添加功能.编辑旁边有一个预览按钮,可以切换过去看当前编辑内容的完整展现。
管理配置
主要用于修改网站标题,管理密码和JWT
对应的Key
实现技术
Simple doc
是基于BeetleX.FastHttpApi
和vuejs
来实现,对于我这样一个后端人员来vuejs
的切入还是比较容易的,说实话用起还真是爽!在这个项目除了了解到BeetleX.FastHttpApi
和vuejs
的结合外还能了解到一些js处理粘贴文件上传和图片大小切割的一些实现功能。其实为了更好地和vuejs
还封装了一个对应的client类,以下简单地展现一下Simple doc
的登陆代码:
- html
<form> <div class="form-group"> <label>用户名</label> <input type="text" v-model="login.data.name" class="form-control input-sm"> </div> <div class="form-group"> <label>密码</label> <input type="password" v-model="login.data.pwd" class="form-control input-sm"> </div> <button type="button" @click="login.post()" class="btn btn-default btn-sm">登陆</button> </form>
- javascript
var login = new beetlexAction("/admin/Login", { name: '', pwd: '' }); login.requesting = function (d) { if (!d.name || !d.pwd) { alert('输入登陆用户名和密码!'); return false; } return true; }; login.requested = function (r) { if (r) { window.location.href = "/admin/"; } else { alert('用户名或密码不正确!'); } }; var page = new Vue({ el: '#page', data: { info: webSiteInfo, login: login, } });
- server api
[SkipFilter(typeof(AdminFilter))] public object Login(string name, string pwd, IHttpContext context) { if (name == Webconfig.Default.Data.Usename && pwd == Webconfig.Default.Data.Password) { JWTHelper.Default.CreateToken(context.Response, name, "admin"); return true; } return false; }
如果你对这种应用技术感兴趣可以关注Simple doc
的源码和BeetleX