2020-11-30 21:50:40 +08:00
|
|
|
|
{% load static %}
|
2020-12-02 21:25:59 +08:00
|
|
|
|
{% load i18n %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<!DOCTYPE html>
|
2021-01-07 22:42:25 +08:00
|
|
|
|
<html lang="zh-cn" style="font-size: 15px;">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
|
|
|
<meta http-equiv="Cache-Control" content="no-transform" />
|
|
|
|
|
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
|
|
|
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
2020-12-13 15:59:24 +08:00
|
|
|
|
<meta name="referrer" content="strict-origin">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
2020-10-18 08:05:41 +08:00
|
|
|
|
<meta name="keywords" content="{% block keyword %}{% endblock %}{{site_keywords}}"/>
|
2020-02-17 23:02:53 +08:00
|
|
|
|
<meta name="description" content="{% block description %}{% endblock %}" />
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<title>{% block title %}{% endblock %} - {% if site_name != None and site_name != '' %}{{site_name}} {% else %}{% trans "站点标题" %}{% endif %}</title>
|
2020-03-07 09:30:11 +08:00
|
|
|
|
<link href="{% static 'layui/css/layui.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
|
|
|
|
<link rel="stylesheet" href="{% static 'editor.md/css/editormd.css' %}?version={{mrdoc_version}}" />
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% if doc.editor_mode == 2 %}
|
|
|
|
|
<link rel="stylesheet" href="{% static 'vditor/dist/index.css' %}?version={{mrdoc_version}}" />
|
|
|
|
|
{% endif %}
|
2020-08-07 21:36:37 +08:00
|
|
|
|
<link href="{% static 'viewerjs/viewer.min.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
2020-07-31 21:53:56 +08:00
|
|
|
|
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
2020-08-07 21:36:37 +08:00
|
|
|
|
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
2020-11-26 20:58:33 +08:00
|
|
|
|
<link href="{% static 'mrdoc/mrdoc-docs.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<style>
|
2020-12-06 10:16:10 +08:00
|
|
|
|
{% if img_scale %}
|
|
|
|
|
.markdown-body p img{
|
|
|
|
|
max-width: 350px;
|
|
|
|
|
}
|
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</style>
|
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
|
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
|
|
|
|
<![endif]-->
|
|
|
|
|
|
|
|
|
|
</head>
|
2020-11-28 08:10:11 +08:00
|
|
|
|
<body class="big-page">
|
2019-12-18 21:18:45 +08:00
|
|
|
|
<div class="doc layui-fluid" style="padding-left:0px;">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<!-- 左侧目录栏 -->
|
|
|
|
|
<div class="doc-summary">
|
|
|
|
|
<!-- 文档搜索 -->
|
|
|
|
|
<form action="{% url 'pro_index' pro_id=project.id %}" method="get">
|
|
|
|
|
<div id="doc-search-input">
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<input type="text" name="kw" placeholder="{% trans '输入并回车搜索' %}" value="" class="layui-input doc-search-input">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<!-- 文集名称 -->
|
|
|
|
|
<div class="project-title">
|
2020-12-22 21:02:57 +08:00
|
|
|
|
{% if project.icon %}
|
|
|
|
|
<svg class="icon" aria-hidden="true"><use xlink:href="#{{project.icon}}"></use></svg>
|
|
|
|
|
{% endif %}
|
2020-01-15 21:03:44 +08:00
|
|
|
|
<a href="{% url 'pro_index' pro_id=project.id %}">{{ project.name }}
|
|
|
|
|
{% if project.role == 1 %}
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<i class="layui-icon layui-icon-password" title="{% trans '私密文档' %}"></i>
|
2020-01-15 21:03:44 +08:00
|
|
|
|
{% endif %}
|
|
|
|
|
</a>
|
2020-12-31 07:56:33 +08:00
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
|
{% if is_collect_pro %}
|
|
|
|
|
<i class="layui-icon layui-icon-star-fill collected" style="cursor: pointer;" title="已收藏文集,点击取消" id="collect_pro"></i>
|
|
|
|
|
{% else %}
|
|
|
|
|
<i class="layui-icon layui-icon-star" style="cursor: pointer;" title="收藏文集" id="collect_pro"></i>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% else %}
|
|
|
|
|
<i class="layui-icon layui-icon-star" style="cursor: pointer;" title="请登录后收藏"></i>
|
|
|
|
|
{% endif %}
|
2020-04-03 21:05:27 +08:00
|
|
|
|
<p>
|
|
|
|
|
{% if colla_user > 0 %}
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<span style="font-size:12px;color:gray;font-weight:100;">{% trans "* 此为协作文集" %}</span>
|
2020-04-03 21:05:27 +08:00
|
|
|
|
{% endif %}
|
|
|
|
|
</p>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
<hr>
|
|
|
|
|
<!-- 遍历文集大纲 -->
|
2020-09-26 21:27:06 +08:00
|
|
|
|
<!-- 如果文集的文档数量超过999,使用异步加载文集目录 -->
|
|
|
|
|
{% if toc_cnt > 999 %}
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<div style="text-align: center;" id='loading-project-toc'><i class="fa fa-spinner fa-pulse"></i>{% trans "文集大纲加载中……" %}</div>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% load doc_filter %}
|
|
|
|
|
<nav>
|
|
|
|
|
<ul class="summary" id="project-toc"></ul>
|
|
|
|
|
</nav>
|
|
|
|
|
{% else %}
|
|
|
|
|
<!-- 文档数量小于999,使用同步加载文集目录 -->
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<nav>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
<ul class="summary">
|
|
|
|
|
<!-- 一级目录 -->
|
|
|
|
|
{% for docs in toc_list %}
|
|
|
|
|
<li>
|
|
|
|
|
{% if docs.children %}
|
|
|
|
|
<div style="display:flex;justify-content:space-between;">
|
|
|
|
|
<a href="{% url 'doc' pro_id=pro_id doc_id=docs.id %}" title="{{docs.name}}">{{ docs.name }}</a>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% if docs.open_children %}
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<i class="layui-icon layui-icon-down switch-toc" style="padding:15px;cursor: pointer;"></i>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% else %}
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<i class="layui-icon layui-icon-left switch-toc" style="padding:15px;cursor: pointer;"></i>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% endif %}
|
2020-09-26 21:27:06 +08:00
|
|
|
|
</div>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% if docs.open_children %}
|
|
|
|
|
<ul class="sub-menu">
|
|
|
|
|
{% else %}
|
|
|
|
|
<ul class="sub-menu toc-close">
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2020-09-26 21:27:06 +08:00
|
|
|
|
<!-- 二级目录 -->
|
|
|
|
|
{% for node in docs.children %}
|
|
|
|
|
<li>
|
|
|
|
|
{% if node.id|get_next_doc %}
|
|
|
|
|
<div style="display:flex;justify-content:space-between;">
|
|
|
|
|
<a href="{% url 'doc' pro_id=pro_id doc_id=node.id %}" title="{{node.name}}">{{ node.name }}</a>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% if node.open_children %}
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<i class="layui-icon layui-icon-down switch-toc" style="padding:15px;cursor: pointer;"></i>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% else %}
|
2021-01-06 07:45:52 +08:00
|
|
|
|
<i class="layui-icon layui-icon-left switch-toc" style="padding:15px;cursor: pointer;"></i>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% endif %}
|
2020-09-26 21:27:06 +08:00
|
|
|
|
</div>
|
2020-11-16 21:32:08 +08:00
|
|
|
|
{% if node.open_children %}
|
|
|
|
|
<ul class="sub-menu">
|
|
|
|
|
{% else %}
|
|
|
|
|
<ul class="sub-menu toc-close">
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2020-09-26 21:27:06 +08:00
|
|
|
|
<!-- 三级目录 -->
|
|
|
|
|
{% for doc in node.children %}
|
|
|
|
|
<li><a href="{% url 'doc' pro_id=pro_id doc_id=doc.id %}" title="{{doc.name}}">{{ doc.name }}</a></li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=pro_id doc_id=node.id %}" title="{{node.name}}">{{ node.name }}</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=pro_id doc_id=docs.id %}" title="{{docs.name}}">{{ docs.name }}</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</nav>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<div class="bq">
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<a href="javascript:void(0);" class="mrdoc-link" id="dashang">{% trans "本文档使用MrDoc发布" %}</a>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
2020-05-21 10:24:30 +08:00
|
|
|
|
<!-- 右下角广告块 -->
|
|
|
|
|
<!-- 广告代码开始 -->
|
|
|
|
|
{% if debug %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% if ad_code_3 %}
|
2021-01-05 20:37:26 +08:00
|
|
|
|
<div class="ad-code" id="ad-code-3"></div>
|
2020-05-21 10:24:30 +08:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<!-- 广告代码结束 -->
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 左侧目录栏结束 -->
|
|
|
|
|
|
|
|
|
|
<!-- 右侧文档栏 -->
|
|
|
|
|
<div class="doc-body">
|
|
|
|
|
<!-- 文档导航 -->
|
|
|
|
|
<div class="doc-header" role="navigation">
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<a class="btn pull-left js-toolbar-action" aria-label="" href="javascript:void(0);" title="{% trans '切换侧边栏' %}">
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<i class="layui-icon layui-icon-slider"></i>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</a>
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<a class="btn pull-left font-small" href="javascript:void(0);" title="{% trans '缩小字体' %}">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<i class="fa fa-font">-</i>
|
|
|
|
|
</a>
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<a class="btn pull-left font-large" href="javascript:void(0);" title="{% trans '放大字体' %}">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<i class="fa fa-font">+</i>
|
|
|
|
|
</a>
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<a class="btn pull-left font-switch" href="javascript:void(0);" title="{% trans '切换字体类型' %}">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<i class="fa fa-text-height"></i>
|
|
|
|
|
</a>
|
|
|
|
|
<!-- 顶部工具栏 -->
|
|
|
|
|
{% block head_toolbar %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
<a class="btn pull-right" aria-label="" href="{% url 'pro_list' %}">
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<i class="layui-icon layui-icon-home"></i> <span class="layui-hide-xs">{% trans "首页" %}</span>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 文档主体 -->
|
|
|
|
|
<div class="doc-body-content">
|
|
|
|
|
<div class="doc-body-content-div">
|
2020-12-30 07:47:54 +08:00
|
|
|
|
{% if project.is_watermark %}
|
|
|
|
|
<div id="wm"></div>
|
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<!-- 文档内容 -->
|
|
|
|
|
<div class="doc-content">
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
<div class="doc-info">
|
|
|
|
|
<!-- 页面主体头信息 -->
|
|
|
|
|
{% block content_head %}
|
|
|
|
|
{% endblock %}
|
2020-12-30 07:47:54 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<!-- 广告代码开始 -->
|
2020-01-15 21:03:44 +08:00
|
|
|
|
{% if debug %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% if ad_code %}
|
2021-01-05 20:37:26 +08:00
|
|
|
|
<div class="ad-code" id="ad-code-1"></div>
|
2020-01-15 21:03:44 +08:00
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endif %}
|
|
|
|
|
<!-- 广告代码结束 -->
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 标题结束 -->
|
|
|
|
|
<!-- 正文开始 -->
|
2020-05-02 21:21:51 +08:00
|
|
|
|
<div class="markdown-body" id="content" style="padding: 20px;padding-top: 5px;">
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block page_content %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 正文结束 -->
|
2020-12-15 20:48:47 +08:00
|
|
|
|
<div class="markdown-body" style="padding-left: 20px;">
|
|
|
|
|
{% block children_content %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
</div>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
2020-07-20 21:38:29 +08:00
|
|
|
|
<hr>
|
|
|
|
|
<!-- 分享栏 -->
|
2020-10-28 21:39:33 +08:00
|
|
|
|
<div style="color: rgba(0,0,0,.65);padding-bottom: 10px;margin-top: 10px;">
|
2020-07-31 20:23:23 +08:00
|
|
|
|
{% block doc_bottom_block %}
|
|
|
|
|
{% endblock %}
|
2020-08-30 13:51:26 +08:00
|
|
|
|
</div>
|
2020-03-21 16:11:21 +08:00
|
|
|
|
|
2020-05-02 18:16:57 +08:00
|
|
|
|
<!-- 广告代码开始 -->
|
|
|
|
|
{% if debug %}
|
|
|
|
|
{% else %}
|
2020-05-21 10:24:30 +08:00
|
|
|
|
{% if ad_code_2 %}
|
2021-01-05 20:41:50 +08:00
|
|
|
|
<div class="ad-code" id="ad-code-2"></div>
|
2020-05-02 18:16:57 +08:00
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<!-- 广告代码结束 -->
|
|
|
|
|
|
2020-01-15 21:03:44 +08:00
|
|
|
|
{% block doc_previous_next %}{% endblock %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 右侧文档栏结束 -->
|
2020-10-18 08:05:41 +08:00
|
|
|
|
<!-- 右下角工具按钮 -->
|
2020-11-16 21:32:08 +08:00
|
|
|
|
<div class="fixed-tool-bar">
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<div class="toTop" ><i class="layui-icon layui-icon-up"></i></div>
|
2020-10-18 08:05:41 +08:00
|
|
|
|
{% block right_widget %} {% endblock %}
|
|
|
|
|
</div>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2020-11-29 14:03:39 +08:00
|
|
|
|
<!-- 分享选项卡模板 -->
|
|
|
|
|
<div id="share_div" style="display: none;">
|
|
|
|
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
|
|
|
|
<ul class="layui-tab-title">
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<li class="layui-this">{% trans "微信扫一扫" %}</li>
|
|
|
|
|
<li>{% trans "复制链接" %}</li>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
<div class="layui-tab-content" style="height: 100px;">
|
|
|
|
|
<div class="layui-tab-item layui-show" align='center'>
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<p style="font-weight: 700;margin-bottom: 10px;">{% trans "手机扫一扫进行分享" %}</p>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
<div id="url_qrcode"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-tab-item" align='center'>
|
|
|
|
|
<input type="text" id="copy_crt_url" name="current_url" class="layui-input" /><br>
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<button class="layui-btn layui-btn-radius layui-btn-xs" style="background-color: #333;" id="copy_doc_url"">{% trans "复制链接" %}</button>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-07-31 20:44:14 +08:00
|
|
|
|
|
2020-11-29 14:03:39 +08:00
|
|
|
|
<!-- 打赏选项卡模板 -->
|
|
|
|
|
<div id="dashang_img" style="display: none;">
|
|
|
|
|
<div class="layui-tab layui-tab-brief">
|
|
|
|
|
<ul class="layui-tab-title">
|
2020-12-06 01:33:59 +08:00
|
|
|
|
<li class="layui-this">{% trans "微信" %}</li>
|
|
|
|
|
<li>{% trans "支付宝" %}</li>
|
|
|
|
|
<li>{% trans "QQ支付" %}</li>
|
|
|
|
|
<li>{% trans "PayPal" %}</li>
|
|
|
|
|
<li>{% trans "项目源码" %}</li>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
<div class="layui-tab-content" style="height: 100px;">
|
|
|
|
|
<div class="layui-tab-item layui-show" align='center'>
|
|
|
|
|
<img src="{% static 'dashang/dashang_wx.webp' %}" style="width: 300px;height: auto;" />
|
|
|
|
|
</div>
|
2020-07-31 20:36:44 +08:00
|
|
|
|
|
2020-11-29 14:03:39 +08:00
|
|
|
|
<div class="layui-tab-item" align='center'>
|
|
|
|
|
<img src="{% static 'dashang/dashang_alipay.webp' %}" style="width: 300px;height: auto;" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-tab-item" align='center'>
|
|
|
|
|
<img src="{% static 'dashang/dashang_qq.webp' %}" style="width: 300px;height: auto;" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-tab-item" align='center'>
|
|
|
|
|
<a href="https://paypal.me/zmister" target="_blank">
|
|
|
|
|
<img src="{% static 'dashang/dashang_paypal.png' %}" style="width: 280px;height: auto;" />
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-tab-item" align='center'>
|
|
|
|
|
<p><a href="https://github.com/zmister2016/MrDoc" target="_blank">GitHub:https://github.com/zmister2016/MrDoc</a></p>
|
|
|
|
|
<br>
|
|
|
|
|
<p><a href="https://gitee.com/zmister/MrDoc" target="_blank">码云:https://gitee.com/zmister/MrDoc</a> </p>
|
|
|
|
|
<br>
|
|
|
|
|
<p><a href="https://zmister.com" target="_blank">作者博客:https://zmister.com</a></p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'layui/layui.all.js' %}"></script>
|
2020-12-30 07:47:54 +08:00
|
|
|
|
<script src="{% static 'viewerjs/viewer.min.js' %}"></script>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
<script src="{% static 'qrcodejs/qrcode.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'mrdoc/mrdoc-docs.js' %}?version={{mrdoc_version}}"></script>
|
2020-12-22 21:02:57 +08:00
|
|
|
|
<script src="{% static 'iconFont/iconfont.js' %}"></script>
|
2020-11-28 08:10:11 +08:00
|
|
|
|
<script>
|
2020-11-29 14:03:39 +08:00
|
|
|
|
{% if toc_cnt > 999 %}
|
2020-12-06 09:06:28 +08:00
|
|
|
|
// 如果文集的文档数量大于999,使用异步加载左侧文集大纲
|
2020-11-29 14:03:39 +08:00
|
|
|
|
getProjectToc();
|
|
|
|
|
{% endif %}
|
2020-06-07 09:50:32 +08:00
|
|
|
|
</script>
|
2020-07-31 20:36:44 +08:00
|
|
|
|
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% if doc.editor_mode == 2 %}
|
2021-01-05 20:58:05 +08:00
|
|
|
|
<script src="{% static 'vditor/dist/method.min.js' %}?version={{mrdoc_version}}"></script>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% elif doc.editor_mode == 1 %}
|
2020-07-31 20:23:23 +08:00
|
|
|
|
<script src="{% static 'editor.md/lib/marked.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'editor.md/lib/prettify.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'editor.md/lib/raphael.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'editor.md/lib/underscore.min.js' %}"></script>
|
|
|
|
|
<script src="{% static 'editor.md/editormd.js' %}?version={{mrdoc_version}}"></script>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% endif %}
|
2020-08-07 21:36:37 +08:00
|
|
|
|
|
2020-11-28 08:10:11 +08:00
|
|
|
|
<!-- 解析渲染Markdown -->
|
2020-07-31 20:23:23 +08:00
|
|
|
|
<script>
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% if doc.editor_mode == 1 %}
|
2020-12-06 09:06:28 +08:00
|
|
|
|
// EditorMD模式
|
2020-09-26 21:27:06 +08:00
|
|
|
|
//解析Markdown为HTML
|
|
|
|
|
editormd.markdownToHTML("content", {
|
|
|
|
|
htmlDecode : "style,script,iframe",
|
|
|
|
|
emoji : true, //emoji表情
|
|
|
|
|
taskList : true, // 任务列表
|
|
|
|
|
tex : true, // 科学公式
|
|
|
|
|
flowChart : true, // 流程图
|
|
|
|
|
sequenceDiagram : true, // 时序图
|
|
|
|
|
tocm : true, //目录
|
|
|
|
|
toc :true,
|
|
|
|
|
tocContainer : "#toc-container",
|
|
|
|
|
tocDropdown : false,
|
|
|
|
|
atLink : false,//禁用@链接
|
2020-12-18 20:13:21 +08:00
|
|
|
|
htmlDecode : "link,style,base,script,iframe", //过滤部分HTML标签
|
2020-09-26 21:27:06 +08:00
|
|
|
|
});
|
2020-12-06 09:06:28 +08:00
|
|
|
|
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% elif doc.editor_mode == 2 %}
|
2020-12-07 20:58:59 +08:00
|
|
|
|
// Vditor模式
|
2020-09-26 21:27:06 +08:00
|
|
|
|
// 渲染Markdown
|
2020-12-18 22:16:23 +08:00
|
|
|
|
// var initRender = () => {
|
|
|
|
|
var md_content = $("#content textarea").val()
|
|
|
|
|
Vditor.preview(document.getElementById('content'),md_content,
|
|
|
|
|
{
|
|
|
|
|
"cdn":"{% static 'vditor' %}",
|
|
|
|
|
speech: {
|
|
|
|
|
enable: true,
|
|
|
|
|
},
|
|
|
|
|
anchor: 1,
|
|
|
|
|
after () {
|
|
|
|
|
var outlineElement = document.getElementById('toc-container')
|
|
|
|
|
var sub_ele = "<div class='markdown-toc editormd-markdown-toc'><ul class='markdown-toc-list'></ul></div>"
|
|
|
|
|
$("#toc-container").append(sub_ele)
|
|
|
|
|
var toc_elem = $("#toc-container div ul.markdown-toc-list")
|
|
|
|
|
Vditor.outlineRender(document.getElementById('content'), toc_elem[0])
|
|
|
|
|
if (outlineElement.innerText.trim() !== '') {
|
|
|
|
|
var toc_cnt = $(".markdown-toc-list").children().length;
|
|
|
|
|
//console.log(toc_cnt)
|
|
|
|
|
if(toc_cnt > 0){
|
|
|
|
|
//console.log('显示文档目录')
|
|
|
|
|
$(".tocMenu").show();
|
|
|
|
|
initSidebar('.sidebar', '.doc-content');
|
2020-09-26 21:27:06 +08:00
|
|
|
|
}
|
2020-12-18 22:16:23 +08:00
|
|
|
|
}else{
|
|
|
|
|
console.log("无目录")
|
|
|
|
|
};
|
|
|
|
|
// 图片放大显示
|
|
|
|
|
var img_options = {
|
|
|
|
|
url: 'data-original',
|
|
|
|
|
fullscreen:false,//全屏
|
|
|
|
|
rotatable:false,//旋转
|
|
|
|
|
scalable:false,//翻转
|
|
|
|
|
button:false,//关闭按钮
|
|
|
|
|
toolbar:false,
|
|
|
|
|
title:false,
|
|
|
|
|
};
|
|
|
|
|
var img_viewer = new Viewer(document.getElementById('content'), img_options);
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
// }
|
|
|
|
|
// initRender();
|
2020-09-26 21:27:06 +08:00
|
|
|
|
{% endif %}
|
2020-12-30 07:47:54 +08:00
|
|
|
|
|
|
|
|
|
{% if project.is_watermark %}
|
|
|
|
|
var img_base64 = textBecomeImg('{{project.watermark_value}}','14','#000')
|
|
|
|
|
document.getElementById("wm").style.background = 'url('+ img_base64 + ')'
|
|
|
|
|
{% endif %}
|
2020-12-18 22:16:23 +08:00
|
|
|
|
</script>
|
2020-12-07 20:58:59 +08:00
|
|
|
|
|
2020-12-18 22:16:23 +08:00
|
|
|
|
<script>
|
|
|
|
|
{% if doc.editor_mode != 2 %}
|
|
|
|
|
// 图片放大显示
|
|
|
|
|
var img_options = {
|
|
|
|
|
url: 'data-original',
|
|
|
|
|
fullscreen:false,//全屏
|
|
|
|
|
rotatable:false,//旋转
|
|
|
|
|
scalable:false,//翻转
|
|
|
|
|
button:false,//关闭按钮
|
|
|
|
|
toolbar:false,
|
|
|
|
|
title:false,
|
|
|
|
|
};
|
|
|
|
|
var img_viewer = new Viewer(document.getElementById('content'), img_options);
|
|
|
|
|
{% endif %}
|
2020-12-31 07:56:33 +08:00
|
|
|
|
|
|
|
|
|
// 收藏文集
|
|
|
|
|
var layer = layui.layer;
|
|
|
|
|
$("#collect_pro").click(function(e){
|
|
|
|
|
$(this).toggleClass("layui-icon-star-fill layui-icon-star");
|
|
|
|
|
$(this).toggleClass("collected");
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'/my_collect/',
|
|
|
|
|
type:'post',
|
|
|
|
|
data:{'type':2,'id':'{{project.id}}'},
|
|
|
|
|
success:function(r){
|
|
|
|
|
layer.msg(r.data)
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
layer.msg("操作异常")
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// 收藏文档
|
|
|
|
|
$("#collect_doc").click(function(){
|
|
|
|
|
$(this).toggleClass("layui-icon-star-fill layui-icon-star")
|
|
|
|
|
$(this).toggleClass("collected")
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'/my_collect/',
|
|
|
|
|
type:'post',
|
|
|
|
|
data:{'type':1,'id':'{{doc.id}}'},
|
|
|
|
|
success:function(r){
|
|
|
|
|
layer.msg(r.data)
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
layer.msg("操作异常")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
2020-06-21 21:44:10 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
2021-01-05 20:37:26 +08:00
|
|
|
|
<!-- 动态添加广告代码 -->
|
2021-01-05 20:58:05 +08:00
|
|
|
|
{% if debug %}
|
|
|
|
|
{% else %}
|
2021-01-05 20:37:26 +08:00
|
|
|
|
<div id="ad-1">
|
|
|
|
|
{{ad_code|safe}}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="ad-2">
|
|
|
|
|
{{ad_code_2|safe}}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="ad-3">
|
|
|
|
|
{{ad_code_3|safe}}
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
2021-01-05 20:41:50 +08:00
|
|
|
|
$("#ad-1").appendTo($("#ad-code-1"));
|
|
|
|
|
$("#ad-2").appendTo($("#ad-code-2"));
|
|
|
|
|
$("#ad-3").appendTo($("#ad-code-3"));
|
2021-01-05 20:37:26 +08:00
|
|
|
|
</script>
|
2021-01-05 20:58:05 +08:00
|
|
|
|
{% endif %}
|
2021-01-05 20:37:26 +08:00
|
|
|
|
|
2020-06-21 21:44:10 +08:00
|
|
|
|
<!-- 统计代码开始 -->
|
|
|
|
|
{% if debug %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{{ static_code | safe }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<!-- 统计代码结束 -->
|
2020-03-21 16:11:21 +08:00
|
|
|
|
{% block custom_script %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endblock %}
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|